| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ios/chrome/browser/net/chrome_cookie_store_ios_client.h" | 5 #include "ios/chrome/browser/net/chrome_cookie_store_ios_client.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/threading/sequenced_worker_pool.h" |
| 8 #import "ios/chrome/browser/browsing_data/browsing_data_change_listening.h" | 9 #import "ios/chrome/browser/browsing_data/browsing_data_change_listening.h" |
| 9 #include "ios/web/public/web_thread.h" | 10 #include "ios/web/public/web_thread.h" |
| 10 | 11 |
| 11 #if !defined(__has_feature) || !__has_feature(objc_arc) | 12 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 12 #error "This file requires ARC support." | 13 #error "This file requires ARC support." |
| 13 #endif | 14 #endif |
| 14 | 15 |
| 15 ChromeCookieStoreIOSClient::ChromeCookieStoreIOSClient( | 16 ChromeCookieStoreIOSClient::ChromeCookieStoreIOSClient( |
| 16 id<BrowsingDataChangeListening> browsing_data_change_listener) | 17 id<BrowsingDataChangeListening> browsing_data_change_listener) |
| 17 : browsing_data_change_listener_(browsing_data_change_listener) { | 18 : browsing_data_change_listener_(browsing_data_change_listener) { |
| 18 DCHECK(browsing_data_change_listener); | 19 DCHECK(browsing_data_change_listener); |
| 19 DCHECK_CURRENTLY_ON(web::WebThread::IO); | 20 DCHECK_CURRENTLY_ON(web::WebThread::IO); |
| 20 } | 21 } |
| 21 | 22 |
| 22 void ChromeCookieStoreIOSClient::DidChangeCookieStorage() const { | 23 void ChromeCookieStoreIOSClient::DidChangeCookieStorage() const { |
| 23 DCHECK(thread_checker_.CalledOnValidThread()); | 24 DCHECK(thread_checker_.CalledOnValidThread()); |
| 24 | 25 |
| 25 [browsing_data_change_listener_ didChangeCookieStorage]; | 26 [browsing_data_change_listener_ didChangeCookieStorage]; |
| 26 } | 27 } |
| 27 | 28 |
| 28 scoped_refptr<base::SequencedTaskRunner> | 29 scoped_refptr<base::SequencedTaskRunner> |
| 29 ChromeCookieStoreIOSClient::GetTaskRunner() const { | 30 ChromeCookieStoreIOSClient::GetTaskRunner() const { |
| 30 DCHECK(thread_checker_.CalledOnValidThread()); | 31 DCHECK(thread_checker_.CalledOnValidThread()); |
| 31 | 32 |
| 32 base::SequencedWorkerPool* pool = web::WebThread::GetBlockingPool(); | 33 base::SequencedWorkerPool* pool = web::WebThread::GetBlockingPool(); |
| 33 return pool->GetSequencedTaskRunner(pool->GetSequenceToken()).get(); | 34 return pool->GetSequencedTaskRunner(pool->GetSequenceToken()).get(); |
| 34 } | 35 } |
| OLD | NEW |