Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / ios / chrome / browser / net / chrome_cookie_store_ios_client.mm
blobfb0b8f05c713ebffedf1698c2dee8192b5277c1f
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "ios/chrome/browser/net/chrome_cookie_store_ios_client.h"
7 #include "base/logging.h"
8 #import "ios/chrome/browser/browsing_data_change_listening.h"
9 #include "ios/web/public/web_thread.h"
11 ChromeCookieStoreIOSClient::ChromeCookieStoreIOSClient(
12     id<BrowsingDataChangeListening> browsing_data_change_listener)
13     : browsing_data_change_listener_(browsing_data_change_listener) {
14   DCHECK(browsing_data_change_listener);
15   DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO);
18 void ChromeCookieStoreIOSClient::DidChangeCookieStorage() const {
19   DCHECK(thread_checker_.CalledOnValidThread());
21   [browsing_data_change_listener_ didChangeCookieStorage];
24 scoped_refptr<base::SequencedTaskRunner>
25 ChromeCookieStoreIOSClient::GetTaskRunner() const {
26   DCHECK(thread_checker_.CalledOnValidThread());
28   base::SequencedWorkerPool* pool = web::WebThread::GetBlockingPool();
29   return pool->GetSequencedTaskRunner(pool->GetSequenceToken()).get();