diff options
author | sdefresne <sdefresne@chromium.org> | 2016-02-18 02:35:58 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-02-18 10:36:57 +0000 |
commit | e5ca870ce113eb9f6c7b804b5707f606f85c389e (patch) | |
tree | 5c08f40df770529a0fadd3c74d7553b4bbee6051 | |
parent | a8b3cb0b38cab9abdb57e161989bbdd558581a31 (diff) | |
download | chromium_src-e5ca870ce113eb9f6c7b804b5707f606f85c389e.zip chromium_src-e5ca870ce113eb9f6c7b804b5707f606f85c389e.tar.gz chromium_src-e5ca870ce113eb9f6c7b804b5707f606f85c389e.tar.bz2 |
Rename DCHECK_CURRENTLY_ON_WEB_THREAD to DCHECK_CURRENTLY_ON.
Chrome on iOS no longer has any dependency on content/ so there is no
risk of collision between the two macros.
Keep the DCHECK_CURRENTLY_ON_WEB_THREAD name as an alias until all the
downstream code has been ported to use the new name.
Port all client code to use the new name using tools/git/mffr.py and
"git cl format".
BUG=438202
Review URL: https://codereview.chromium.org/1713453002
Cr-Commit-Position: refs/heads/master@{#376135}
41 files changed, 240 insertions, 240 deletions
diff --git a/ios/chrome/browser/browser_state/chrome_browser_state.mm b/ios/chrome/browser/browser_state/chrome_browser_state.mm index adb2333..a6f361b 100644 --- a/ios/chrome/browser/browser_state/chrome_browser_state.mm +++ b/ios/chrome/browser/browser_state/chrome_browser_state.mm @@ -65,7 +65,7 @@ TestChromeBrowserState* ChromeBrowserState::AsTestChromeBrowserState() { } net::URLRequestContextGetter* ChromeBrowserState::GetRequestContext() { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); if (!request_context_getter_) { ProtocolHandlerMap protocol_handlers; protocol_handlers[kChromeUIScheme] = diff --git a/ios/chrome/browser/browser_state/chrome_browser_state_impl_io_data.mm b/ios/chrome/browser/browser_state/chrome_browser_state_impl_io_data.mm index c905f27..cd064ef 100644 --- a/ios/chrome/browser/browser_state/chrome_browser_state_impl_io_data.mm +++ b/ios/chrome/browser/browser_state/chrome_browser_state_impl_io_data.mm @@ -156,12 +156,12 @@ ChromeBrowserStateImplIOData::Handle::Handle( : io_data_(new ChromeBrowserStateImplIOData), browser_state_(browser_state), initialized_(false) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); DCHECK(browser_state); } ChromeBrowserStateImplIOData::Handle::~Handle() { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); if (io_data_->http_server_properties_manager_) io_data_->http_server_properties_manager_->ShutdownOnPrefThread(); @@ -179,7 +179,7 @@ void ChromeBrowserStateImplIOData::Handle::Init( const base::FilePath& cache_path, int cache_max_size, const base::FilePath& profile_path) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); DCHECK(!io_data_->lazy_params_); LazyParams* lazy_params = new LazyParams(); @@ -230,7 +230,7 @@ ChromeBrowserStateImplIOData::Handle::CreateMainRequestContextGetter( ProtocolHandlerMap* protocol_handlers, PrefService* local_state, IOSChromeIOThread* io_thread) const { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); LazyInitialize(); DCHECK(!main_request_context_getter_.get()); main_request_context_getter_ = @@ -242,7 +242,7 @@ ChromeBrowserStateImplIOData::Handle::CreateMainRequestContextGetter( scoped_refptr<IOSChromeURLRequestContextGetter> ChromeBrowserStateImplIOData::Handle::CreateIsolatedAppRequestContextGetter( const base::FilePath& partition_path) const { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); // Check that the partition_path is not the same as the base profile path. We // expect isolated partition, which will never go to the default profile path. CHECK(partition_path != browser_state_->GetStatePath()); @@ -270,7 +270,7 @@ ChromeBrowserStateIOData* ChromeBrowserStateImplIOData::Handle::io_data() void ChromeBrowserStateImplIOData::Handle::ClearNetworkingHistorySince( base::Time time, const base::Closure& completion) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); LazyInitialize(); web::WebThread::PostTask( @@ -281,7 +281,7 @@ void ChromeBrowserStateImplIOData::Handle::ClearNetworkingHistorySince( } void ChromeBrowserStateImplIOData::Handle::LazyInitialize() const { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); if (initialized_) return; @@ -502,7 +502,7 @@ ChromeBrowserStateImplIOData::AcquireIsolatedAppRequestContext( void ChromeBrowserStateImplIOData::ClearNetworkingHistorySinceOnIOThread( base::Time time, const base::Closure& completion) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); DCHECK(initialized()); DCHECK(transport_security_state()); diff --git a/ios/chrome/browser/browser_state/chrome_browser_state_io_data.cc b/ios/chrome/browser/browser_state/chrome_browser_state_io_data.cc index 03d80c0..b9d5b88 100644 --- a/ios/chrome/browser/browser_state/chrome_browser_state_io_data.cc +++ b/ios/chrome/browser/browser_state/chrome_browser_state_io_data.cc @@ -74,7 +74,7 @@ namespace { void NotifyContextGettersOfShutdownOnIO( scoped_ptr<ChromeBrowserStateIOData::IOSChromeURLRequestContextGetterVector> getters) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); ChromeBrowserStateIOData::IOSChromeURLRequestContextGetterVector::iterator iter; for (auto& chrome_context_getter : *getters) @@ -85,7 +85,7 @@ void NotifyContextGettersOfShutdownOnIO( void ChromeBrowserStateIOData::InitializeOnUIThread( ios::ChromeBrowserState* browser_state) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); PrefService* pref_service = browser_state->GetPrefs(); scoped_ptr<ProfileParams> params(new ProfileParams); params->path = browser_state->GetOriginalChromeBrowserState()->GetStatePath(); @@ -165,12 +165,12 @@ ChromeBrowserStateIOData::ChromeBrowserStateIOData( : initialized_(false), initialized_on_UI_thread_(false), browser_state_type_(browser_state_type) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); } ChromeBrowserStateIOData::~ChromeBrowserStateIOData() { if (web::WebThread::IsMessageLoopValid(web::WebThread::IO)) - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); // Pull the contents of the request context maps onto the stack for sanity // checking of values in a minidump. http://crbug.com/260425 @@ -287,7 +287,7 @@ bool ChromeBrowserStateIOData::IsOffTheRecord() const { } void ChromeBrowserStateIOData::InitializeMetricsEnabledStateOnUIThread() { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); // Prep the PrefMember and send it to the IO thread, since this value will be // read from there. enable_metrics_.Init(metrics::prefs::kMetricsReportingEnabled, @@ -297,7 +297,7 @@ void ChromeBrowserStateIOData::InitializeMetricsEnabledStateOnUIThread() { } bool ChromeBrowserStateIOData::GetMetricsEnabledStateOnIOThread() const { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); return enable_metrics_.GetValue(); } @@ -327,7 +327,7 @@ void ChromeBrowserStateIOData::Init( // The basic logic is implemented here. The specific initialization // is done in InitializeInternal(), implemented by subtypes. Static helper // functions have been provided to assist in common operations. - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); DCHECK(!initialized_); // TODO(jhawkins): Remove once crbug.com/102004 is fixed. @@ -425,7 +425,7 @@ ChromeBrowserStateIOData::SetUpJobFactoryDefaults( void ChromeBrowserStateIOData::ShutdownOnUIThread( scoped_ptr<IOSChromeURLRequestContextGetterVector> context_getters) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); google_services_user_account_id_.Destroy(); enable_referrers_.Destroy(); diff --git a/ios/chrome/browser/browser_state/chrome_browser_state_manager_impl.cc b/ios/chrome/browser/browser_state/chrome_browser_state_manager_impl.cc index f0ae760..1320299 100644 --- a/ios/chrome/browser/browser_state/chrome_browser_state_manager_impl.cc +++ b/ios/chrome/browser/browser_state/chrome_browser_state_manager_impl.cc @@ -57,7 +57,7 @@ int64_t ComputeFilesSize(const base::FilePath& directory, // Simple task to log the size of the browser state at |path|. void BrowserStateSizeTask(const base::FilePath& path) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::FILE); + DCHECK_CURRENTLY_ON(web::WebThread::FILE); const int64_t kBytesInOneMB = 1024 * 1024; int64_t size = ComputeFilesSize(path, FILE_PATH_LITERAL("*")); diff --git a/ios/chrome/browser/browser_state/off_the_record_chrome_browser_state_io_data.mm b/ios/chrome/browser/browser_state/off_the_record_chrome_browser_state_io_data.mm index 44d8592..b420e0e 100644 --- a/ios/chrome/browser/browser_state/off_the_record_chrome_browser_state_io_data.mm +++ b/ios/chrome/browser/browser_state/off_the_record_chrome_browser_state_io_data.mm @@ -60,7 +60,7 @@ void OffTheRecordChromeBrowserStateIOData::Handle::DoomIncognitoCache() { main_request_context_getter_; web::WebThread::PostTask( web::WebThread::IO, FROM_HERE, base::BindBlock(^{ - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); net::HttpCache* cache = getter->GetURLRequestContext() ->http_transaction_factory() ->GetCache(); @@ -75,7 +75,7 @@ OffTheRecordChromeBrowserStateIOData::Handle::Handle( : io_data_(new OffTheRecordChromeBrowserStateIOData()), browser_state_(browser_state), initialized_(false) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); DCHECK(browser_state); io_data_->cookie_path_ = browser_state->GetStatePath().Append(kIOSChromeCookieFilename); @@ -84,7 +84,7 @@ OffTheRecordChromeBrowserStateIOData::Handle::Handle( } OffTheRecordChromeBrowserStateIOData::Handle::~Handle() { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); // Stop listening to notifications. CFNotificationCenterRemoveObserver(CFNotificationCenterGetLocalCenter(), this, @@ -96,7 +96,7 @@ OffTheRecordChromeBrowserStateIOData::Handle::~Handle() { scoped_refptr<IOSChromeURLRequestContextGetter> OffTheRecordChromeBrowserStateIOData::Handle::CreateMainRequestContextGetter( ProtocolHandlerMap* protocol_handlers) const { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); LazyInitialize(); DCHECK(!main_request_context_getter_.get()); main_request_context_getter_ = diff --git a/ios/chrome/browser/browsing_data/ios_chrome_browsing_data_remover.mm b/ios/chrome/browser/browsing_data/ios_chrome_browsing_data_remover.mm index ac900f8..5ee25fd 100644 --- a/ios/chrome/browser/browsing_data/ios_chrome_browsing_data_remover.mm +++ b/ios/chrome/browser/browsing_data/ios_chrome_browsing_data_remover.mm @@ -136,7 +136,7 @@ void IOSChromeBrowsingDataRemover::Remove(int remove_mask) { void IOSChromeBrowsingDataRemover::RemoveImpl(int remove_mask, const GURL& remove_url) { - DCHECK_CURRENTLY_ON_WEB_THREAD(WebThread::UI); + DCHECK_CURRENTLY_ON(WebThread::UI); set_removing(true); remove_mask_ = remove_mask; @@ -454,13 +454,13 @@ void IOSChromeBrowsingDataRemover::NotifyAndDeleteIfDone() { } void IOSChromeBrowsingDataRemover::OnClearedHostnameResolutionCache() { - DCHECK_CURRENTLY_ON_WEB_THREAD(WebThread::UI); + DCHECK_CURRENTLY_ON(WebThread::UI); waiting_for_clear_hostname_resolution_cache_ = false; NotifyAndDeleteIfDone(); } void IOSChromeBrowsingDataRemover::OnClearedNetworkingHistory() { - DCHECK_CURRENTLY_ON_WEB_THREAD(WebThread::UI); + DCHECK_CURRENTLY_ON(WebThread::UI); waiting_for_clear_networking_history_ = false; NotifyAndDeleteIfDone(); } @@ -472,7 +472,7 @@ void IOSChromeBrowsingDataRemover::OnClearedCache(int error) { } void IOSChromeBrowsingDataRemover::OnClearedPasswords() { - DCHECK_CURRENTLY_ON_WEB_THREAD(WebThread::UI); + DCHECK_CURRENTLY_ON(WebThread::UI); waiting_for_clear_passwords_ = false; NotifyAndDeleteIfDone(); } @@ -494,7 +494,7 @@ void IOSChromeBrowsingDataRemover::OnClearedCookies(int num_deleted) { void IOSChromeBrowsingDataRemover::ClearCookiesOnIOThread( const scoped_refptr<net::URLRequestContextGetter>& rq_context, const GURL& storage_url) { - DCHECK_CURRENTLY_ON_WEB_THREAD(WebThread::IO); + DCHECK_CURRENTLY_ON(WebThread::IO); net::CookieStore* cookie_store = rq_context->GetURLRequestContext()->cookie_store(); if (storage_url.is_empty()) { @@ -512,7 +512,7 @@ void IOSChromeBrowsingDataRemover::ClearCookiesOnIOThread( void IOSChromeBrowsingDataRemover::ClearChannelIDsOnIOThread( const scoped_refptr<net::URLRequestContextGetter>& rq_context) { - DCHECK_CURRENTLY_ON_WEB_THREAD(WebThread::IO); + DCHECK_CURRENTLY_ON(WebThread::IO); net::ChannelIDService* channel_id_service = rq_context->GetURLRequestContext()->channel_id_service(); channel_id_service->GetChannelIDStore()->DeleteAllCreatedBetween( @@ -537,19 +537,19 @@ void IOSChromeBrowsingDataRemover::OnClearedChannelIDsOnIOThread( } void IOSChromeBrowsingDataRemover::OnClearedChannelIDs() { - DCHECK_CURRENTLY_ON_WEB_THREAD(WebThread::UI); + DCHECK_CURRENTLY_ON(WebThread::UI); waiting_for_clear_channel_ids_ = false; NotifyAndDeleteIfDone(); } void IOSChromeBrowsingDataRemover::OnClearedFormData() { - DCHECK_CURRENTLY_ON_WEB_THREAD(WebThread::UI); + DCHECK_CURRENTLY_ON(WebThread::UI); waiting_for_clear_form_ = false; NotifyAndDeleteIfDone(); } void IOSChromeBrowsingDataRemover::OnClearedAutofillOriginURLs() { - DCHECK_CURRENTLY_ON_WEB_THREAD(WebThread::UI); + DCHECK_CURRENTLY_ON(WebThread::UI); waiting_for_clear_autofill_origin_urls_ = false; NotifyAndDeleteIfDone(); } diff --git a/ios/chrome/browser/installation_notifier.mm b/ios/chrome/browser/installation_notifier.mm index 859989a..8cc6f9a 100644 --- a/ios/chrome/browser/installation_notifier.mm +++ b/ios/chrome/browser/installation_notifier.mm @@ -131,7 +131,7 @@ const net::BackoffEntry::Policy kPollingBackoffPolicy = { } - (void)unregisterForNotifications:(id)observer { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); NSValue* weakReferenceToObserver = [NSValue valueWithNonretainedObject:observer]; [_notificationCenter removeObserver:observer]; @@ -155,7 +155,7 @@ const net::BackoffEntry::Policy kPollingBackoffPolicy = { } - (void)dispatchInstallationNotifierBlock { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); int blockId = ++lastCreatedBlockId_; _backoffEntry->InformOfRequest(false); int64_t delayInNSec = @@ -163,7 +163,7 @@ const net::BackoffEntry::Policy kPollingBackoffPolicy = { base::WeakNSObject<InstallationNotifier> weakSelf(self); [_dispatcher dispatchAfter:delayInNSec withBlock:^{ - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); base::scoped_nsobject<InstallationNotifier> strongSelf( [weakSelf retain]); if (blockId == [strongSelf lastCreatedBlockId]) { @@ -173,7 +173,7 @@ const net::BackoffEntry::Policy kPollingBackoffPolicy = { } - (void)pollForTheInstallationOfApps { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); __block BOOL keepPolling = NO; NSMutableSet* keysToDelete = [NSMutableSet set]; [_installedAppObservers enumerateKeysAndObjectsUsingBlock:^(id scheme, diff --git a/ios/chrome/browser/ios_chrome_io_thread.mm b/ios/chrome/browser/ios_chrome_io_thread.mm index 7dbb7bd..d29695a 100644 --- a/ios/chrome/browser/ios_chrome_io_thread.mm +++ b/ios/chrome/browser/ios_chrome_io_thread.mm @@ -283,7 +283,7 @@ SystemURLRequestContextGetter::SystemURLRequestContextGetter( SystemURLRequestContextGetter::~SystemURLRequestContextGetter() {} net::URLRequestContext* SystemURLRequestContextGetter::GetURLRequestContext() { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); DCHECK(io_thread_->globals()->system_request_context.get()); return io_thread_->globals()->system_request_context.get(); @@ -343,12 +343,12 @@ IOSChromeIOThread::~IOSChromeIOThread() { } IOSChromeIOThread::Globals* IOSChromeIOThread::globals() { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); return globals_; } void IOSChromeIOThread::SetGlobalsForTesting(Globals* globals) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); DCHECK(!globals || !globals_); globals_ = globals; } @@ -358,7 +358,7 @@ net_log::ChromeNetLog* IOSChromeIOThread::net_log() { } void IOSChromeIOThread::ChangedToOnTheRecord() { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); web::WebThread::PostTask( web::WebThread::IO, FROM_HERE, base::Bind(&IOSChromeIOThread::ChangedToOnTheRecordOnIOThread, @@ -367,7 +367,7 @@ void IOSChromeIOThread::ChangedToOnTheRecord() { net::URLRequestContextGetter* IOSChromeIOThread::system_url_request_context_getter() { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); if (!system_url_request_context_getter_.get()) { InitSystemRequestContext(); } @@ -376,7 +376,7 @@ IOSChromeIOThread::system_url_request_context_getter() { void IOSChromeIOThread::Init() { TRACE_EVENT0("startup", "IOSChromeIOThread::Init"); - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); net::SetMessageLoopForNSSHttpIO(); @@ -604,7 +604,7 @@ void IOSChromeIOThread::CreateDefaultAuthHandlerFactory() { } void IOSChromeIOThread::ClearHostCache() { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); net::HostCache* host_cache = globals_->host_resolver->GetHostCache(); if (host_cache) @@ -681,7 +681,7 @@ net::SSLConfigService* IOSChromeIOThread::GetSSLConfigService() { } void IOSChromeIOThread::ChangedToOnTheRecordOnIOThread() { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); // Clear the host cache to avoid showing entries from the OTR session // in about:net-internals. @@ -708,7 +708,7 @@ void IOSChromeIOThread::InitSystemRequestContext() { } void IOSChromeIOThread::InitSystemRequestContextOnIOThread() { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); DCHECK(!globals_->system_proxy_service.get()); DCHECK(system_proxy_config_service_.get()); diff --git a/ios/chrome/browser/net/chrome_cookie_store_ios_client.mm b/ios/chrome/browser/net/chrome_cookie_store_ios_client.mm index fb0b8f0..9d0e74b 100644 --- a/ios/chrome/browser/net/chrome_cookie_store_ios_client.mm +++ b/ios/chrome/browser/net/chrome_cookie_store_ios_client.mm @@ -12,7 +12,7 @@ ChromeCookieStoreIOSClient::ChromeCookieStoreIOSClient( id<BrowsingDataChangeListening> browsing_data_change_listener) : browsing_data_change_listener_(browsing_data_change_listener) { DCHECK(browsing_data_change_listener); - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); } void ChromeCookieStoreIOSClient::DidChangeCookieStorage() const { diff --git a/ios/chrome/browser/net/crl_set_fetcher.cc b/ios/chrome/browser/net/crl_set_fetcher.cc index 4b4e1f8..71d16a2 100644 --- a/ios/chrome/browser/net/crl_set_fetcher.cc +++ b/ios/chrome/browser/net/crl_set_fetcher.cc @@ -35,7 +35,7 @@ base::FilePath CRLSetFetcher::GetCRLSetFilePath() const { void CRLSetFetcher::StartInitialLoad(ComponentUpdateService* cus, const base::FilePath& path) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); if (path.empty()) return; SetCRLSetFilePath(path); @@ -49,7 +49,7 @@ void CRLSetFetcher::StartInitialLoad(ComponentUpdateService* cus, } void CRLSetFetcher::DeleteFromDisk(const base::FilePath& path) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); if (path.empty()) return; @@ -62,7 +62,7 @@ void CRLSetFetcher::DeleteFromDisk(const base::FilePath& path) { } void CRLSetFetcher::DoInitialLoadFromDisk() { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::FILE); + DCHECK_CURRENTLY_ON(web::WebThread::FILE); LoadFromDisk(GetCRLSetFilePath(), &crl_set_); @@ -83,7 +83,7 @@ void CRLSetFetcher::LoadFromDisk(base::FilePath path, scoped_refptr<net::CRLSet>* out_crl_set) { TRACE_EVENT0("CRLSetFetcher", "LoadFromDisk"); - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::FILE); + DCHECK_CURRENTLY_ON(web::WebThread::FILE); std::string crl_set_bytes; { @@ -107,7 +107,7 @@ void CRLSetFetcher::LoadFromDisk(base::FilePath path, } void CRLSetFetcher::SetCRLSetIfNewer(scoped_refptr<net::CRLSet> crl_set) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); scoped_refptr<net::CRLSet> old_crl_set(net::SSLConfigService::GetCRLSet()); if (old_crl_set.get() && old_crl_set->sequence() > crl_set->sequence()) { @@ -128,7 +128,7 @@ static const uint8_t kPublicKeySHA256[32] = { }; void CRLSetFetcher::RegisterComponent(uint32_t sequence_of_loaded_crl) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); update_client::CrxComponent component; component.pk_hash.assign(kPublicKeySHA256, @@ -147,7 +147,7 @@ void CRLSetFetcher::RegisterComponent(uint32_t sequence_of_loaded_crl) { } void CRLSetFetcher::DoDeleteFromDisk() { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::FILE); + DCHECK_CURRENTLY_ON(web::WebThread::FILE); DeleteFile(GetCRLSetFilePath(), false /* not recursive */); } diff --git a/ios/chrome/browser/net/ios_chrome_http_user_agent_settings.mm b/ios/chrome/browser/net/ios_chrome_http_user_agent_settings.mm index f3093c1..ae7357c 100644 --- a/ios/chrome/browser/net/ios_chrome_http_user_agent_settings.mm +++ b/ios/chrome/browser/net/ios_chrome_http_user_agent_settings.mm @@ -12,7 +12,7 @@ IOSChromeHttpUserAgentSettings::IOSChromeHttpUserAgentSettings( PrefService* prefs) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); pref_accept_language_.Init(prefs::kAcceptLanguages, prefs); last_pref_accept_language_ = *pref_accept_language_; last_http_accept_language_ = @@ -22,16 +22,16 @@ IOSChromeHttpUserAgentSettings::IOSChromeHttpUserAgentSettings( } IOSChromeHttpUserAgentSettings::~IOSChromeHttpUserAgentSettings() { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); } void IOSChromeHttpUserAgentSettings::CleanupOnUIThread() { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); pref_accept_language_.Destroy(); } std::string IOSChromeHttpUserAgentSettings::GetAcceptLanguage() const { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); std::string new_pref_accept_language = *pref_accept_language_; if (new_pref_accept_language != last_pref_accept_language_) { last_http_accept_language_ = @@ -42,6 +42,6 @@ std::string IOSChromeHttpUserAgentSettings::GetAcceptLanguage() const { } std::string IOSChromeHttpUserAgentSettings::GetUserAgent() const { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); return web::GetWebClient()->GetUserAgent(false); } diff --git a/ios/chrome/browser/net/ios_chrome_network_delegate.cc b/ios/chrome/browser/net/ios_chrome_network_delegate.cc index d5a2fa5..4fb2222 100644 --- a/ios/chrome/browser/net/ios_chrome_network_delegate.cc +++ b/ios/chrome/browser/net/ios_chrome_network_delegate.cc @@ -75,7 +75,7 @@ IOSChromeNetworkDelegate::~IOSChromeNetworkDelegate() {} void IOSChromeNetworkDelegate::InitializePrefsOnUIThread( BooleanPrefMember* enable_do_not_track, PrefService* pref_service) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); if (enable_do_not_track) { enable_do_not_track->Init(prefs::kEnableDoNotTrack, pref_service); enable_do_not_track->MoveToThread( diff --git a/ios/chrome/browser/net/ios_chrome_url_request_context_getter.cc b/ios/chrome/browser/net/ios_chrome_url_request_context_getter.cc index 1d6f4bb..0c53bc1 100644 --- a/ios/chrome/browser/net/ios_chrome_url_request_context_getter.cc +++ b/ios/chrome/browser/net/ios_chrome_url_request_context_getter.cc @@ -97,7 +97,7 @@ IOSChromeURLRequestContextGetter::~IOSChromeURLRequestContextGetter() { // Lazily create a URLRequestContext using our factory. net::URLRequestContext* IOSChromeURLRequestContextGetter::GetURLRequestContext() { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); if (factory_.get()) { DCHECK(!url_request_context_); @@ -109,7 +109,7 @@ IOSChromeURLRequestContextGetter::GetURLRequestContext() { } void IOSChromeURLRequestContextGetter::NotifyContextShuttingDown() { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); factory_.reset(); url_request_context_ = nullptr; diff --git a/ios/chrome/browser/net/metrics_network_client_manager.mm b/ios/chrome/browser/net/metrics_network_client_manager.mm index be7afdf..926c98a 100644 --- a/ios/chrome/browser/net/metrics_network_client_manager.mm +++ b/ios/chrome/browser/net/metrics_network_client_manager.mm @@ -83,14 +83,14 @@ #pragma mark - public UI-thread methods - (void)pageLoadStarted:(GURL)url { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); web::WebThread::PostTask(web::WebThread::IO, FROM_HERE, base::BindBlock(^{ [self handlePageLoadStarted:url]; })); } - (void)pageLoadCompleted { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); web::WebThread::PostTask(web::WebThread::IO, FROM_HERE, base::BindBlock(^{ [self handlePageLoadCompleted]; })); @@ -100,7 +100,7 @@ - (PageLoadTimeRecord*)recordForPageLoad:(const GURL&)url time:(base::TimeTicks)time { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); base::scoped_nsobject<PageLoadTimeRecord> plt; if (!_pageURL.spec().empty() && url == _pageURL) { plt.reset([[PageLoadTimeRecord alloc] initWithURL:url time:time]); @@ -112,13 +112,13 @@ #pragma mark - IO-thread handlers for UI thread methods. - (void)handlePageLoadStarted:(const GURL&)url { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); [_pageLoadTimes removeAllObjects]; _pageURL = url; } - (void)handlePageLoadCompleted { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); for (PageLoadTimeRecord* plt in _pageLoadTimes.get()) { if (plt.url == _pageURL && !plt.alreadyCounted) { plt.alreadyCounted = YES; diff --git a/ios/chrome/browser/net/proxy_service_factory.cc b/ios/chrome/browser/net/proxy_service_factory.cc index 456d8d9..f0180bb 100644 --- a/ios/chrome/browser/net/proxy_service_factory.cc +++ b/ios/chrome/browser/net/proxy_service_factory.cc @@ -49,7 +49,7 @@ scoped_ptr<net::ProxyService> ProxyServiceFactory::CreateProxyService( net::NetworkDelegate* network_delegate, scoped_ptr<net::ProxyConfigService> proxy_config_service, bool quick_check_enabled) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); scoped_ptr<net::ProxyService> proxy_service( net::ProxyService::CreateUsingSystemProxyResolver( std::move(proxy_config_service), 0, net_log)); diff --git a/ios/chrome/browser/safe_browsing/ping_manager.cc b/ios/chrome/browser/safe_browsing/ping_manager.cc index 4ffa0d3..37e477d 100644 --- a/ios/chrome/browser/safe_browsing/ping_manager.cc +++ b/ios/chrome/browser/safe_browsing/ping_manager.cc @@ -41,7 +41,7 @@ namespace safe_browsing { SafeBrowsingPingManager* SafeBrowsingPingManager::Create( net::URLRequestContextGetter* request_context_getter, const SafeBrowsingProtocolConfig& config) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); return new SafeBrowsingPingManager(request_context_getter, config); } diff --git a/ios/chrome/browser/safe_browsing/safe_browsing_service.cc b/ios/chrome/browser/safe_browsing/safe_browsing_service.cc index ae1576a..5372c4a 100644 --- a/ios/chrome/browser/safe_browsing/safe_browsing_service.cc +++ b/ios/chrome/browser/safe_browsing/safe_browsing_service.cc @@ -104,7 +104,7 @@ SafeBrowsingURLRequestContextGetter::SafeBrowsingURLRequestContextGetter( net::URLRequestContext* SafeBrowsingURLRequestContextGetter::GetURLRequestContext() { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); // Check if the service has been shut down. if (shut_down_) @@ -140,7 +140,7 @@ SafeBrowsingURLRequestContextGetter::GetNetworkTaskRunner() const { } void SafeBrowsingURLRequestContextGetter::ServiceShuttingDown() { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); shut_down_ = true; URLRequestContextGetter::NotifyContextShuttingDown(); @@ -243,13 +243,13 @@ void SafeBrowsingService::ShutDown() { // Binhash verification is only enabled for UMA users for now. bool SafeBrowsingService::DownloadBinHashNeeded() const { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); return false; } net::URLRequestContextGetter* SafeBrowsingService::url_request_context() { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); return url_request_context_getter_.get(); } @@ -259,7 +259,7 @@ const scoped_refptr<SafeBrowsingUIManager>& SafeBrowsingService::ui_manager() } SafeBrowsingPingManager* SafeBrowsingService::ping_manager() const { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); return ping_manager_; } @@ -311,7 +311,7 @@ SafeBrowsingProtocolConfig SafeBrowsingService::GetProtocolConfig() const { void SafeBrowsingService::StartOnIOThread( net::URLRequestContextGetter* url_request_context_getter) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); if (enabled_) return; enabled_ = true; @@ -324,7 +324,7 @@ void SafeBrowsingService::StartOnIOThread( } void SafeBrowsingService::StopOnIOThread(bool shutdown) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); ui_manager_->StopOnIOThread(shutdown); @@ -337,7 +337,7 @@ void SafeBrowsingService::StopOnIOThread(bool shutdown) { } void SafeBrowsingService::Start() { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); web::WebThread::PostTask(web::WebThread::IO, FROM_HERE, base::Bind(&SafeBrowsingService::StartOnIOThread, @@ -386,12 +386,12 @@ void SafeBrowsingService::RemovePrefService(PrefService* pref_service) { scoped_ptr<SafeBrowsingService::StateSubscription> SafeBrowsingService::RegisterStateCallback( const base::Callback<void(void)>& callback) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); return state_callback_list_.Add(callback); } void SafeBrowsingService::RefreshState() { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); // Check if any browser state requires the service to be active. bool enable = false; std::map<PrefService*, PrefChangeRegistrar*>::iterator iter; @@ -414,7 +414,7 @@ void SafeBrowsingService::RefreshState() { void SafeBrowsingService::SendDownloadRecoveryReport( const std::string& report) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); web::WebThread::PostTask( web::WebThread::IO, FROM_HERE, base::Bind(&SafeBrowsingService::OnSendDownloadRecoveryReport, this, @@ -423,7 +423,7 @@ void SafeBrowsingService::SendDownloadRecoveryReport( void SafeBrowsingService::OnSendDownloadRecoveryReport( const std::string& report) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); if (ping_manager()) ping_manager()->ReportThreatDetails(report); } diff --git a/ios/chrome/browser/safe_browsing/safe_browsing_service.h b/ios/chrome/browser/safe_browsing/safe_browsing_service.h index 3812762..4b3507a3 100644 --- a/ios/chrome/browser/safe_browsing/safe_browsing_service.h +++ b/ios/chrome/browser/safe_browsing/safe_browsing_service.h @@ -80,13 +80,13 @@ class SafeBrowsingService // Get current enabled status. Must be called on IO thread. bool enabled() const { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); return enabled_; } // Whether the service is enabled by the current set of profiles. bool enabled_by_prefs() const { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); return enabled_by_prefs_; } diff --git a/ios/chrome/browser/safe_browsing/ui_manager.mm b/ios/chrome/browser/safe_browsing/ui_manager.mm index daef6496..169c0da 100644 --- a/ios/chrome/browser/safe_browsing/ui_manager.mm +++ b/ios/chrome/browser/safe_browsing/ui_manager.mm @@ -99,7 +99,7 @@ SafeBrowsingUIManager::SafeBrowsingUIManager( SafeBrowsingUIManager::~SafeBrowsingUIManager() {} void SafeBrowsingUIManager::StopOnIOThread(bool shutdown) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); if (shutdown) sb_service_ = nullptr; @@ -112,7 +112,7 @@ void SafeBrowsingUIManager::LogPauseDelay(base::TimeDelta time) { void SafeBrowsingUIManager::OnBlockingPageDone( const std::vector<UnsafeResource>& resources, bool proceed) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); for (const auto& resource : resources) { if (!resource.callback.is_null()) { DCHECK(resource.callback_thread); @@ -127,7 +127,7 @@ void SafeBrowsingUIManager::OnBlockingPageDone( void SafeBrowsingUIManager::DisplayBlockingPage( const UnsafeResource& resource) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); if (resource.is_subresource && !resource.is_subframe) { // Sites tagged as serving Unwanted Software should only show a warning for // main-frame or sub-frame resource. Similar warning restrictions should be @@ -220,7 +220,7 @@ void SafeBrowsingUIManager::DisplayBlockingPage( // UMA || extended_reporting users. void SafeBrowsingUIManager::MaybeReportSafeBrowsingHit( const HitReport& hit_report) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); // Decide if we should send this report. if (hit_report.is_metrics_reporting_active || @@ -234,7 +234,7 @@ void SafeBrowsingUIManager::MaybeReportSafeBrowsingHit( void SafeBrowsingUIManager::ReportSafeBrowsingHitOnIOThread( const HitReport& hit_report) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); // The service may delete the ping manager (i.e. when user disabling service, // etc). This happens on the IO thread. @@ -250,7 +250,7 @@ void SafeBrowsingUIManager::ReportSafeBrowsingHitOnIOThread( void SafeBrowsingUIManager::ReportInvalidCertificateChain( const std::string& serialized_report, const base::Closure& callback) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); web::WebThread::PostTaskAndReply( web::WebThread::IO, FROM_HERE, base::Bind( @@ -260,18 +260,18 @@ void SafeBrowsingUIManager::ReportInvalidCertificateChain( } void SafeBrowsingUIManager::AddObserver(Observer* observer) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); observer_list_.AddObserver(observer); } void SafeBrowsingUIManager::RemoveObserver(Observer* observer) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); observer_list_.RemoveObserver(observer); } void SafeBrowsingUIManager::ReportInvalidCertificateChainOnIOThread( const std::string& serialized_report) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); // The service may delete the ping manager (i.e. when user disabling service, // etc). This happens on the IO thread. @@ -285,7 +285,7 @@ void SafeBrowsingUIManager::ReportInvalidCertificateChainOnIOThread( // when the report is ready. void SafeBrowsingUIManager::SendSerializedThreatDetails( const std::string& serialized) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); // The service may delete the ping manager (i.e. when user disabling service, // etc). This happens on the IO thread. @@ -301,7 +301,7 @@ void SafeBrowsingUIManager::SendSerializedThreatDetails( // Whitelist this domain in the current WebState. Either add the // domain to an existing WhitelistUrlSet, or create a new WhitelistUrlSet. void SafeBrowsingUIManager::AddToWhitelist(const UnsafeResource& resource) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); DCHECK(resource.weak_web_state.get()); web::WebState* web_state = resource.weak_web_state.get(); @@ -320,7 +320,7 @@ void SafeBrowsingUIManager::AddToWhitelist(const UnsafeResource& resource) { // Check if the user has already ignored a SB warning for this WebState and // top-level domain. bool SafeBrowsingUIManager::IsWhitelisted(const UnsafeResource& resource) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); DCHECK(resource.weak_web_state.get()); web::WebState* web_state = resource.weak_web_state.get(); diff --git a/ios/chrome/browser/sessions/ios_chrome_tab_restore_service_client.mm b/ios/chrome/browser/sessions/ios_chrome_tab_restore_service_client.mm index 9873924..2a23b4a 100644 --- a/ios/chrome/browser/sessions/ios_chrome_tab_restore_service_client.mm +++ b/ios/chrome/browser/sessions/ios_chrome_tab_restore_service_client.mm @@ -55,7 +55,7 @@ std::string IOSChromeTabRestoreServiceClient::GetExtensionAppIDForTab( } base::SequencedWorkerPool* IOSChromeTabRestoreServiceClient::GetBlockingPool() { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); return web::WebThread::GetBlockingPool(); } diff --git a/ios/chrome/browser/snapshots/snapshot_cache.mm b/ios/chrome/browser/snapshots/snapshot_cache.mm index b6ad231..d6537cc 100644 --- a/ios/chrome/browser/snapshots/snapshot_cache.mm +++ b/ios/chrome/browser/snapshots/snapshot_cache.mm @@ -141,7 +141,7 @@ void ConvertAndSaveGreyImage( - (id)init { if ((self = [super init])) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); propertyReleaser_SnapshotCache_.Init(self, [SnapshotCache class]); // Always use the LRUCache when the tab switcher is enabled. @@ -207,7 +207,7 @@ void ConvertAndSaveGreyImage( - (void)retrieveImageForSessionID:(NSString*)sessionID callback:(void (^)(UIImage*))callback { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); DCHECK(sessionID); // Cache on iPad is enabled only when the tab switcher is enabled. @@ -250,7 +250,7 @@ void ConvertAndSaveGreyImage( } - (void)setImage:(UIImage*)img withSessionID:(NSString*)sessionID { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); if (!img || !sessionID) return; @@ -272,7 +272,7 @@ void ConvertAndSaveGreyImage( } - (void)removeImageWithSessionID:(NSString*)sessionID { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); if (lruCache_) [lruCache_ removeObjectForKey:sessionID]; else @@ -290,7 +290,7 @@ void ConvertAndSaveGreyImage( } - (base::FilePath)oldCacheDirectory { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); NSArray* paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES); NSString* path = [paths objectAtIndex:0]; @@ -341,7 +341,7 @@ void ConvertAndSaveGreyImage( - (void)purgeCacheOlderThan:(const base::Time&)date keeping:(NSSet*)liveSessionIds { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); // Copying the date, as the block must copy the value, not the reference. const base::Time dateCopy = date; web::WebThread::PostBlockingPoolSequencedTask( @@ -374,7 +374,7 @@ void ConvertAndSaveGreyImage( } - (void)willBeSavedGreyWhenBackgrounding:(NSString*)sessionID { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); if (!sessionID) return; backgroundingImageSessionId_.reset([sessionID copy]); @@ -388,7 +388,7 @@ void ConvertAndSaveGreyImage( - (void)handleLowMemory { DCHECK(!IsIPadIdiom() || experimental_flags::IsTabSwitcherEnabled()); - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); base::scoped_nsobject<NSMutableDictionary> dictionary( [[NSMutableDictionary alloc] initWithCapacity:2]); for (NSString* sessionID in pinnedIDs_) { @@ -412,20 +412,20 @@ void ConvertAndSaveGreyImage( - (void)handleEnterBackground { DCHECK(!IsIPadIdiom() || experimental_flags::IsTabSwitcherEnabled()); - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); [imageDictionary_ removeAllObjects]; [lruCache_ removeAllObjects]; } - (void)handleBecomeActive { DCHECK(!IsIPadIdiom() || experimental_flags::IsTabSwitcherEnabled()); - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); for (NSString* sessionID in pinnedIDs_) [self retrieveImageForSessionID:sessionID callback:nil]; } - (void)saveGreyImage:(UIImage*)greyImage forKey:(NSString*)sessionID { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); if (greyImage) [greyImageDictionary_ setObject:greyImage forKey:sessionID]; if ([sessionID isEqualToString:mostRecentGreySessionId_]) { @@ -435,7 +435,7 @@ void ConvertAndSaveGreyImage( } - (void)loadGreyImageAsync:(NSString*)sessionID { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); // Don't call -retrieveImageForSessionID here because it caches the colored // image, which we don't need for the grey image cache. But if the image is // already in the cache, use it. @@ -464,7 +464,7 @@ void ConvertAndSaveGreyImage( } - (void)createGreyCache:(NSArray*)sessionIDs { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); greyImageDictionary_.reset( [[NSMutableDictionary alloc] initWithCapacity:kGreyInitialCapacity]); for (NSString* sessionID in sessionIDs) @@ -472,20 +472,20 @@ void ConvertAndSaveGreyImage( } - (void)removeGreyCache { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); greyImageDictionary_.reset(); [self clearGreySessionInfo]; } - (void)clearGreySessionInfo { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); mostRecentGreySessionId_.reset(); mostRecentGreyBlock_.reset(); } - (void)greyImageForSessionID:(NSString*)sessionID callback:(void (^)(UIImage*))callback { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); DCHECK(greyImageDictionary_); UIImage* image = [greyImageDictionary_ objectForKey:sessionID]; if (image) { @@ -499,7 +499,7 @@ void ConvertAndSaveGreyImage( - (void)retrieveGreyImageForSessionID:(NSString*)sessionID callback:(void (^)(UIImage*))callback { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); if (greyImageDictionary_) { UIImage* image = [greyImageDictionary_ objectForKey:sessionID]; if (image) { @@ -542,7 +542,7 @@ void ConvertAndSaveGreyImage( } - (void)saveGreyInBackgroundForSessionID:(NSString*)sessionID { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); if (!sessionID) return; diff --git a/ios/chrome/browser/sync/ios_chrome_sync_client.mm b/ios/chrome/browser/sync/ios_chrome_sync_client.mm index 262a7d6..dc5b80e 100644 --- a/ios/chrome/browser/sync/ios_chrome_sync_client.mm +++ b/ios/chrome/browser/sync/ios_chrome_sync_client.mm @@ -77,18 +77,18 @@ class SyncSessionsClientImpl : public sync_sessions::SyncSessionsClient { // SyncSessionsClient implementation. bookmarks::BookmarkModel* GetBookmarkModel() override { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); return ios::BookmarkModelFactory::GetForBrowserState(browser_state_); } favicon::FaviconService* GetFaviconService() override { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); return ios::FaviconServiceFactory::GetForBrowserState( browser_state_, ServiceAccessType::EXPLICIT_ACCESS); } history::HistoryService* GetHistoryService() override { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); return ios::HistoryServiceFactory::GetForBrowserState( browser_state_, ServiceAccessType::EXPLICIT_ACCESS); } @@ -136,7 +136,7 @@ IOSChromeSyncClient::IOSChromeSyncClient(ios::ChromeBrowserState* browser_state) IOSChromeSyncClient::~IOSChromeSyncClient() {} void IOSChromeSyncClient::Initialize() { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); web_data_service_ = ios::WebDataServiceFactory::GetAutofillWebDataForBrowserState( @@ -168,34 +168,34 @@ void IOSChromeSyncClient::Initialize() { } sync_driver::SyncService* IOSChromeSyncClient::GetSyncService() { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); return IOSChromeProfileSyncServiceFactory::GetForBrowserState(browser_state_); } PrefService* IOSChromeSyncClient::GetPrefService() { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); return browser_state_->GetPrefs(); } bookmarks::BookmarkModel* IOSChromeSyncClient::GetBookmarkModel() { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); return ios::BookmarkModelFactory::GetForBrowserState(browser_state_); } favicon::FaviconService* IOSChromeSyncClient::GetFaviconService() { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); return ios::FaviconServiceFactory::GetForBrowserState( browser_state_, ServiceAccessType::EXPLICIT_ACCESS); } history::HistoryService* IOSChromeSyncClient::GetHistoryService() { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); return ios::HistoryServiceFactory::GetForBrowserState( browser_state_, ServiceAccessType::EXPLICIT_ACCESS); } autofill::PersonalDataManager* IOSChromeSyncClient::GetPersonalDataManager() { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); return PersonalDataManagerFactory::GetForBrowserState(browser_state_); } @@ -346,7 +346,7 @@ scoped_refptr<syncer::ModelSafeWorker> IOSChromeSyncClient::CreateModelWorkerForGroup( syncer::ModelSafeGroup group, syncer::WorkerLoopDestructionObserver* observer) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); switch (group) { case syncer::GROUP_DB: return new browser_sync::BrowserThreadModelWorker( diff --git a/ios/chrome/browser/ui/uikit_ui_util.mm b/ios/chrome/browser/ui/uikit_ui_util.mm index 5e2ee48..72a45f7 100644 --- a/ios/chrome/browser/ui/uikit_ui_util.mm +++ b/ios/chrome/browser/ui/uikit_ui_util.mm @@ -589,7 +589,7 @@ bool IsCompactTablet() { // Returns the current first responder. UIResponder* GetFirstResponder() { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); DCHECK(!gFirstResponder); [[UIApplication sharedApplication] sendAction:@selector(cr_markSelfCurrentFirstResponder) diff --git a/ios/chrome/browser/ui/webui/net_export/net_export_ui.cc b/ios/chrome/browser/ui/webui/net_export/net_export_ui.cc index 84deb06..4c68b8b 100644 --- a/ios/chrome/browser/ui/webui/net_export/net_export_ui.cc +++ b/ios/chrome/browser/ui/webui/net_export/net_export_ui.cc @@ -105,7 +105,7 @@ NetExportMessageHandler::~NetExportMessageHandler() { } void NetExportMessageHandler::RegisterMessages() { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); web_ui()->RegisterMessageCallback( net_log::kGetExportNetLogInfoHandler, @@ -178,7 +178,7 @@ void NetExportMessageHandler::ProcessNetLogCommand( return; } - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::FILE_USER_BLOCKING); + DCHECK_CURRENTLY_ON(web::WebThread::FILE_USER_BLOCKING); net_log_temp_file->ProcessCommand(command); SendExportNetLogInfo(net_export_message_handler, net_log_temp_file); } @@ -186,7 +186,7 @@ void NetExportMessageHandler::ProcessNetLogCommand( // static base::FilePath NetExportMessageHandler::GetNetLogFileName( net_log::NetLogTempFile* net_log_temp_file) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::FILE_USER_BLOCKING); + DCHECK_CURRENTLY_ON(web::WebThread::FILE_USER_BLOCKING); base::FilePath net_export_file_path; net_log_temp_file->GetFilePath(&net_export_file_path); return net_export_file_path; @@ -196,7 +196,7 @@ base::FilePath NetExportMessageHandler::GetNetLogFileName( void NetExportMessageHandler::SendExportNetLogInfo( base::WeakPtr<NetExportMessageHandler> net_export_message_handler, net_log::NetLogTempFile* net_log_temp_file) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::FILE_USER_BLOCKING); + DCHECK_CURRENTLY_ON(web::WebThread::FILE_USER_BLOCKING); base::Value* value = net_log_temp_file->GetState(); if (!web::WebThread::PostTask( web::WebThread::UI, FROM_HERE, @@ -211,7 +211,7 @@ void NetExportMessageHandler::SendExportNetLogInfo( void NetExportMessageHandler::SendEmail(const base::FilePath& file_to_send) { if (file_to_send.empty()) return; - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); std::string email; std::string subject = "net_internals_log"; @@ -227,7 +227,7 @@ void NetExportMessageHandler::SendEmail(const base::FilePath& file_to_send) { void NetExportMessageHandler::OnExportNetLogInfoChanged(base::Value* arg) { scoped_ptr<base::Value> value(arg); - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); web_ui()->CallJavascriptFunction(net_log::kOnExportNetLogInfoChanged, *arg); } diff --git a/ios/chrome/browser/ui/webui/sync_internals/sync_internals_message_handler.cc b/ios/chrome/browser/ui/webui/sync_internals/sync_internals_message_handler.cc index 2b7928a..d48d2ee 100644 --- a/ios/chrome/browser/ui/webui/sync_internals/sync_internals_message_handler.cc +++ b/ios/chrome/browser/ui/webui/sync_internals/sync_internals_message_handler.cc @@ -49,7 +49,7 @@ SyncInternalsMessageHandler::~SyncInternalsMessageHandler() { } void SyncInternalsMessageHandler::RegisterMessages() { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); web_ui()->RegisterMessageCallback( sync_driver::sync_ui_util::kRegisterForEvents, diff --git a/ios/chrome/browser/web/dom_altering_lock.mm b/ios/chrome/browser/web/dom_altering_lock.mm index 2d5aa49..3733d6a 100644 --- a/ios/chrome/browser/web/dom_altering_lock.mm +++ b/ios/chrome/browser/web/dom_altering_lock.mm @@ -17,7 +17,7 @@ DOMAlteringLock::~DOMAlteringLock() { void DOMAlteringLock::Acquire(id<DOMAltering> feature, ProceduralBlockWithBool lockAction) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); if (current_dom_altering_feature_.get() == feature) { lockAction(YES); return; @@ -28,7 +28,7 @@ void DOMAlteringLock::Acquire(id<DOMAltering> feature, return; } [current_dom_altering_feature_ releaseDOMLockWithCompletionHandler:^() { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); DCHECK(current_dom_altering_feature_.get() == nil) << "The lock must be released before calling the completion handler."; current_dom_altering_feature_.reset(feature); @@ -42,7 +42,7 @@ void DOMAlteringLock::Acquire(id<DOMAltering> feature, // Release the lock on the DOM tree. void DOMAlteringLock::Release(id<DOMAltering> feature) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); if (current_dom_altering_feature_.get() == feature) current_dom_altering_feature_.reset(); } diff --git a/ios/web/active_state_manager_impl.mm b/ios/web/active_state_manager_impl.mm index 25824474..ca0fadc 100644 --- a/ios/web/active_state_manager_impl.mm +++ b/ios/web/active_state_manager_impl.mm @@ -18,7 +18,7 @@ int g_active_state_manager_active_count = 0; ActiveStateManagerImpl::ActiveStateManagerImpl(BrowserState* browser_state) : browser_state_(browser_state), active_(false) { - DCHECK_CURRENTLY_ON_WEB_THREAD(WebThread::UI); + DCHECK_CURRENTLY_ON(WebThread::UI); DCHECK(browser_state_); } @@ -28,7 +28,7 @@ ActiveStateManagerImpl::~ActiveStateManagerImpl() { } void ActiveStateManagerImpl::SetActive(bool active) { - DCHECK_CURRENTLY_ON_WEB_THREAD(WebThread::UI); + DCHECK_CURRENTLY_ON(WebThread::UI); if (active == active_) { return; @@ -49,17 +49,17 @@ void ActiveStateManagerImpl::SetActive(bool active) { } bool ActiveStateManagerImpl::IsActive() { - DCHECK_CURRENTLY_ON_WEB_THREAD(WebThread::UI); + DCHECK_CURRENTLY_ON(WebThread::UI); return active_; } void ActiveStateManagerImpl::AddObserver(ActiveStateManager::Observer* obs) { - DCHECK_CURRENTLY_ON_WEB_THREAD(WebThread::UI); + DCHECK_CURRENTLY_ON(WebThread::UI); observer_list_.AddObserver(obs); } void ActiveStateManagerImpl::RemoveObserver(ActiveStateManager::Observer* obs) { - DCHECK_CURRENTLY_ON_WEB_THREAD(WebThread::UI); + DCHECK_CURRENTLY_ON(WebThread::UI); observer_list_.RemoveObserver(obs); } diff --git a/ios/web/browser_state.mm b/ios/web/browser_state.mm index 6d1eeeb..c341ff9 100644 --- a/ios/web/browser_state.mm +++ b/ios/web/browser_state.mm @@ -36,7 +36,7 @@ struct CertificatePolicyCacheHandle : public base::SupportsUserData::Data { // static scoped_refptr<CertificatePolicyCache> BrowserState::GetCertificatePolicyCache( BrowserState* browser_state) { - DCHECK_CURRENTLY_ON_WEB_THREAD(WebThread::UI); + DCHECK_CURRENTLY_ON(WebThread::UI); if (!browser_state->GetUserData(kCertificatePolicyCacheKeyName)) { CertificatePolicyCacheHandle* cert_cache_service_handle = new CertificatePolicyCacheHandle(new CertificatePolicyCache()); @@ -53,14 +53,14 @@ scoped_refptr<CertificatePolicyCache> BrowserState::GetCertificatePolicyCache( // static bool BrowserState::HasActiveStateManager(BrowserState* browser_state) { - DCHECK_CURRENTLY_ON_WEB_THREAD(WebThread::UI); + DCHECK_CURRENTLY_ON(WebThread::UI); return browser_state->GetUserData(kActiveStateManagerKeyName) != nullptr; } // static ActiveStateManager* BrowserState::GetActiveStateManager( BrowserState* browser_state) { - DCHECK_CURRENTLY_ON_WEB_THREAD(WebThread::UI); + DCHECK_CURRENTLY_ON(WebThread::UI); DCHECK(browser_state); ActiveStateManagerImpl* active_state_manager = @@ -77,7 +77,7 @@ ActiveStateManager* BrowserState::GetActiveStateManager( // static BrowsingDataPartition* BrowserState::GetBrowsingDataPartition( BrowserState* browser_state) { - DCHECK_CURRENTLY_ON_WEB_THREAD(WebThread::UI); + DCHECK_CURRENTLY_ON(WebThread::UI); DCHECK(browser_state); BrowsingDataPartitionImpl* browsing_data_partition = @@ -115,7 +115,7 @@ BrowserState::~BrowserState() { URLDataManagerIOSBackend* BrowserState::GetURLDataManagerIOSBackendOnIOThread() { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); if (!url_data_manager_ios_backend_) url_data_manager_ios_backend_ = new URLDataManagerIOSBackend(); return url_data_manager_ios_backend_; diff --git a/ios/web/browsing_data_partition_impl.mm b/ios/web/browsing_data_partition_impl.mm index c294f3f..bff4ee3 100644 --- a/ios/web/browsing_data_partition_impl.mm +++ b/ios/web/browsing_data_partition_impl.mm @@ -106,7 +106,7 @@ CRWBrowsingDataStoreModeObserver* g_browsing_data_store_mode_observer = nil; BrowsingDataPartitionImpl::BrowsingDataPartitionImpl( BrowserState* browser_state) : browser_state_(browser_state) { - DCHECK_CURRENTLY_ON_WEB_THREAD(WebThread::UI); + DCHECK_CURRENTLY_ON(WebThread::UI); DCHECK(browser_state); active_state_manager_ = BrowserState::GetActiveStateManager(browser_state); @@ -129,7 +129,7 @@ bool BrowsingDataPartition::IsSynchronized() { } CRWBrowsingDataStore* BrowsingDataPartitionImpl::GetBrowsingDataStore() { - DCHECK_CURRENTLY_ON_WEB_THREAD(WebThread::UI); + DCHECK_CURRENTLY_ON(WebThread::UI); if (!browsing_data_store_) { browsing_data_store_.reset( @@ -146,19 +146,19 @@ CRWBrowsingDataStore* BrowsingDataPartitionImpl::GetBrowsingDataStore() { } void BrowsingDataPartitionImpl::OnActive() { - DCHECK_CURRENTLY_ON_WEB_THREAD(WebThread::UI); + DCHECK_CURRENTLY_ON(WebThread::UI); [GetBrowsingDataStore() makeActiveWithCompletionHandler:nil]; } void BrowsingDataPartitionImpl::OnInactive() { - DCHECK_CURRENTLY_ON_WEB_THREAD(WebThread::UI); + DCHECK_CURRENTLY_ON(WebThread::UI); [GetBrowsingDataStore() makeInactiveWithCompletionHandler:nil]; } void BrowsingDataPartitionImpl::WillBeDestroyed() { - DCHECK_CURRENTLY_ON_WEB_THREAD(WebThread::UI); + DCHECK_CURRENTLY_ON(WebThread::UI); active_state_manager_->RemoveObserver(this); active_state_manager_ = nullptr; diff --git a/ios/web/net/certificate_policy_cache.cc b/ios/web/net/certificate_policy_cache.cc index 5a0ef07..931c0ce 100644 --- a/ios/web/net/certificate_policy_cache.cc +++ b/ios/web/net/certificate_policy_cache.cc @@ -18,7 +18,7 @@ CertificatePolicyCache::~CertificatePolicyCache() { void CertificatePolicyCache::AllowCertForHost(net::X509Certificate* cert, const std::string& host, net::CertStatus error) { - DCHECK_CURRENTLY_ON_WEB_THREAD(WebThread::IO); + DCHECK_CURRENTLY_ON(WebThread::IO); cert_policy_for_host_[host].Allow(cert, error); } @@ -26,12 +26,12 @@ CertPolicy::Judgment CertificatePolicyCache::QueryPolicy( net::X509Certificate* cert, const std::string& host, net::CertStatus error) { - DCHECK_CURRENTLY_ON_WEB_THREAD(WebThread::IO); + DCHECK_CURRENTLY_ON(WebThread::IO); return cert_policy_for_host_[host].Check(cert, error); } void CertificatePolicyCache::ClearCertificatePolicies() { - DCHECK_CURRENTLY_ON_WEB_THREAD(WebThread::IO); + DCHECK_CURRENTLY_ON(WebThread::IO); cert_policy_for_host_.clear(); } diff --git a/ios/web/net/clients/crw_passkit_network_client_factory.mm b/ios/web/net/clients/crw_passkit_network_client_factory.mm index 76bd457..74a46d5 100644 --- a/ios/web/net/clients/crw_passkit_network_client_factory.mm +++ b/ios/web/net/clients/crw_passkit_network_client_factory.mm @@ -23,7 +23,7 @@ - (CRNForwardingNetworkClient*) clientHandlingResponse:(NSURLResponse*)response request:(const net::URLRequest&)request { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); // Some requests (e.g., for chrome:// urls) will not have response headers. net::HttpResponseHeaders* responseHeaders = request.response_headers(); diff --git a/ios/web/net/clients/crw_redirect_network_client.mm b/ios/web/net/clients/crw_redirect_network_client.mm index ae19229..df4bba0 100644 --- a/ios/web/net/clients/crw_redirect_network_client.mm +++ b/ios/web/net/clients/crw_redirect_network_client.mm @@ -24,7 +24,7 @@ // CRWRedirectNetworkClients are created on the IO thread, but due to the // threading restrictions of WeakNSObjects, |delegate_| may only be // dereferenced on the UI thread. - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); delegate_ = delegate; } return self; @@ -38,7 +38,7 @@ - (void)wasRedirectedToRequest:(NSURLRequest*)request nativeRequest:(net::URLRequest*)nativeRequest redirectResponse:(NSURLResponse*)redirectResponse { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); web::WebThread::PostTask(web::WebThread::UI, FROM_HERE, base::BindBlock(^{ // |delegate_| can only be dereferenced from the UI thread. [delegate_ wasRedirectedToRequest:request diff --git a/ios/web/net/clients/crw_redirect_network_client_factory.mm b/ios/web/net/clients/crw_redirect_network_client_factory.mm index 3ad439b..083e819 100644 --- a/ios/web/net/clients/crw_redirect_network_client_factory.mm +++ b/ios/web/net/clients/crw_redirect_network_client_factory.mm @@ -24,7 +24,7 @@ - (instancetype)initWithDelegate:(id<CRWRedirectClientDelegate>)delegate { self = [super init]; if (self) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); DCHECK(delegate); client_delegate_.reset(delegate); } @@ -46,7 +46,7 @@ (const net::URLRequest&)request url:(const GURL&)url response:(NSURLResponse*)response { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); return [[[CRWRedirectNetworkClient alloc] initWithDelegate:client_delegate_] autorelease]; } diff --git a/ios/web/net/crw_cert_verification_controller.mm b/ios/web/net/crw_cert_verification_controller.mm index b5fe4010..d88925b 100644 --- a/ios/web/net/crw_cert_verification_controller.mm +++ b/ios/web/net/crw_cert_verification_controller.mm @@ -87,7 +87,7 @@ class BlockHolder : public base::RefCountedThreadSafe<BlockHolder<T>> { static void Finalize(id block, ProceduralBlock default_block, bool block_was_called) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); // By calling default_block, BlockHolder guarantees that block is always // called to satisfy API contract for CRWCertVerificationController // (completion handlers are always called). @@ -205,7 +205,7 @@ decideLoadPolicyForAcceptedTrustResult:(SecTrustResultType)trustResult - (instancetype)initWithBrowserState:(web::BrowserState*)browserState { DCHECK(browserState); - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); self = [super init]; if (self) { _contextGetter = browserState->GetRequestContext(); @@ -221,7 +221,7 @@ decideLoadPolicyForAcceptedTrustResult:(SecTrustResultType)trustResult - (void)decideLoadPolicyForTrust:(base::ScopedCFTypeRef<SecTrustRef>)trust host:(NSString*)host completionHandler:(web::PolicyDecisionHandler)completionHandler { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); // completionHandler of |verifyCert:forHost:completionHandler:| is called on // IO thread and then bounces back to UI thread. As a result all objects // captured by completionHandler may be released on either UI or IO thread. @@ -252,7 +252,7 @@ decideLoadPolicyForAcceptedTrustResult:(SecTrustResultType)trustResult - (void)querySSLStatusForTrust:(base::ScopedCFTypeRef<SecTrustRef>)trust host:(NSString*)host completionHandler:(web::StatusQueryHandler)completionHandler { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); // The completion handlers of |verifyCert:forHost:completionHandler:| and // |verifyTrust:completionHandler:| will be deallocated on background thread. @@ -292,7 +292,7 @@ decideLoadPolicyForAcceptedTrustResult:(SecTrustResultType)trustResult - (void)allowCert:(scoped_refptr<net::X509Certificate>)cert forHost:(NSString*)host status:(net::CertStatus)status { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); // Store user decisions with the leaf cert, ignoring any intermediates. // This is because WKWebView returns the verified certificate chain in // |webView:didReceiveAuthenticationChallenge:completionHandler:|, @@ -310,7 +310,7 @@ decideLoadPolicyForAcceptedTrustResult:(SecTrustResultType)trustResult } - (void)shutDown { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); web::WebThread::PostTask(web::WebThread::IO, FROM_HERE, base::BindBlock(^{ // This block captures |self| delaying its deallocation and causing dealloc // to happen on either IO or UI thread (which is fine for this class). @@ -464,7 +464,7 @@ decideLoadPolicyForAcceptedTrustResult:(SecTrustResultType)trustResult certVerifierResult:(net::CertVerifyResult)certVerifierResult serverTrust:(SecTrustRef)trust host:(NSString*)host { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); DCHECK_NE(web::SECURITY_STYLE_AUTHENTICATED, web::GetSecurityStyleFromTrustResult(trustResult)); diff --git a/ios/web/net/request_tracker_impl.mm b/ios/web/net/request_tracker_impl.mm index 88afc0f..4fc43227 100644 --- a/ios/web/net/request_tracker_impl.mm +++ b/ios/web/net/request_tracker_impl.mm @@ -73,7 +73,7 @@ pthread_once_t g_once_control = PTHREAD_ONCE_INIT; static bool g_waiting_on_io_thread = false; base::Lock* g_waiting_on_io_thread_lock = NULL; void StopIOThreadWaiting() { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); base::AutoLock scoped_lock(*g_waiting_on_io_thread_lock); g_waiting_on_io_thread = false; } @@ -103,7 +103,7 @@ static bool IsIntranetHost(const std::string& host) { // Add |tracker| to |g_trackers| under |key|. static void RegisterTracker(web::RequestTrackerImpl* tracker, NSString* key) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); pthread_once(&g_once_control, &InitializeGlobals); { base::scoped_nsobject<NSString> scoped_key([key copy]); @@ -132,7 +132,7 @@ struct TrackerCounts { expected_length(0), processed(0), done(false) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); is_subrequest = tracked_request->first_party_for_cookies().is_valid() && tracked_request->url() != tracked_request->first_party_for_cookies(); }; @@ -261,7 +261,7 @@ struct TrackerCounts { } - (void)buildSSLStatus { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); if (!sslInfo_.is_valid()) return; @@ -348,7 +348,7 @@ RequestTrackerImpl::CreateTrackerForRequestGroupID( BrowserState* browser_state, net::URLRequestContextGetter* context_getter, id<CRWRequestTrackerDelegate> delegate) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); DCHECK(request_group_id); scoped_refptr<RequestTrackerImpl> tracker = @@ -367,7 +367,7 @@ RequestTrackerImpl::CreateTrackerForRequestGroupID( } void RequestTrackerImpl::StartPageLoad(const GURL& url, id user_info) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); base::scoped_nsobject<id> scoped_user_info([user_info retain]); web::WebThread::PostTask( web::WebThread::IO, FROM_HERE, @@ -375,14 +375,14 @@ void RequestTrackerImpl::StartPageLoad(const GURL& url, id user_info) { } void RequestTrackerImpl::FinishPageLoad(const GURL& url, bool load_success) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); web::WebThread::PostTask( web::WebThread::IO, FROM_HERE, base::Bind(&RequestTrackerImpl::StopPageLoad, this, url, load_success)); } void RequestTrackerImpl::HistoryStateChange(const GURL& url) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); web::WebThread::PostTask( web::WebThread::IO, FROM_HERE, base::Bind(&RequestTrackerImpl::HistoryStateChangeToURL, this, url)); @@ -393,7 +393,7 @@ void RequestTrackerImpl::HistoryStateChange(const GURL& url) { // the UI thread that will make use of the fields being cleaned-up here; they // must ensure they they operate without crashing with the cleaned-up values. void RequestTrackerImpl::Close() { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); // Mark the tracker as closing on the IO thread. Note that because the local // scoped_refptr here retains |this|, we a are guaranteed that destruiction // won't begin until the block completes, and thus |is_closing_| will always @@ -415,7 +415,7 @@ void RequestTrackerImpl::Close() { // static void RequestTrackerImpl::RunAfterRequestsCancel(const base::Closure& callback) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); // Post a no-op to the IO thread, and after that has executed, run |callback|. // This ensures that |callback| runs after anything elese queued on the IO // thread, in particular CancelRequest() calls made from closing trackers. @@ -425,7 +425,7 @@ void RequestTrackerImpl::RunAfterRequestsCancel(const base::Closure& callback) { // static void RequestTrackerImpl::BlockUntilTrackersShutdown() { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); { base::AutoLock scoped_lock(*g_waiting_on_io_thread_lock); g_waiting_on_io_thread = true; @@ -454,7 +454,7 @@ void RequestTrackerImpl::BlockUntilTrackersShutdown() { RequestTrackerImpl* RequestTrackerImpl::GetTrackerForRequestGroupID( NSString* request_group_id) { DCHECK(request_group_id); - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); RequestTrackerImpl* tracker = nullptr; TrackerMap::iterator map_it; pthread_once(&g_once_control, &InitializeGlobals); @@ -469,12 +469,12 @@ RequestTrackerImpl* RequestTrackerImpl::GetTrackerForRequestGroupID( } net::URLRequestContext* RequestTrackerImpl::GetRequestContext() { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); return request_context_getter_->GetURLRequestContext(); } void RequestTrackerImpl::StartRequest(net::URLRequest* request) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); DCHECK(!counts_by_request_.count(request)); DCHECK_EQ(is_for_static_file_requests_, request->url().SchemeIsFile()); @@ -507,7 +507,7 @@ void RequestTrackerImpl::StartRequest(net::URLRequest* request) { } void RequestTrackerImpl::CaptureHeaders(net::URLRequest* request) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); if (is_closing_) return; @@ -523,7 +523,7 @@ void RequestTrackerImpl::CaptureHeaders(net::URLRequest* request) { void RequestTrackerImpl::CaptureExpectedLength(const net::URLRequest* request, uint64_t length) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); if (counts_by_request_.count(request)) { TrackerCounts* counts = counts_by_request_[request]; DCHECK(!counts->done); @@ -539,7 +539,7 @@ void RequestTrackerImpl::CaptureExpectedLength(const net::URLRequest* request, void RequestTrackerImpl::CaptureReceivedBytes(const net::URLRequest* request, uint64_t byte_count) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); if (counts_by_request_.count(request)) { TrackerCounts* counts = counts_by_request_[request]; DCHECK(!counts->done); @@ -557,7 +557,7 @@ void RequestTrackerImpl::CaptureReceivedBytes(const net::URLRequest* request, } void RequestTrackerImpl::StopRequest(net::URLRequest* request) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); int removedRequests = live_requests_.erase(request); if (!is_for_static_file_requests_ && removedRequests > 0) { @@ -577,7 +577,7 @@ void RequestTrackerImpl::StopRequest(net::URLRequest* request) { } void RequestTrackerImpl::StopRedirectedRequest(net::URLRequest* request) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); int removedRequests = live_requests_.erase(request); if (!is_for_static_file_requests_ && removedRequests > 0) { @@ -604,7 +604,7 @@ void RequestTrackerImpl::StopRedirectedRequest(net::URLRequest* request) { void RequestTrackerImpl::CaptureCertificatePolicyCache( const net::URLRequest* request, const RequestTracker::SSLCallback& should_continue) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); std::string host = request->url().host(); CertPolicy::Judgment judgment = policy_cache_->QueryPolicy( request->ssl_info().cert.get(), host, request->ssl_info().cert_status); @@ -636,7 +636,7 @@ void RequestTrackerImpl::OnSSLCertificateError( const net::SSLInfo& ssl_info, bool recoverable, const RequestTracker::SSLCallback& should_continue) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); DCHECK(ssl_info.is_valid()); if (counts_by_request_.count(request)) { @@ -653,7 +653,7 @@ void RequestTrackerImpl::OnSSLCertificateError( } void RequestTrackerImpl::ErrorCallback(CRWSSLCarrier* carrier, bool allow) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); DCHECK(policy_cache_); if (allow) { @@ -687,13 +687,13 @@ void RequestTrackerImpl::PostIOTask(const base::Closure& task) { } void RequestTrackerImpl::ScheduleIOTask(const base::Closure& task) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); web::WebThread::PostTask(web::WebThread::IO, FROM_HERE, task); } void RequestTrackerImpl::SetCacheModeFromUIThread( RequestTracker::CacheMode mode) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); web::WebThread::PostTask( web::WebThread::IO, FROM_HERE, base::Bind(&RequestTracker::SetCacheMode, this, mode)); @@ -718,12 +718,12 @@ RequestTrackerImpl::RequestTrackerImpl( identifier_(++g_next_request_tracker_id), request_group_id_([request_group_id copy]), is_closing_(false) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); } void RequestTrackerImpl::InitOnIOThread( const scoped_refptr<CertificatePolicyCache>& policy_cache) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); Init(); DCHECK(policy_cache); policy_cache_ = policy_cache; @@ -752,7 +752,7 @@ void RequestTrackerImplTraits::Destruct(const RequestTrackerImpl* t) { } void RequestTrackerImpl::Destruct() { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); DCHECK(is_closing_); pthread_once(&g_once_control, &InitializeGlobals); @@ -770,7 +770,7 @@ void RequestTrackerImpl::Destruct() { #pragma mark Other private methods void RequestTrackerImpl::Notify() { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); if (is_closing_) return; // Notify() is called asynchronously, it runs later on the same @@ -783,7 +783,7 @@ void RequestTrackerImpl::Notify() { } void RequestTrackerImpl::StackNotification() { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); if (is_closing_) return; @@ -807,7 +807,7 @@ void RequestTrackerImpl::StackNotification() { } void RequestTrackerImpl::SSLNotify() { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); if (is_closing_) return; @@ -839,7 +839,7 @@ void RequestTrackerImpl::SSLNotify() { void RequestTrackerImpl::NotifyResponseHeaders( net::HttpResponseHeaders* headers, const GURL& request_url) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); [delegate_ handleResponseHeaders:headers requestUrl:request_url]; } @@ -847,23 +847,23 @@ void RequestTrackerImpl::NotifyCertificateUsed( net::X509Certificate* certificate, const std::string& host, net::CertStatus status) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); [delegate_ certificateUsed:certificate forHost:host status:status]; } void RequestTrackerImpl::NotifyUpdatedProgress(float estimate) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); [delegate_ updatedProgress:estimate]; } void RequestTrackerImpl::NotifyClearCertificates() { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); [delegate_ clearCertificates]; } void RequestTrackerImpl::NotifyUpdatedSSLStatus( base::scoped_nsobject<CRWSSLCarrier> carrier) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); [delegate_ updatedSSLStatus:[carrier sslStatus] forPageUrl:[carrier url] userInfo:user_info_]; @@ -872,7 +872,7 @@ void RequestTrackerImpl::NotifyUpdatedSSLStatus( void RequestTrackerImpl::NotifyPresentSSLError( base::scoped_nsobject<CRWSSLCarrier> carrier, bool recoverable) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); [delegate_ presentSSLError:[carrier sslInfo] forSSLStatus:[carrier sslStatus] onUrl:[carrier url] @@ -883,7 +883,7 @@ void RequestTrackerImpl::NotifyPresentSSLError( } void RequestTrackerImpl::EvaluateSSLCallbackForCounts(TrackerCounts* counts) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); DCHECK(policy_cache_); // Ignore non-SSL requests. @@ -954,7 +954,7 @@ void RequestTrackerImpl::EvaluateSSLCallbackForCounts(TrackerCounts* counts) { } void RequestTrackerImpl::ReevaluateCallbacksForAllCounts() { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); if (is_closing_) return; @@ -989,7 +989,7 @@ void RequestTrackerImpl::ReevaluateCallbacksForAllCounts() { } void RequestTrackerImpl::CancelRequestForCounts(TrackerCounts* counts) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); // Cancel the request. counts->done = true; counts_by_request_.erase(counts->request); @@ -1033,7 +1033,7 @@ PageCounts RequestTrackerImpl::pageCounts() { } float RequestTrackerImpl::EstimatedProgress() { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); const PageCounts page_counts = pageCounts(); @@ -1107,7 +1107,7 @@ float RequestTrackerImpl::EstimatedProgress() { void RequestTrackerImpl::RecomputeMixedContent( const TrackerCounts* split_position) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); // Check if the mixed content before trimming was correct. if (page_url_.SchemeIsCryptographic() && has_mixed_content_) { bool old_url_has_mixed_content = false; @@ -1135,7 +1135,7 @@ void RequestTrackerImpl::RecomputeMixedContent( void RequestTrackerImpl::RecomputeCertificatePolicy( const TrackerCounts* splitPosition) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); // Clear the judgments for the old URL. web::WebThread::PostTask( web::WebThread::UI, FROM_HERE, @@ -1158,7 +1158,7 @@ void RequestTrackerImpl::RecomputeCertificatePolicy( } void RequestTrackerImpl::HistoryStateChangeToURL(const GURL& full_url) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); GURL url = GURLByRemovingRefFromGURL(full_url); if (is_loading_ && @@ -1168,7 +1168,7 @@ void RequestTrackerImpl::HistoryStateChangeToURL(const GURL& full_url) { } void RequestTrackerImpl::TrimToURL(const GURL& full_url, id user_info) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); GURL url = GURLByRemovingRefFromGURL(full_url); @@ -1236,7 +1236,7 @@ void RequestTrackerImpl::TrimToURL(const GURL& full_url, id user_info) { } void RequestTrackerImpl::StopPageLoad(const GURL& url, bool load_success) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); DCHECK(page_url_ == GURLByRemovingRefFromGURL(url)); is_loading_ = false; } @@ -1248,8 +1248,8 @@ void RequestTrackerImpl::PostTask(const base::Closure& task, // Absolute sanity test: |thread| is one of {UI, IO} DCHECK(thread == web::WebThread::UI || thread == web::WebThread::IO); // Check that we're on the counterpart thread to the one we're posting to. - DCHECK_CURRENTLY_ON_WEB_THREAD( - thread == web::WebThread::IO ? web::WebThread::UI : web::WebThread::IO); + DCHECK_CURRENTLY_ON(thread == web::WebThread::IO ? web::WebThread::UI + : web::WebThread::IO); // Don't post if the tracker is closing and we're on the IO thread. // (there should be no way to call anything from the UI thread if // the tracker is closing). @@ -1261,7 +1261,7 @@ void RequestTrackerImpl::PostTask(const base::Closure& task, #pragma mark Other internal methods. NSString* RequestTrackerImpl::UnsafeDescription() { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); NSMutableArray* urls = [NSMutableArray array]; ScopedVector<TrackerCounts>::iterator it; @@ -1281,7 +1281,7 @@ NSString* RequestTrackerImpl::GetNetworkActivityKey() { } void RequestTrackerImpl::CancelRequests() { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); std::set<net::URLRequest*>::iterator it; // TODO(droger): When canceling the request, we should in theory make sure // that the NSURLProtocol client method |didFailWithError| is called, diff --git a/ios/web/net/request_tracker_impl_unittest.mm b/ios/web/net/request_tracker_impl_unittest.mm index 7f84317..2deaec1 100644 --- a/ios/web/net/request_tracker_impl_unittest.mm +++ b/ios/web/net/request_tracker_impl_unittest.mm @@ -147,7 +147,7 @@ class RequestTrackerTest : public PlatformTest { ~RequestTrackerTest() override {} void SetUp() override { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); request_group_id_.reset( [[NSString stringWithFormat:@"test%d", g_count++] retain]); @@ -160,7 +160,7 @@ class RequestTrackerTest : public PlatformTest { } void TearDown() override { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); tracker_->Close(); } @@ -199,7 +199,7 @@ class RequestTrackerTest : public PlatformTest { } NSString* WaitUntilLoop(bool (^condition)(void)) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); base::Time maxDate = base::Time::Now() + base::TimeDelta::FromSeconds(10); while (!condition()) { if ([receiver_ error]) @@ -223,14 +223,14 @@ class RequestTrackerTest : public PlatformTest { } void TrimRequest(NSString* tab_id, const GURL& url) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); receiver_.get()->value_ = 0.0f; receiver_.get()->max_ = 0.0f; tracker_->StartPageLoad(url, nil); } void EndPage(NSString* tab_id, const GURL& url) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); tracker_->FinishPageLoad(url, false); receiver_.get()->value_ = 0.0f; receiver_.get()->max_ = 0.0f; diff --git a/ios/web/public/web_thread.h b/ios/web/public/web_thread.h index 01b65ea..9d404f1 100644 --- a/ios/web/public/web_thread.h +++ b/ios/web/public/web_thread.h @@ -27,15 +27,17 @@ namespace web { class WebThreadDelegate; -// Use DCHECK_CURRENTLY_ON_WEB_THREAD(WebThread::ID) to assert that a function -// can only be called on the named WebThread. -// TODO(ios): rename to DCHECK_CURRENTLY_ON once iOS is independent from -// content/ so it won't collide with the macro DCHECK_CURRENTLY_ON in content/. -// http://crbug.com/438202 -#define DCHECK_CURRENTLY_ON_WEB_THREAD(thread_identifier) \ +// Use DCHECK_CURRENTLY_ON(WebThread::ID) to assert that a function can only be +// called on the named WebThread. +#define DCHECK_CURRENTLY_ON(thread_identifier) \ (DCHECK(::web::WebThread::CurrentlyOn(thread_identifier)) \ << ::web::WebThread::GetDCheckCurrentlyOnErrorMessage(thread_identifier)) +// TODO(crbug.com/438202): remove this compatibility macro once all the code +// downstream has been ported to use the new name DCHECK_CURRENTLY_ON. +#define DCHECK_CURRENTLY_ON_WEB_THREAD(thread_identifier) \ + DCHECK_CURRENTLY_ON(thread_identifier) + /////////////////////////////////////////////////////////////////////////////// // WebThread // @@ -190,8 +192,7 @@ class WebThread { static bool IsThreadInitialized(ID identifier) WARN_UNUSED_RESULT; // Callable on any thread. Returns whether execution is currently on the - // given thread. To DCHECK this, use the DCHECK_CURRENTLY_ON_WEB_THREAD() - // macro above. + // given thread. To DCHECK this, use the DCHECK_CURRENTLY_ON() macro above. static bool CurrentlyOn(ID identifier) WARN_UNUSED_RESULT; // Callable on any thread. Returns whether the threads message loop is valid. @@ -218,8 +219,7 @@ class WebThread { // not deleted while unregistering. static void SetDelegate(ID identifier, WebThreadDelegate* delegate); - // Returns an appropriate error message for when - // DCHECK_CURRENTLY_ON_WEB_THREAD() fails. + // Returns an appropriate error message for when DCHECK_CURRENTLY_ON() fails. static std::string GetDCheckCurrentlyOnErrorMessage(ID expected); // Use these templates in conjunction with RefCountedThreadSafe or scoped_ptr diff --git a/ios/web/web_view_counter_impl.mm b/ios/web/web_view_counter_impl.mm index 74b3869..ebd9963 100644 --- a/ios/web/web_view_counter_impl.mm +++ b/ios/web/web_view_counter_impl.mm @@ -18,17 +18,17 @@ const char kWebViewCounterKeyName[] = "web_view_counter"; } // namespace WebViewCounterImpl::WebViewCounterImpl() { - DCHECK_CURRENTLY_ON_WEB_THREAD(WebThread::UI); + DCHECK_CURRENTLY_ON(WebThread::UI); } WebViewCounterImpl::~WebViewCounterImpl() { - DCHECK_CURRENTLY_ON_WEB_THREAD(WebThread::UI); + DCHECK_CURRENTLY_ON(WebThread::UI); } // static WebViewCounter* WebViewCounter::FromBrowserState( web::BrowserState* browser_state) { - DCHECK_CURRENTLY_ON_WEB_THREAD(WebThread::UI); + DCHECK_CURRENTLY_ON(WebThread::UI); DCHECK(browser_state); return WebViewCounterImpl::FromBrowserState(browser_state); @@ -37,7 +37,7 @@ WebViewCounter* WebViewCounter::FromBrowserState( // static WebViewCounterImpl* WebViewCounterImpl::FromBrowserState( web::BrowserState* browser_state) { - DCHECK_CURRENTLY_ON_WEB_THREAD(WebThread::UI); + DCHECK_CURRENTLY_ON(WebThread::UI); DCHECK(browser_state); if (!browser_state->GetUserData(kWebViewCounterKeyName)) { @@ -49,12 +49,12 @@ WebViewCounterImpl* WebViewCounterImpl::FromBrowserState( } size_t WebViewCounterImpl::GetWKWebViewCount() { - DCHECK_CURRENTLY_ON_WEB_THREAD(WebThread::UI); + DCHECK_CURRENTLY_ON(WebThread::UI); return wk_web_view_counter_.Size(); } void WebViewCounterImpl::InsertWKWebView(WKWebView* wk_web_view) { - DCHECK_CURRENTLY_ON_WEB_THREAD(WebThread::UI); + DCHECK_CURRENTLY_ON(WebThread::UI); DCHECK(wk_web_view); DCHECK([wk_web_view isKindOfClass:[WKWebView class]]); diff --git a/ios/web/webui/url_data_manager_ios.cc b/ios/web/webui/url_data_manager_ios.cc index 1b67ba29..ab050d6 100644 --- a/ios/web/webui/url_data_manager_ios.cc +++ b/ios/web/webui/url_data_manager_ios.cc @@ -46,7 +46,7 @@ URLDataManagerIOS::URLDataSources* URLDataManagerIOS::data_sources_ = NULL; void URLDataManagerIOS::AddDataSourceOnIOThread( BrowserState* browser_state, scoped_refptr<URLDataSourceIOSImpl> data_source) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); browser_state->GetURLDataManagerIOSBackendOnIOThread()->AddDataSource( data_source.get()); } @@ -59,7 +59,7 @@ URLDataManagerIOS::~URLDataManagerIOS() { } void URLDataManagerIOS::AddDataSource(URLDataSourceIOSImpl* source) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); web::WebThread::PostTask( web::WebThread::IO, FROM_HERE, base::Bind(&AddDataSourceOnIOThread, base::Unretained(browser_state_), @@ -68,7 +68,7 @@ void URLDataManagerIOS::AddDataSource(URLDataSourceIOSImpl* source) { // static void URLDataManagerIOS::DeleteDataSources() { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); + DCHECK_CURRENTLY_ON(web::WebThread::UI); URLDataSources sources; { base::AutoLock lock(g_delete_lock.Get()); diff --git a/ios/web/webui/url_data_manager_ios_backend.mm b/ios/web/webui/url_data_manager_ios_backend.mm index 1a6723b..29c2e3f 100644 --- a/ios/web/webui/url_data_manager_ios_backend.mm +++ b/ios/web/webui/url_data_manager_ios_backend.mm @@ -338,7 +338,7 @@ namespace { void GetMimeTypeOnUI(URLDataSourceIOSImpl* source, const std::string& path, const base::WeakPtr<URLRequestChromeJob>& job) { - DCHECK_CURRENTLY_ON_WEB_THREAD(WebThread::UI); + DCHECK_CURRENTLY_ON(WebThread::UI); std::string mime_type = source->source()->GetMimeType(path); WebThread::PostTask( WebThread::IO, FROM_HERE, @@ -405,7 +405,7 @@ URLDataManagerIOSBackend::CreateProtocolHandler(BrowserState* browser_state) { } void URLDataManagerIOSBackend::AddDataSource(URLDataSourceIOSImpl* source) { - DCHECK_CURRENTLY_ON_WEB_THREAD(WebThread::IO); + DCHECK_CURRENTLY_ON(WebThread::IO); DataSourceMap::iterator i = data_sources_.find(source->source_name()); if (i != data_sources_.end()) { if (!source->source()->ShouldReplaceExistingSource()) diff --git a/ios/web/webui/url_data_source_ios_impl.cc b/ios/web/webui/url_data_source_ios_impl.cc index 209f361..4866088 100644 --- a/ios/web/webui/url_data_source_ios_impl.cc +++ b/ios/web/webui/url_data_source_ios_impl.cc @@ -49,7 +49,7 @@ void URLDataSourceIOSImpl::SendResponse( void URLDataSourceIOSImpl::SendResponseOnIOThread( int request_id, scoped_refptr<base::RefCountedMemory> bytes) { - DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); + DCHECK_CURRENTLY_ON(web::WebThread::IO); if (backend_) backend_->DataAvailable(request_id, bytes.get()); } |