diff options
author | thestig <thestig@chromium.org> | 2015-09-08 14:44:52 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-09-08 21:46:04 +0000 |
commit | 00844ceac8d1850349d4ae23285c56a978a1e803 (patch) | |
tree | 6201b92d86fb79c5c9bb57f3fb6c07613ed44251 | |
parent | 963891f0ae6078b07aa256c5024a618905c5d287 (diff) | |
download | chromium_src-00844ceac8d1850349d4ae23285c56a978a1e803.zip chromium_src-00844ceac8d1850349d4ae23285c56a978a1e803.tar.gz chromium_src-00844ceac8d1850349d4ae23285c56a978a1e803.tar.bz2 |
Use DCHECK_CURRENTLY_ON() in chrome/ and android_webview/
Review URL: https://codereview.chromium.org/1329093002
Cr-Commit-Position: refs/heads/master@{#347799}
45 files changed, 181 insertions, 187 deletions
diff --git a/android_webview/native/aw_contents.cc b/android_webview/native/aw_contents.cc index 48e9d51..4fea2fd 100644 --- a/android_webview/native/aw_contents.cc +++ b/android_webview/native/aw_contents.cc @@ -120,7 +120,7 @@ const void* kAwContentsUserDataKey = &kAwContentsUserDataKey; class AwContentsUserData : public base::SupportsUserData::Data { public: - AwContentsUserData(AwContents* ptr) : contents_(ptr) {} + explicit AwContentsUserData(AwContents* ptr) : contents_(ptr) {} static AwContents* GetContents(WebContents* web_contents) { if (!web_contents) @@ -989,7 +989,7 @@ void AwContents::SetBackgroundColor(JNIEnv* env, jobject obj, jint color) { void AwContents::OnComputeScroll(JNIEnv* env, jobject obj, jlong animation_time_millis) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); browser_view_renderer_.OnComputeScroll( base::TimeTicks() + base::TimeDelta::FromMilliseconds(animation_time_millis)); diff --git a/android_webview/native/aw_contents_io_thread_client_impl.cc b/android_webview/native/aw_contents_io_thread_client_impl.cc index 11ac6f0..cab63d7 100644 --- a/android_webview/native/aw_contents_io_thread_client_impl.cc +++ b/android_webview/native/aw_contents_io_thread_client_impl.cc @@ -386,7 +386,7 @@ void AwContentsIoThreadClientImpl::NewLoginRequest(const string& realm, void AwContentsIoThreadClientImpl::OnReceivedError( const net::URLRequest* request) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); if (java_object_.is_null()) return; diff --git a/chrome/browser/android/history_report/history_report_jni_bridge.cc b/chrome/browser/android/history_report/history_report_jni_bridge.cc index 7acdf71..dec8222 100644 --- a/chrome/browser/android/history_report/history_report_jni_bridge.cc +++ b/chrome/browser/android/history_report/history_report_jni_bridge.cc @@ -37,7 +37,7 @@ bool RegisterHistoryReportJniBridge(JNIEnv* env) { HistoryReportJniBridge::HistoryReportJniBridge(JNIEnv* env, jobject obj) : weak_java_provider_(env, obj) { - DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); Profile* profile = g_browser_process->profile_manager()-> GetLastUsedProfile()->GetOriginalProfile(); diff --git a/chrome/browser/android/provider/blocking_ui_thread_async_request.h b/chrome/browser/android/provider/blocking_ui_thread_async_request.h index 5e2a6f9..dfcf137 100644 --- a/chrome/browser/android/provider/blocking_ui_thread_async_request.h +++ b/chrome/browser/android/provider/blocking_ui_thread_async_request.h @@ -25,7 +25,7 @@ class BlockingUIThreadAsyncRequest { // The request argument can be defined using base::Bind. template <typename Signature> void RunAsyncRequestOnUIThreadBlocking(base::Callback<Signature> request) { - DCHECK(!content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); // Make the request in the UI thread. request_completed_.Reset(); diff --git a/chrome/browser/app_controller_mac.mm b/chrome/browser/app_controller_mac.mm index 137a060..7eae434 100644 --- a/chrome/browser/app_controller_mac.mm +++ b/chrome/browser/app_controller_mac.mm @@ -175,7 +175,7 @@ void RecordLastRunAppBundlePath() { // real, user-visible app bundle directory. (The alternatives give either the // framework's path or the initial app's path, which may be an app mode shim // or a unit test.) - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); + DCHECK_CURRENTLY_ON(BrowserThread::FILE); base::FilePath app_bundle_path = chrome::GetVersionedDirectory().DirName().DirName().DirName(); diff --git a/chrome/browser/browser_shutdown.cc b/chrome/browser/browser_shutdown.cc index 9ee066b..3b895fc 100644 --- a/chrome/browser/browser_shutdown.cc +++ b/chrome/browser/browser_shutdown.cc @@ -278,7 +278,7 @@ void ShutdownPostThreadsStop(bool restart_last_session) { void ReadLastShutdownFile(ShutdownType type, int num_procs, int num_procs_slow) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); + DCHECK_CURRENTLY_ON(BrowserThread::FILE); base::FilePath shutdown_ms_file = GetShutdownMsPath(); std::string shutdown_ms_str; diff --git a/chrome/browser/certificate_manager_model.cc b/chrome/browser/certificate_manager_model.cc index e932883..81803ea 100644 --- a/chrome/browser/certificate_manager_model.cc +++ b/chrome/browser/certificate_manager_model.cc @@ -52,7 +52,7 @@ void CertificateManagerModel::Create( content::BrowserContext* browser_context, CertificateManagerModel::Observer* observer, const CreationCallback& callback) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, @@ -71,7 +71,7 @@ CertificateManagerModel::CertificateManagerModel( is_user_db_available_(is_user_db_available), is_tpm_available_(is_tpm_available), observer_(observer) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); } CertificateManagerModel::~CertificateManagerModel() { @@ -213,7 +213,7 @@ void CertificateManagerModel::DidGetCertDBOnUIThread( bool is_tpm_available, CertificateManagerModel::Observer* observer, const CreationCallback& callback) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); scoped_ptr<CertificateManagerModel> model(new CertificateManagerModel( cert_db, is_user_db_available, is_tpm_available, observer)); @@ -225,7 +225,7 @@ void CertificateManagerModel::DidGetCertDBOnIOThread( CertificateManagerModel::Observer* observer, const CreationCallback& callback, net::NSSCertDatabase* cert_db) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); bool is_user_db_available = cert_db->GetPublicSlot(); bool is_tpm_available = false; @@ -248,7 +248,7 @@ void CertificateManagerModel::GetCertDBOnIOThread( content::ResourceContext* context, CertificateManagerModel::Observer* observer, const CreationCallback& callback) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); net::NSSCertDatabase* cert_db = GetNSSCertDatabaseForResourceContext( context, base::Bind(&CertificateManagerModel::DidGetCertDBOnIOThread, diff --git a/chrome/browser/character_encoding.cc b/chrome/browser/character_encoding.cc index 91ac5505..0a166a9 100644 --- a/chrome/browser/character_encoding.cc +++ b/chrome/browser/character_encoding.cc @@ -183,7 +183,7 @@ const CanonicalNameDisplayNameMapType* // A static map object which contains all resourceid-nonsequenced canonical // encoding names. CanonicalEncodingMap* CanonicalEncodingMapSingleton() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); static CanonicalEncodingMap* singleton = new CanonicalEncodingMap; return singleton; } diff --git a/chrome/browser/chrome_browser_main_posix.cc b/chrome/browser/chrome_browser_main_posix.cc index 4ae6397..a69659f 100644 --- a/chrome/browser/chrome_browser_main_posix.cc +++ b/chrome/browser/chrome_browser_main_posix.cc @@ -114,7 +114,7 @@ class ExitHandler { // static void ExitHandler::ExitWhenPossibleOnUIThread() { - DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); if (SessionRestore::IsRestoringSynchronously()) { // ExitHandler takes care of deleting itself. new ExitHandler(); diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc index 0f91135..c8d718f 100644 --- a/chrome/browser/chrome_content_browser_client.cc +++ b/chrome/browser/chrome_content_browser_client.cc @@ -508,7 +508,7 @@ int GetCrashSignalFD(const base::CommandLine& command_line) { #endif // defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_MACOSX) void SetApplicationLocaleOnIOThread(const std::string& locale) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); g_io_thread_application_locale.Get() = locale; } @@ -662,7 +662,7 @@ void ChromeContentBrowserClient::RegisterProfilePrefs( // static void ChromeContentBrowserClient::SetApplicationLocale( const std::string& locale) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); // This object is guaranteed to outlive all threads so we don't have to // worry about the lack of refcounting and can just post as Unretained. @@ -1607,7 +1607,7 @@ bool ChromeContentBrowserClient::AllowAppCache( const GURL& manifest_url, const GURL& first_party, content::ResourceContext* context) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); ProfileIOData* io_data = ProfileIOData::FromResourceContext(context); return io_data->GetCookieSettings()-> IsSettingCookieAllowed(manifest_url, first_party); @@ -1619,7 +1619,7 @@ bool ChromeContentBrowserClient::AllowServiceWorker( content::ResourceContext* context, int render_process_id, int render_frame_id) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); ProfileIOData* io_data = ProfileIOData::FromResourceContext(context); bool allow = io_data->GetCookieSettings()->IsSettingCookieAllowed( scope, first_party_url); @@ -1639,7 +1639,7 @@ bool ChromeContentBrowserClient::AllowGetCookie( content::ResourceContext* context, int render_process_id, int render_frame_id) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); ProfileIOData* io_data = ProfileIOData::FromResourceContext(context); bool allow = io_data->GetCookieSettings()-> IsReadingCookieAllowed(url, first_party); @@ -1659,7 +1659,7 @@ bool ChromeContentBrowserClient::AllowSetCookie( int render_process_id, int render_frame_id, net::CookieOptions* options) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); ProfileIOData* io_data = ProfileIOData::FromResourceContext(context); content_settings::CookieSettings* cookie_settings = io_data->GetCookieSettings(); @@ -1675,7 +1675,7 @@ bool ChromeContentBrowserClient::AllowSetCookie( bool ChromeContentBrowserClient::AllowSaveLocalState( content::ResourceContext* context) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); ProfileIOData* io_data = ProfileIOData::FromResourceContext(context); content_settings::CookieSettings* cookie_settings = io_data->GetCookieSettings(); @@ -1693,7 +1693,7 @@ bool ChromeContentBrowserClient::AllowWorkerDatabase( unsigned long estimated_size, content::ResourceContext* context, const std::vector<std::pair<int, int> >& render_frames) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); ProfileIOData* io_data = ProfileIOData::FromResourceContext(context); content_settings::CookieSettings* cookie_settings = io_data->GetCookieSettings(); @@ -1716,7 +1716,7 @@ void ChromeContentBrowserClient::AllowWorkerFileSystem( content::ResourceContext* context, const std::vector<std::pair<int, int> >& render_frames, base::Callback<void(bool)> callback) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); ProfileIOData* io_data = ProfileIOData::FromResourceContext(context); content_settings::CookieSettings* cookie_settings = io_data->GetCookieSettings(); @@ -1735,7 +1735,7 @@ void ChromeContentBrowserClient::GuestPermissionRequestHelper( const std::vector<std::pair<int, int> >& render_frames, base::Callback<void(bool)> callback, bool allow) { - DCHECK(BrowserThread:: CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); std::vector<std::pair<int, int> >::const_iterator i; std::map<int, int> process_map; std::map<int, int>::const_iterator it; @@ -1778,7 +1778,7 @@ void ChromeContentBrowserClient::RequestFileSystemPermissionOnUIThread( const GURL& url, bool allowed_by_default, const base::Callback<void(bool)>& callback) { - DCHECK(BrowserThread:: CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); extensions::WebViewPermissionHelper* web_view_permission_helper = extensions::WebViewPermissionHelper::FromFrameID( render_process_id, render_frame_id); @@ -1810,7 +1810,7 @@ bool ChromeContentBrowserClient::AllowWorkerIndexedDB( const base::string16& name, content::ResourceContext* context, const std::vector<std::pair<int, int> >& render_frames) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); ProfileIOData* io_data = ProfileIOData::FromResourceContext(context); content_settings::CookieSettings* cookie_settings = io_data->GetCookieSettings(); @@ -1845,7 +1845,7 @@ bool ChromeContentBrowserClient::AllowWebRTCIdentityCache( net::URLRequestContext* ChromeContentBrowserClient::OverrideRequestContextForURL( const GURL& url, content::ResourceContext* context) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); #if defined(ENABLE_EXTENSIONS) if (url.SchemeIs(extensions::kExtensionScheme)) { ProfileIOData* io_data = ProfileIOData::FromResourceContext(context); @@ -2010,7 +2010,7 @@ bool ChromeContentBrowserClient::CanCreateWindow( int opener_render_view_id, int opener_render_frame_id, bool* no_javascript_access) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); *no_javascript_access = false; @@ -2090,7 +2090,7 @@ bool ChromeContentBrowserClient::CanCreateWindow( } void ChromeContentBrowserClient::ResourceDispatcherHostCreated() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); return g_browser_process->ResourceDispatcherHostCreated(); } @@ -2611,7 +2611,7 @@ bool ChromeContentBrowserClient::IsPluginAllowedToUseDevChannelAPIs( void ChromeContentBrowserClient::OverridePageVisibilityState( RenderFrameHost* render_frame_host, blink::WebPageVisibilityState* visibility_state) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); WebContents* web_contents = WebContents::FromRenderFrameHost(render_frame_host); diff --git a/chrome/browser/chromeos/attestation/attestation_policy_observer.cc b/chrome/browser/chromeos/attestation/attestation_policy_observer.cc index 138d8b0..371c0be 100644 --- a/chrome/browser/chromeos/attestation/attestation_policy_observer.cc +++ b/chrome/browser/chromeos/attestation/attestation_policy_observer.cc @@ -131,7 +131,7 @@ AttestationPolicyObserver::~AttestationPolicyObserver() { } void AttestationPolicyObserver::AttestationSettingChanged() { - DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); num_retries_ = 0; Start(); } diff --git a/chrome/browser/chromeos/attestation/platform_verification_impl.cc b/chrome/browser/chromeos/attestation/platform_verification_impl.cc index 9bfc062..89b098a 100644 --- a/chrome/browser/chromeos/attestation/platform_verification_impl.cc +++ b/chrome/browser/chromeos/attestation/platform_verification_impl.cc @@ -16,7 +16,7 @@ void PlatformVerificationImpl::Create( content::RenderFrameHost* render_frame_host, mojo::InterfaceRequest<PlatformVerification> request) { DVLOG(2) << __FUNCTION__; - DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); DCHECK(render_frame_host); // The created object is strongly bound to (and owned by) the pipe. @@ -40,7 +40,7 @@ void PlatformVerificationImpl::ChallengePlatform( const mojo::String& challenge, const ChallengePlatformCallback& callback) { DVLOG(2) << __FUNCTION__; - DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); if (!platform_verification_flow_.get()) platform_verification_flow_ = new PlatformVerificationFlow(); @@ -58,7 +58,7 @@ void PlatformVerificationImpl::OnPlatformChallenged( const std::string& signature, const std::string& platform_key_certificate) { DVLOG(2) << __FUNCTION__ << ": " << result; - DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); if (result != PlatformVerificationFlow::SUCCESS) { DCHECK(signed_data.empty()); diff --git a/chrome/browser/chromeos/login/session/user_session_manager.cc b/chrome/browser/chromeos/login/session/user_session_manager.cc index ae78f45..a3a7ab0 100644 --- a/chrome/browser/chromeos/login/session/user_session_manager.cc +++ b/chrome/browser/chromeos/login/session/user_session_manager.cc @@ -1452,7 +1452,7 @@ void UserSessionManager::RestorePendingUserSessions() { } void UserSessionManager::NotifyPendingUserSessionsRestoreFinished() { - DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); user_sessions_restored_ = true; user_sessions_restore_in_progress_ = false; FOR_EACH_OBSERVER(chromeos::UserSessionStateObserver, diff --git a/chrome/browser/chromeos/policy/policy_cert_verifier.cc b/chrome/browser/chromeos/policy/policy_cert_verifier.cc index 3165fa9..742389a 100644 --- a/chrome/browser/chromeos/policy/policy_cert_verifier.cc +++ b/chrome/browser/chromeos/policy/policy_cert_verifier.cc @@ -46,12 +46,12 @@ PolicyCertVerifier::PolicyCertVerifier( } PolicyCertVerifier::~PolicyCertVerifier() { - DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); + DCHECK_CURRENTLY_ON(content::BrowserThread::IO); } void PolicyCertVerifier::InitializeOnIOThread( const scoped_refptr<net::CertVerifyProc>& verify_proc) { - DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); + DCHECK_CURRENTLY_ON(content::BrowserThread::IO); if (!verify_proc->SupportsAdditionalTrustAnchors()) { LOG(WARNING) << "Additional trust anchors not supported on the current platform!"; @@ -64,7 +64,7 @@ void PolicyCertVerifier::InitializeOnIOThread( void PolicyCertVerifier::SetTrustAnchors( const net::CertificateList& trust_anchors) { - DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); + DCHECK_CURRENTLY_ON(content::BrowserThread::IO); trust_anchors_ = trust_anchors; } @@ -78,7 +78,7 @@ int PolicyCertVerifier::Verify( const net::CompletionCallback& completion_callback, scoped_ptr<Request>* out_req, const net::BoundNetLog& net_log) { - DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); + DCHECK_CURRENTLY_ON(content::BrowserThread::IO); DCHECK(delegate_); net::CompletionCallback wrapped_callback = base::Bind(&CompleteAndSignalAnchorUse, @@ -93,12 +93,12 @@ int PolicyCertVerifier::Verify( } bool PolicyCertVerifier::SupportsOCSPStapling() { - DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); + DCHECK_CURRENTLY_ON(content::BrowserThread::IO); return delegate_->SupportsOCSPStapling(); } const net::CertificateList& PolicyCertVerifier::GetAdditionalTrustAnchors() { - DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); + DCHECK_CURRENTLY_ON(content::BrowserThread::IO); return trust_anchors_; } diff --git a/chrome/browser/chromeos/system/input_device_settings_impl_x11.cc b/chrome/browser/chromeos/system/input_device_settings_impl_x11.cc index 17c0649..b9be3aa 100644 --- a/chrome/browser/chromeos/system/input_device_settings_impl_x11.cc +++ b/chrome/browser/chromeos/system/input_device_settings_impl_x11.cc @@ -224,7 +224,7 @@ void InputDeviceSettingsImplX11::SetTapDragging(bool enabled) { void InputDeviceSettingsImplX11::MouseExists( const DeviceExistsCallback& callback) { - DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); DeviceExists(kDeviceTypeMouse, callback); } diff --git a/chrome/browser/chromeos/system_logs/debug_daemon_log_source.cc b/chrome/browser/chromeos/system_logs/debug_daemon_log_source.cc index 44e4820..9b4fd73 100644 --- a/chrome/browser/chromeos/system_logs/debug_daemon_log_source.cc +++ b/chrome/browser/chromeos/system_logs/debug_daemon_log_source.cc @@ -99,7 +99,7 @@ void DebugDaemonLogSource::OnGetNetworkStatus(bool succeeded, void DebugDaemonLogSource::OnGetModemStatus(bool succeeded, const std::string& status) { - DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); if (succeeded) (*response_)[kModemStatusKeyName] = status; @@ -110,18 +110,15 @@ void DebugDaemonLogSource::OnGetModemStatus(bool succeeded, void DebugDaemonLogSource::OnGetWiMaxStatus(bool succeeded, const std::string& status) { - DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); - if (succeeded) - (*response_)[kWiMaxStatusKeyName] = status; - else - (*response_)[kWiMaxStatusKeyName] = kNotAvailable; + (*response_)[kWiMaxStatusKeyName] = succeeded ? status : kNotAvailable; RequestCompleted(); } void DebugDaemonLogSource::OnGetLogs(bool /* succeeded */, const KeyValueMap& logs) { - DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); // We ignore 'succeeded' for this callback - we want to display as much of the // debug info as we can even if we failed partway through parsing, and if we @@ -133,7 +130,7 @@ void DebugDaemonLogSource::OnGetLogs(bool /* succeeded */, void DebugDaemonLogSource::OnGetUserLogFiles( bool succeeded, const KeyValueMap& user_log_files) { - DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); if (succeeded) { SystemLogsResponse* response = new SystemLogsResponse; @@ -195,7 +192,7 @@ void DebugDaemonLogSource::MergeResponse(SystemLogsResponse* response) { } void DebugDaemonLogSource::RequestCompleted() { - DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); DCHECK(!callback_.is_null()); --num_pending_requests_; diff --git a/chrome/browser/content_settings/cookie_settings_factory.cc b/chrome/browser/content_settings/cookie_settings_factory.cc index e22b45a..b4b5d5ce 100644 --- a/chrome/browser/content_settings/cookie_settings_factory.cc +++ b/chrome/browser/content_settings/cookie_settings_factory.cc @@ -21,7 +21,7 @@ using base::UserMetricsAction; // static scoped_refptr<content_settings::CookieSettings> CookieSettingsFactory::GetForProfile(Profile* profile) { - DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); return static_cast<content_settings::CookieSettings*>( GetInstance()->GetServiceForBrowserContext(profile, true).get()); } diff --git a/chrome/browser/content_settings/tab_specific_content_settings.cc b/chrome/browser/content_settings/tab_specific_content_settings.cc index f077c08..2496ee2 100644 --- a/chrome/browser/content_settings/tab_specific_content_settings.cc +++ b/chrome/browser/content_settings/tab_specific_content_settings.cc @@ -139,7 +139,7 @@ void TabSpecificContentSettings::CookiesRead(int render_process_id, const GURL& frame_url, const net::CookieList& cookie_list, bool blocked_by_policy) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); TabSpecificContentSettings* settings = GetForFrame(render_process_id, render_frame_id); if (settings) { @@ -157,7 +157,7 @@ void TabSpecificContentSettings::CookieChanged( const std::string& cookie_line, const net::CookieOptions& options, bool blocked_by_policy) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); TabSpecificContentSettings* settings = GetForFrame(render_process_id, render_frame_id); if (settings) @@ -173,7 +173,7 @@ void TabSpecificContentSettings::WebDatabaseAccessed( const base::string16& name, const base::string16& display_name, bool blocked_by_policy) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); TabSpecificContentSettings* settings = GetForFrame( render_process_id, render_frame_id); if (settings) @@ -186,7 +186,7 @@ void TabSpecificContentSettings::DOMStorageAccessed(int render_process_id, const GURL& url, bool local, bool blocked_by_policy) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); TabSpecificContentSettings* settings = GetForFrame( render_process_id, render_frame_id); if (settings) @@ -200,7 +200,7 @@ void TabSpecificContentSettings::IndexedDBAccessed( const GURL& url, const base::string16& description, bool blocked_by_policy) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); TabSpecificContentSettings* settings = GetForFrame( render_process_id, render_frame_id); if (settings) @@ -212,7 +212,7 @@ void TabSpecificContentSettings::FileSystemAccessed(int render_process_id, int render_frame_id, const GURL& url, bool blocked_by_policy) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); TabSpecificContentSettings* settings = GetForFrame( render_process_id, render_frame_id); if (settings) diff --git a/chrome/browser/enumerate_modules_model_win.cc b/chrome/browser/enumerate_modules_model_win.cc index a940c2e..8eff4f3 100644 --- a/chrome/browser/enumerate_modules_model_win.cc +++ b/chrome/browser/enumerate_modules_model_win.cc @@ -748,7 +748,7 @@ void ModuleEnumerator::MatchAgainstBlacklist() { void ModuleEnumerator::ReportBack() { if (!limited_mode_) - DCHECK(BrowserThread::CurrentlyOn(callback_thread_id_)); + DCHECK_CURRENTLY_ON(callback_thread_id_); observer_->DoneScanning(); } diff --git a/chrome/browser/errorpage_browsertest.cc b/chrome/browser/errorpage_browsertest.cc index f47a585..d68cef9 100644 --- a/chrome/browser/errorpage_browsertest.cc +++ b/chrome/browser/errorpage_browsertest.cc @@ -61,11 +61,8 @@ #include "chrome/browser/chromeos/chrome_browser_main_chromeos.h" #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" #include "chrome/browser/chromeos/policy/stub_enterprise_install_attributes.h" -#include "chrome/grit/generated_resources.h" #include "components/policy/core/common/mock_configuration_policy_provider.h" #include "components/policy/core/common/policy_types.h" -#include "content/public/test/browser_test_utils.h" -#include "ui/base/l10n/l10n_util.h" #endif using content::BrowserThread; @@ -173,7 +170,7 @@ std::string GetShowSavedButtonLabel() { void AddInterceptorForURL( const GURL& url, scoped_ptr<net::URLRequestInterceptor> handler) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); net::URLRequestFilter::GetInstance()->AddUrlInterceptor( url, handler.Pass()); } @@ -190,7 +187,7 @@ class FailFirstNRequestsInterceptor : public net::URLRequestInterceptor { net::URLRequestJob* MaybeInterceptRequest( net::URLRequest* request, net::NetworkDelegate* network_delegate) const override { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); requests_++; if (failures_ < requests_to_fail_) { failures_++; @@ -236,7 +233,7 @@ class LinkDoctorInterceptor : public net::URLRequestInterceptor { net::URLRequestJob* MaybeInterceptRequest( net::URLRequest* request, net::NetworkDelegate* network_delegate) const override { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); BrowserThread::PostTask( BrowserThread::UI, FROM_HERE, @@ -254,7 +251,7 @@ class LinkDoctorInterceptor : public net::URLRequestInterceptor { } void WaitForRequests(int requests_to_wait_for) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK_EQ(-1, requests_to_wait_for_); DCHECK(!run_loop_); @@ -273,13 +270,13 @@ class LinkDoctorInterceptor : public net::URLRequestInterceptor { // created, either through calling WaitForRequests or some other manner, // before calling this method. int num_requests() const { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); return num_requests_; } private: void RequestCreated() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); num_requests_++; if (num_requests_ == requests_to_wait_for_) @@ -529,7 +526,7 @@ class TestFailProvisionalLoadObserver : public content::WebContentsObserver { void InterceptNetworkTransactions(net::URLRequestContextGetter* getter, net::Error error) { - DCHECK(content::BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); net::HttpCache* cache( getter->GetURLRequestContext()->http_transaction_factory()->GetCache()); DCHECK(cache); @@ -1113,7 +1110,7 @@ class ErrorPageNavigationCorrectionsFailTest : public ErrorPageTest { // // Also adds the net::URLRequestFailedJob filter. static void AddFilters() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); URLRequestFailedJob::AddUrlHandler(); net::URLRequestFilter::GetInstance()->AddUrlInterceptor( @@ -1123,7 +1120,7 @@ class ErrorPageNavigationCorrectionsFailTest : public ErrorPageTest { } static void RemoveFilters() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); net::URLRequestFilter::GetInstance()->ClearHandlers(); } }; @@ -1266,12 +1263,12 @@ class ErrorPageForIDNTest : public InProcessBrowserTest { private: static void AddFilters() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); URLRequestFailedJob::AddUrlHandlerForHostname(kHostname); } static void RemoveFilters() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); net::URLRequestFilter::GetInstance()->ClearHandlers(); } }; diff --git a/chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_api_advertisement.cc b/chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_api_advertisement.cc index 4dc0cab..9eb998e 100644 --- a/chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_api_advertisement.cc +++ b/chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_api_advertisement.cc @@ -26,7 +26,7 @@ BluetoothApiAdvertisement::BluetoothApiAdvertisement( const std::string& owner_extension_id, scoped_refptr<device::BluetoothAdvertisement> advertisement) : ApiResource(owner_extension_id), advertisement_(advertisement) { - DCHECK(content::BrowserThread::CurrentlyOn(kThreadId)); + DCHECK_CURRENTLY_ON(kThreadId); } BluetoothApiAdvertisement::~BluetoothApiAdvertisement() { diff --git a/chrome/browser/history/android/sqlite_cursor.cc b/chrome/browser/history/android/sqlite_cursor.cc index 9e3d143..7b3fa9b 100644 --- a/chrome/browser/history/android/sqlite_cursor.cc +++ b/chrome/browser/history/android/sqlite_cursor.cc @@ -161,7 +161,7 @@ SQLiteCursor::~SQLiteCursor() { void SQLiteCursor::DestroyOnUIThread() { // Consumer requests were set in the UI thread. They must be cancelled // using the same thread. - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); tracker_.reset(); service_->CloseStatement(statement_); delete this; @@ -198,7 +198,7 @@ bool SQLiteCursor::GetFavicon(favicon_base::FaviconID id, void SQLiteCursor::GetFaviconForIDInUIThread( favicon_base::FaviconID id, const favicon_base::FaviconRawBitmapCallback& callback) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); if (!tracker_.get()) tracker_.reset(new base::CancelableTaskTracker()); service_->GetLargestRawFaviconForID(id, callback, tracker_.get()); @@ -228,7 +228,7 @@ SQLiteCursor::JavaColumnType SQLiteCursor::GetColumnTypeInternal(int column) { } void SQLiteCursor::RunMoveStatementOnUIThread(int pos) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); if (!tracker_.get()) tracker_.reset(new base::CancelableTaskTracker()); service_->MoveStatement( diff --git a/chrome/browser/io_thread.cc b/chrome/browser/io_thread.cc index 056d9f0..9ba5e1c 100644 --- a/chrome/browser/io_thread.cc +++ b/chrome/browser/io_thread.cc @@ -151,7 +151,7 @@ const char kNetworkQualityEstimatorFieldTrialName[] = "NetworkQualityEstimator"; #if defined(OS_MACOSX) && !defined(OS_IOS) void ObserveKeychainEvents() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); net::CertDatabase::GetInstance()->SetMessageLoopForKeychainEvents(); } #endif @@ -382,7 +382,7 @@ SystemURLRequestContextGetter::SystemURLRequestContextGetter( SystemURLRequestContextGetter::~SystemURLRequestContextGetter() {} net::URLRequestContext* SystemURLRequestContextGetter::GetURLRequestContext() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); DCHECK(io_thread_->globals()->system_request_context.get()); return io_thread_->globals()->system_request_context.get(); @@ -499,12 +499,12 @@ IOThread::~IOThread() { } IOThread::Globals* IOThread::globals() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); return globals_; } void IOThread::SetGlobalsForTesting(Globals* globals) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); DCHECK(!globals || !globals_); globals_ = globals; } @@ -514,7 +514,7 @@ ChromeNetLog* IOThread::net_log() { } void IOThread::ChangedToOnTheRecord() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, @@ -523,7 +523,7 @@ void IOThread::ChangedToOnTheRecord() { } net::URLRequestContextGetter* IOThread::system_url_request_context_getter() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); if (!system_url_request_context_getter_.get()) { InitSystemRequestContext(); } @@ -536,7 +536,7 @@ void IOThread::Init() { tracked_objects::ScopedTracker tracking_profile1( FROM_HERE_WITH_EXPLICIT_FUNCTION("466432 IOThread::InitAsync::Start")); TRACE_EVENT0("startup", "IOThread::InitAsync"); - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); #if defined(USE_NSS_CERTS) || defined(OS_IOS) net::SetMessageLoopForNSSHttpIO(); @@ -969,7 +969,7 @@ net::HttpAuthHandlerFactory* IOThread::CreateDefaultAuthHandlerFactory( } void IOThread::ClearHostCache() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); net::HostCache* host_cache = globals_->host_resolver->GetHostCache(); if (host_cache) @@ -1056,7 +1056,7 @@ net::SSLConfigService* IOThread::GetSSLConfigService() { } void IOThread::ChangedToOnTheRecordOnIOThread() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); // Clear the host cache to avoid showing entries from the OTR session // in about:net-internals. @@ -1084,7 +1084,7 @@ void IOThread::InitSystemRequestContext() { } void IOThread::InitSystemRequestContextOnIOThread() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); DCHECK(!globals_->system_proxy_service.get()); DCHECK(system_proxy_config_service_.get()); diff --git a/chrome/browser/media/desktop_capture_access_handler.cc b/chrome/browser/media/desktop_capture_access_handler.cc index 25bfa5f..8487814 100644 --- a/chrome/browser/media/desktop_capture_access_handler.cc +++ b/chrome/browser/media/desktop_capture_access_handler.cc @@ -93,7 +93,7 @@ scoped_ptr<content::MediaStreamUI> GetDevicesForDesktopCapture( bool display_notification, const base::string16& application_title, const base::string16& registered_extension_name) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); scoped_ptr<content::MediaStreamUI> ui; // Add selected desktop source to the list. diff --git a/chrome/browser/media/permission_bubble_media_access_handler.cc b/chrome/browser/media/permission_bubble_media_access_handler.cc index 76034ed..b32c59b 100644 --- a/chrome/browser/media/permission_bubble_media_access_handler.cc +++ b/chrome/browser/media/permission_bubble_media_access_handler.cc @@ -78,7 +78,7 @@ void PermissionBubbleMediaAccessHandler::HandleRequest( const content::MediaStreamRequest& request, const content::MediaResponseCallback& callback, const extensions::Extension* extension) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); RequestsQueue& queue = pending_requests_[web_contents]; queue.push_back(PendingAccessRequest(request, callback)); @@ -90,7 +90,7 @@ void PermissionBubbleMediaAccessHandler::HandleRequest( void PermissionBubbleMediaAccessHandler::ProcessQueuedAccessRequest( content::WebContents* web_contents) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); std::map<content::WebContents*, RequestsQueue>::iterator it = pending_requests_.find(web_contents); @@ -159,7 +159,7 @@ void PermissionBubbleMediaAccessHandler::OnAccessRequestResponse( const content::MediaStreamDevices& devices, content::MediaStreamRequestResult result, scoped_ptr<content::MediaStreamUI> ui) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); std::map<content::WebContents*, RequestsQueue>::iterator it = pending_requests_.find(web_contents); diff --git a/chrome/browser/media/router/media_router_dialog_controller.cc b/chrome/browser/media/router/media_router_dialog_controller.cc index 033ebcf..9efe8b9 100644 --- a/chrome/browser/media/router/media_router_dialog_controller.cc +++ b/chrome/browser/media/router/media_router_dialog_controller.cc @@ -62,7 +62,7 @@ class MediaRouterDialogController::InitiatorWebContentsObserver MediaRouterDialogController::MediaRouterDialogController( content::WebContents* initiator) : initiator_(initiator) { - DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); DCHECK(initiator_); initiator_observer_.reset(new InitiatorWebContentsObserver(initiator_, this)); } diff --git a/chrome/browser/pepper_flash_settings_manager.cc b/chrome/browser/pepper_flash_settings_manager.cc index eb64b49..b40c86d 100644 --- a/chrome/browser/pepper_flash_settings_manager.cc +++ b/chrome/browser/pepper_flash_settings_manager.cc @@ -217,21 +217,21 @@ PepperFlashSettingsManager::Core::Core( browser_context_path_(browser_context->GetPath()), plugin_prefs_(PluginPrefs::GetForProfile( Profile::FromBrowserContext(browser_context))) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); } PepperFlashSettingsManager::Core::~Core() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); } void PepperFlashSettingsManager::Core::Initialize() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, base::Bind(&Core::InitializeOnIOThread, this)); } void PepperFlashSettingsManager::Core::Detach() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); // This call guarantees that one ref is retained until we get to the DETACHED // state. This is important. Otherwise, if the ref count drops to zero on the @@ -244,7 +244,7 @@ void PepperFlashSettingsManager::Core::Detach() { void PepperFlashSettingsManager::Core::DeauthorizeContentLicenses( uint32 request_id) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, @@ -255,7 +255,7 @@ void PepperFlashSettingsManager::Core::DeauthorizeContentLicenses( void PepperFlashSettingsManager::Core::GetPermissionSettings( uint32 request_id, PP_Flash_BrowserOperations_SettingType setting_type) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, @@ -268,7 +268,7 @@ void PepperFlashSettingsManager::Core::SetDefaultPermission( PP_Flash_BrowserOperations_SettingType setting_type, PP_Flash_BrowserOperations_Permission permission, bool clear_site_specific) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, @@ -280,7 +280,7 @@ void PepperFlashSettingsManager::Core::SetSitePermission( uint32 request_id, PP_Flash_BrowserOperations_SettingType setting_type, const ppapi::FlashSiteSettings& sites) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, @@ -289,7 +289,7 @@ void PepperFlashSettingsManager::Core::SetSitePermission( } void PepperFlashSettingsManager::Core::GetSitesWithData(uint32 request_id) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, @@ -300,7 +300,7 @@ void PepperFlashSettingsManager::Core::ClearSiteData(uint32 request_id, const std::string& site, uint64 flags, uint64 max_age) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, @@ -330,7 +330,7 @@ bool PepperFlashSettingsManager::Core::OnMessageReceived( } void PepperFlashSettingsManager::Core::OnChannelError() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); if (state_ == STATE_DETACHED) return; @@ -340,7 +340,7 @@ void PepperFlashSettingsManager::Core::OnChannelError() { void PepperFlashSettingsManager::Core::ConnectToChannel( bool success, const IPC::ChannelHandle& handle) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); if (state_ == STATE_DETACHED) return; @@ -397,7 +397,7 @@ void PepperFlashSettingsManager::Core::ConnectToChannel( } void PepperFlashSettingsManager::Core::InitializeOnIOThread() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); DCHECK_EQ(STATE_UNINITIALIZED, state_); content::WebPluginInfo plugin_info; @@ -423,7 +423,7 @@ void PepperFlashSettingsManager::Core::InitializeOnIOThread() { void PepperFlashSettingsManager::Core::DeauthorizeContentLicensesOnIOThread( uint32 request_id) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); DCHECK_NE(STATE_DETACHED, state_); if (state_ == STATE_UNINITIALIZED) { @@ -471,7 +471,7 @@ void PepperFlashSettingsManager::Core::DeauthorizeContentLicensesOnBlockingPool( void PepperFlashSettingsManager::Core::DeauthorizeContentLicensesInPlugin( uint32 request_id, bool success) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); if (!success) { NotifyErrorFromIOThread(); return; @@ -489,7 +489,7 @@ void PepperFlashSettingsManager::Core::DeauthorizeContentLicensesInPlugin( void PepperFlashSettingsManager::Core::GetPermissionSettingsOnIOThread( uint32 request_id, PP_Flash_BrowserOperations_SettingType setting_type) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); DCHECK_NE(STATE_DETACHED, state_); if (state_ == STATE_UNINITIALIZED) { @@ -523,7 +523,7 @@ void PepperFlashSettingsManager::Core::SetDefaultPermissionOnIOThread( PP_Flash_BrowserOperations_SettingType setting_type, PP_Flash_BrowserOperations_Permission permission, bool clear_site_specific) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); DCHECK_NE(STATE_DETACHED, state_); if (state_ == STATE_UNINITIALIZED) { @@ -558,7 +558,7 @@ void PepperFlashSettingsManager::Core::SetSitePermissionOnIOThread( uint32 request_id, PP_Flash_BrowserOperations_SettingType setting_type, const ppapi::FlashSiteSettings& sites) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); DCHECK_NE(STATE_DETACHED, state_); if (state_ == STATE_UNINITIALIZED) { @@ -589,7 +589,7 @@ void PepperFlashSettingsManager::Core::SetSitePermissionOnIOThread( void PepperFlashSettingsManager::Core::GetSitesWithDataOnIOThread( uint32 request_id) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); DCHECK_NE(STATE_DETACHED, state_); if (state_ == STATE_UNINITIALIZED) { @@ -621,7 +621,7 @@ void PepperFlashSettingsManager::Core::ClearSiteDataOnIOThread( const std::string& site, uint64 flags, uint64 max_age) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); DCHECK_NE(STATE_DETACHED, state_); if (state_ == STATE_UNINITIALIZED) { @@ -656,7 +656,7 @@ void PepperFlashSettingsManager::Core::DetachOnIOThread() { } void PepperFlashSettingsManager::Core::NotifyErrorFromIOThread() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); if (state_ == STATE_DETACHED) return; @@ -680,7 +680,7 @@ void PepperFlashSettingsManager::Core::NotifyDeauthorizeContentLicensesCompleted( uint32 request_id, bool success) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); if (manager_.get()) { manager_->client_->OnDeauthorizeContentLicensesCompleted( @@ -693,7 +693,7 @@ void PepperFlashSettingsManager::Core::NotifyGetPermissionSettingsCompleted( bool success, PP_Flash_BrowserOperations_Permission default_permission, const ppapi::FlashSiteSettings& sites) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); if (manager_.get()) { manager_->client_->OnGetPermissionSettingsCompleted( @@ -704,7 +704,7 @@ void PepperFlashSettingsManager::Core::NotifyGetPermissionSettingsCompleted( void PepperFlashSettingsManager::Core::NotifySetDefaultPermissionCompleted( uint32 request_id, bool success) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); if (manager_.get()) { manager_->client_->OnSetDefaultPermissionCompleted( @@ -715,7 +715,7 @@ void PepperFlashSettingsManager::Core::NotifySetDefaultPermissionCompleted( void PepperFlashSettingsManager::Core::NotifySetSitePermissionCompleted( uint32 request_id, bool success) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); if (manager_.get()) { manager_->client_->OnSetSitePermissionCompleted( @@ -726,7 +726,7 @@ void PepperFlashSettingsManager::Core::NotifySetSitePermissionCompleted( void PepperFlashSettingsManager::Core::NotifyGetSitesWithDataCompleted( uint32 request_id, const std::vector<std::string>& sites) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); if (manager_.get()) { manager_->client_->OnGetSitesWithDataCompleted( @@ -737,7 +737,7 @@ void PepperFlashSettingsManager::Core::NotifyGetSitesWithDataCompleted( void PepperFlashSettingsManager::Core::NotifyClearSiteDataCompleted( uint32 request_id, bool success) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); if (manager_.get()) manager_->client_->OnClearSiteDataCompleted(request_id, success); @@ -745,7 +745,7 @@ void PepperFlashSettingsManager::Core::NotifyClearSiteDataCompleted( void PepperFlashSettingsManager::Core::NotifyError( const std::vector<std::pair<uint32, RequestType> >& notifications) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); scoped_refptr<Core> protector(this); for (std::vector<std::pair<uint32, RequestType> >::const_iterator iter = @@ -792,7 +792,7 @@ void PepperFlashSettingsManager::Core::NotifyError( void PepperFlashSettingsManager::Core::OnDeauthorizeContentLicensesResult( uint32 request_id, bool success) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); if (state_ == STATE_DETACHED) return; @@ -817,7 +817,7 @@ void PepperFlashSettingsManager::Core::OnGetPermissionSettingsResult( bool success, PP_Flash_BrowserOperations_Permission default_permission, const ppapi::FlashSiteSettings& sites) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); if (state_ == STATE_DETACHED) return; @@ -840,7 +840,7 @@ void PepperFlashSettingsManager::Core::OnGetPermissionSettingsResult( void PepperFlashSettingsManager::Core::OnSetDefaultPermissionResult( uint32 request_id, bool success) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); if (state_ == STATE_DETACHED) return; @@ -863,7 +863,7 @@ void PepperFlashSettingsManager::Core::OnSetDefaultPermissionResult( void PepperFlashSettingsManager::Core::OnSetSitePermissionResult( uint32 request_id, bool success) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); if (state_ == STATE_DETACHED) return; @@ -886,7 +886,7 @@ void PepperFlashSettingsManager::Core::OnSetSitePermissionResult( void PepperFlashSettingsManager::Core::OnGetSitesWithDataResult( uint32 request_id, const std::vector<std::string>& sites) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); if (state_ == STATE_DETACHED) return; @@ -907,7 +907,7 @@ void PepperFlashSettingsManager::Core::OnGetSitesWithDataResult( void PepperFlashSettingsManager::Core::OnClearSiteDataResult( uint32 request_id, bool success) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); if (state_ == STATE_DETACHED) return; @@ -977,7 +977,7 @@ void PepperFlashSettingsManager::RegisterProfilePrefs( uint32 PepperFlashSettingsManager::DeauthorizeContentLicenses( PrefService* prefs) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); // Clear the device ID salt which has the effect of regenerating a device // ID. Since this happens synchronously (and on the UI thread), we don't have @@ -992,7 +992,7 @@ uint32 PepperFlashSettingsManager::DeauthorizeContentLicenses( uint32 PepperFlashSettingsManager::GetPermissionSettings( PP_Flash_BrowserOperations_SettingType setting_type) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); EnsureCoreExists(); uint32 id = GetNextRequestId(); @@ -1004,7 +1004,7 @@ uint32 PepperFlashSettingsManager::SetDefaultPermission( PP_Flash_BrowserOperations_SettingType setting_type, PP_Flash_BrowserOperations_Permission permission, bool clear_site_specific) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); EnsureCoreExists(); uint32 id = GetNextRequestId(); @@ -1016,7 +1016,7 @@ uint32 PepperFlashSettingsManager::SetDefaultPermission( uint32 PepperFlashSettingsManager::SetSitePermission( PP_Flash_BrowserOperations_SettingType setting_type, const ppapi::FlashSiteSettings& sites) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); EnsureCoreExists(); uint32 id = GetNextRequestId(); @@ -1025,7 +1025,7 @@ uint32 PepperFlashSettingsManager::SetSitePermission( } uint32 PepperFlashSettingsManager::GetSitesWithData() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); EnsureCoreExists(); uint32 id = GetNextRequestId(); @@ -1036,7 +1036,7 @@ uint32 PepperFlashSettingsManager::GetSitesWithData() { uint32 PepperFlashSettingsManager::ClearSiteData(const std::string& site, uint64 flags, uint64 max_age) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); EnsureCoreExists(); uint32 id = GetNextRequestId(); diff --git a/chrome/browser/permissions/permission_context_base.cc b/chrome/browser/permissions/permission_context_base.cc index 8933d1f..09747e1 100644 --- a/chrome/browser/permissions/permission_context_base.cc +++ b/chrome/browser/permissions/permission_context_base.cc @@ -96,7 +96,7 @@ void PermissionContextBase::DecidePermission( const GURL& embedding_origin, bool user_gesture, const BrowserPermissionCallback& callback) { - DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); if (!requesting_origin.is_valid() || !embedding_origin.is_valid()) { std::string type_name = @@ -215,7 +215,7 @@ void PermissionContextBase::NotifyPermissionSet( const BrowserPermissionCallback& callback, bool persist, ContentSetting content_setting) { - DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); if (persist) UpdateContentSetting(requesting_origin, embedding_origin, content_setting); diff --git a/chrome/browser/permissions/permission_queue_controller.cc b/chrome/browser/permissions/permission_queue_controller.cc index 3f62768..0cc6d40 100644 --- a/chrome/browser/permissions/permission_queue_controller.cc +++ b/chrome/browser/permissions/permission_queue_controller.cc @@ -169,7 +169,7 @@ void PermissionQueueController::CreateInfoBarRequest( const GURL& requesting_frame, const GURL& embedder, const PermissionDecidedCallback& callback) { - DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); if (requesting_frame.SchemeIs(content::kChromeUIScheme) || embedder.SchemeIs(content::kChromeUIScheme)) @@ -183,7 +183,7 @@ void PermissionQueueController::CreateInfoBarRequest( void PermissionQueueController::CancelInfoBarRequest( const PermissionRequestID& id) { - DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); for (PendingInfobarRequests::iterator i(pending_infobar_requests_.begin()); i != pending_infobar_requests_.end(); ++i) { @@ -205,7 +205,7 @@ void PermissionQueueController::OnPermissionSet( const GURL& embedder, bool update_content_setting, bool allowed) { - DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); // TODO(miguelg): move the permission persistence to // PermissionContextBase once all the types are moved there. diff --git a/chrome/browser/platform_util_chromeos.cc b/chrome/browser/platform_util_chromeos.cc index 8d463bf..077a044 100644 --- a/chrome/browser/platform_util_chromeos.cc +++ b/chrome/browser/platform_util_chromeos.cc @@ -77,7 +77,7 @@ void DisableShellOperationsForTesting() { } // namespace internal void ShowItemInFolder(Profile* profile, const base::FilePath& full_path) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); file_manager::util::ShowItemInFolder( profile, full_path, base::Bind(&ShowWarningOnOpenOperationResult, profile, full_path)); diff --git a/chrome/browser/platform_util_linux.cc b/chrome/browser/platform_util_linux.cc index 9938451..5fd8fbbb 100644 --- a/chrome/browser/platform_util_linux.cc +++ b/chrome/browser/platform_util_linux.cc @@ -80,7 +80,7 @@ void PlatformOpenVerifiedItem(const base::FilePath& path, OpenItemType type) { } // namespace internal void ShowItemInFolder(Profile* profile, const base::FilePath& full_path) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); // TODO(estade): It would be nice to be able to select the file in the file // manager, but that probably requires extending xdg-open. For now just show // the folder. @@ -88,7 +88,7 @@ void ShowItemInFolder(Profile* profile, const base::FilePath& full_path) { } void OpenExternal(Profile* profile, const GURL& url) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); if (url.SchemeIs("mailto")) XDGEmail(url.spec()); else diff --git a/chrome/browser/platform_util_win.cc b/chrome/browser/platform_util_win.cc index b26746c..4e2d9f2 100644 --- a/chrome/browser/platform_util_win.cc +++ b/chrome/browser/platform_util_win.cc @@ -43,7 +43,7 @@ namespace { // TODO(asanka): Move this to ui/base/win/shell.{h,cc} and invoke it from the // utility process. void ShowItemInFolderOnFileThread(const base::FilePath& full_path) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); + DCHECK_CURRENTLY_ON(BrowserThread::FILE); base::FilePath dir = full_path.DirName().AsEndingWithSeparator(); // ParseDisplayName will fail if the directory is "C:", it must be "C:\\". if (dir.empty()) @@ -227,7 +227,7 @@ void PlatformOpenVerifiedItem(const base::FilePath& path, OpenItemType type) { } // namespace internal void OpenExternal(Profile* profile, const GURL& url) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); if (chrome::GetActiveDesktop() == chrome::HOST_DESKTOP_TYPE_ASH && !url.SchemeIsHTTPOrHTTPS()) diff --git a/chrome/browser/process_singleton_posix.cc b/chrome/browser/process_singleton_posix.cc index 25e9eca..147b29f 100644 --- a/chrome/browser/process_singleton_posix.cc +++ b/chrome/browser/process_singleton_posix.cc @@ -479,7 +479,7 @@ class ProcessSingleton::LinuxWatcher ui_message_loop_(ui_message_loop), fd_(fd), bytes_read_(0) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); // Wait for reads. base::MessageLoopForIO::current()->WatchFileDescriptor( fd, true, base::MessageLoopForIO::WATCH_READ, &fd_reader_, this); @@ -503,7 +503,7 @@ class ProcessSingleton::LinuxWatcher private: void CleanupAndDeleteSelf() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); parent_->RemoveSocketReader(this); // We're deleted beyond this point. @@ -566,7 +566,7 @@ class ProcessSingleton::LinuxWatcher friend class base::DeleteHelper<ProcessSingleton::LinuxWatcher>; ~LinuxWatcher() override { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); STLDeleteElements(&readers_); base::MessageLoopForIO* ml = base::MessageLoopForIO::current(); @@ -591,7 +591,7 @@ class ProcessSingleton::LinuxWatcher }; void ProcessSingleton::LinuxWatcher::OnFileCanReadWithoutBlocking(int fd) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); // Accepting incoming client. sockaddr_un from; socklen_t from_len = sizeof(from); @@ -610,7 +610,7 @@ void ProcessSingleton::LinuxWatcher::OnFileCanReadWithoutBlocking(int fd) { } void ProcessSingleton::LinuxWatcher::StartListening(int socket) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); // Watch for client connections on this socket. base::MessageLoopForIO* ml = base::MessageLoopForIO::current(); ml->AddDestructionObserver(this); @@ -639,7 +639,7 @@ void ProcessSingleton::LinuxWatcher::HandleMessage( } void ProcessSingleton::LinuxWatcher::RemoveSocketReader(SocketReader* reader) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); DCHECK(reader); readers_.erase(reader); delete reader; @@ -651,7 +651,7 @@ void ProcessSingleton::LinuxWatcher::RemoveSocketReader(SocketReader* reader) { void ProcessSingleton::LinuxWatcher::SocketReader::OnFileCanReadWithoutBlocking( int fd) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); DCHECK_EQ(fd, fd_); while (bytes_read_ < sizeof(buf_)) { ssize_t rv = HANDLE_EINTR( diff --git a/chrome/browser/renderer_host/chrome_render_message_filter.cc b/chrome/browser/renderer_host/chrome_render_message_filter.cc index 861d06d..fb59e6a 100644 --- a/chrome/browser/renderer_host/chrome_render_message_filter.cc +++ b/chrome/browser/renderer_host/chrome_render_message_filter.cc @@ -171,7 +171,7 @@ void ChromeRenderMessageFilter::OnRequestFileSystemAccessSync( const GURL& origin_url, const GURL& top_origin_url, IPC::Message* reply_msg) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); base::Callback<void(bool)> callback = base::Bind(&ChromeRenderMessageFilter:: OnRequestFileSystemAccessSyncResponse, @@ -198,7 +198,7 @@ void ChromeRenderMessageFilter::FileSystemAccessedSyncOnUIThread( const GURL& url, bool blocked_by_policy, IPC::Message* reply_msg) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); extensions::WebViewPermissionHelper* web_view_permission_helper = extensions::WebViewPermissionHelper::FromFrameID( render_process_id, render_frame_id); @@ -216,7 +216,7 @@ void ChromeRenderMessageFilter::OnRequestFileSystemAccessAsync( int request_id, const GURL& origin_url, const GURL& top_origin_url) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); base::Callback<void(bool)> callback = base::Bind(&ChromeRenderMessageFilter:: OnRequestFileSystemAccessAsyncResponse, @@ -242,7 +242,7 @@ void ChromeRenderMessageFilter::OnRequestFileSystemAccess( const GURL& origin_url, const GURL& top_origin_url, base::Callback<void(bool)> callback) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); bool allowed = cookie_settings_->IsSettingCookieAllowed(origin_url, top_origin_url); @@ -283,7 +283,7 @@ void ChromeRenderMessageFilter::FileSystemAccessedOnUIThread( const GURL& url, bool allowed, base::Callback<void(bool)> callback) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); extensions::WebViewPermissionHelper* web_view_permission_helper = extensions::WebViewPermissionHelper::FromFrameID( render_process_id, render_frame_id); diff --git a/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc b/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc index 5ddf0e8..aa4705e 100644 --- a/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc +++ b/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc @@ -132,7 +132,7 @@ void NotifyDownloadInitiatedOnUI(int render_process_id, int render_view_id) { prerender::PrerenderManager* GetPrerenderManager(int render_process_id, int render_view_id) { - DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); content::WebContents* web_contents = tab_util::GetWebContentsByID(render_process_id, render_view_id); @@ -153,7 +153,7 @@ prerender::PrerenderManager* GetPrerenderManager(int render_process_id, void UpdatePrerenderNetworkBytesCallback(int render_process_id, int render_view_id, int64 bytes) { - DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); content::WebContents* web_contents = tab_util::GetWebContentsByID(render_process_id, render_view_id); @@ -178,7 +178,7 @@ void SendExecuteMimeTypeHandlerEvent(scoped_ptr<content::StreamInfo> stream, const std::string& extension_id, const std::string& view_id, bool embedded) { - DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); content::WebContents* web_contents = tab_util::GetWebContentsByFrameID(render_process_id, render_frame_id); @@ -296,7 +296,7 @@ bool ChromeResourceDispatcherHostDelegate::ShouldBeginRequest( const GURL& url, ResourceType resource_type, content::ResourceContext* resource_context) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); // Handle a PREFETCH resource type. If prefetch is disabled, squelch the // request. Otherwise, do a normal request to warm the cache. diff --git a/chrome/browser/renderer_host/data_reduction_proxy_resource_throttle_android.cc b/chrome/browser/renderer_host/data_reduction_proxy_resource_throttle_android.cc index 93d85f73..73cf837 100644 --- a/chrome/browser/renderer_host/data_reduction_proxy_resource_throttle_android.cc +++ b/chrome/browser/renderer_host/data_reduction_proxy_resource_throttle_android.cc @@ -114,7 +114,7 @@ void DataReductionProxyResourceThrottle::StartDisplayingBlockingPage( const base::WeakPtr<DataReductionProxyResourceThrottle>& throttle, scoped_refptr<SafeBrowsingUIManager> ui_manager, const SafeBrowsingUIManager::UnsafeResource& resource) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); content::RenderViewHost* rvh = content::RenderViewHost::FromID( resource.render_process_host_id, resource.render_view_id); diff --git a/chrome/browser/safe_browsing/client_side_detection_host.cc b/chrome/browser/safe_browsing/client_side_detection_host.cc index a796588..414c55b 100644 --- a/chrome/browser/safe_browsing/client_side_detection_host.cc +++ b/chrome/browser/safe_browsing/client_side_detection_host.cc @@ -356,7 +356,7 @@ void ClientSideDetectionHost::DidNavigateMainFrame( const content::FrameNavigateParams& params) { // TODO(noelutz): move this DCHECK to WebContents and fix all the unit tests // that don't call this method on the UI thread. - // DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + // DCHECK_CURRENTLY_ON(BrowserThread::UI); if (details.is_in_page) { // If the navigation is within the same page, the user isn't really // navigating away. We don't need to cancel a pending callback or diff --git a/chrome/browser/shell_integration.cc b/chrome/browser/shell_integration.cc index 4bf4d5b..2ac4b58 100644 --- a/chrome/browser/shell_integration.cc +++ b/chrome/browser/shell_integration.cc @@ -180,7 +180,7 @@ void ShellIntegration::DefaultWebClientWorker::StartSetAsDefault() { void ShellIntegration::DefaultWebClientWorker::ObserverDestroyed() { // Our associated view has gone away, so we shouldn't call back to it if // our worker thread returns after the view is dead. - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); observer_ = NULL; } @@ -188,7 +188,7 @@ void ShellIntegration::DefaultWebClientWorker::ObserverDestroyed() { // DefaultWebClientWorker, private: void ShellIntegration::DefaultWebClientWorker::ExecuteCheckIsDefault() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); + DCHECK_CURRENTLY_ON(BrowserThread::FILE); DefaultWebClientState state = CheckIsDefault(); BrowserThread::PostTask( BrowserThread::UI, FROM_HERE, @@ -198,7 +198,7 @@ void ShellIntegration::DefaultWebClientWorker::ExecuteCheckIsDefault() { void ShellIntegration::DefaultWebClientWorker::CompleteCheckIsDefault( DefaultWebClientState state) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); UpdateUI(state); // The worker has finished everything it needs to do, so free the observer // if we own it. @@ -210,7 +210,7 @@ void ShellIntegration::DefaultWebClientWorker::CompleteCheckIsDefault( void ShellIntegration::DefaultWebClientWorker::ExecuteSetAsDefault( bool interactive_permitted) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); + DCHECK_CURRENTLY_ON(BrowserThread::FILE); bool result = SetAsDefault(interactive_permitted); BrowserThread::PostTask( @@ -220,7 +220,7 @@ void ShellIntegration::DefaultWebClientWorker::ExecuteSetAsDefault( void ShellIntegration::DefaultWebClientWorker::CompleteSetAsDefault( bool succeeded) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); // First tell the observer what the SetAsDefault call has returned. if (observer_) observer_->OnSetAsDefaultConcluded(succeeded); diff --git a/chrome/browser/shell_integration_win.cc b/chrome/browser/shell_integration_win.cc index 27fc75a81..07f7b4b 100644 --- a/chrome/browser/shell_integration_win.cc +++ b/chrome/browser/shell_integration_win.cc @@ -134,7 +134,7 @@ base::string16 GetExpectedAppId(const base::CommandLine& command_line, void MigrateChromiumShortcutsCallback() { // This should run on the file thread. - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); + DCHECK_CURRENTLY_ON(BrowserThread::FILE); // Get full path of chrome. base::FilePath chrome_exe; diff --git a/chrome/browser/site_details.cc b/chrome/browser/site_details.cc index af38bc5..5d9fc07 100644 --- a/chrome/browser/site_details.cc +++ b/chrome/browser/site_details.cc @@ -23,7 +23,7 @@ SiteDetails::~SiteDetails() {} void SiteDetails::CollectSiteInfo(WebContents* contents, SiteData* site_data) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); content::BrowserContext* browser_context = contents->GetBrowserContext(); // Find the BrowsingInstance this WebContents belongs to by iterating over diff --git a/chrome/browser/sync/chrome_sync_client.cc b/chrome/browser/sync/chrome_sync_client.cc index 1fd2f0b..d94aa51 100644 --- a/chrome/browser/sync/chrome_sync_client.cc +++ b/chrome/browser/sync/chrome_sync_client.cc @@ -77,7 +77,7 @@ ChromeSyncClient::~ChromeSyncClient() { } void ChromeSyncClient::Initialize(sync_driver::SyncService* sync_service) { - DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); sync_service_ = sync_service; web_data_service_ = GetWebDataService(); password_store_ = GetPasswordStore(); @@ -86,41 +86,41 @@ void ChromeSyncClient::Initialize(sync_driver::SyncService* sync_service) { sync_driver::SyncService* ChromeSyncClient::GetSyncService() { // TODO(zea): bring back this DCHECK after Typed URLs are converted to // SyncableService. - // DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); + // DCHECK_CURRENTLY_ON(content::BrowserThread::UI); return sync_service_; } PrefService* ChromeSyncClient::GetPrefService() { - DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); return profile_->GetPrefs(); } bookmarks::BookmarkModel* ChromeSyncClient::GetBookmarkModel() { - DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); return BookmarkModelFactory::GetForProfile(profile_); } history::HistoryService* ChromeSyncClient::GetHistoryService() { - DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); return HistoryServiceFactory::GetForProfile( profile_, ServiceAccessType::EXPLICIT_ACCESS); } autofill::PersonalDataManager* ChromeSyncClient::GetPersonalDataManager() { - DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); return autofill::PersonalDataManagerFactory::GetForProfile(profile_); } scoped_refptr<password_manager::PasswordStore> ChromeSyncClient::GetPasswordStore() { - DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); return PasswordStoreFactory::GetForProfile( profile_, ServiceAccessType::EXPLICIT_ACCESS); } scoped_refptr<autofill::AutofillWebDataService> ChromeSyncClient::GetWebDataService() { - DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); return WebDataServiceFactory::GetAutofillWebDataForProfile( profile_, ServiceAccessType::EXPLICIT_ACCESS); } diff --git a/chrome/browser/sync/glue/browser_thread_model_worker.cc b/chrome/browser/sync/glue/browser_thread_model_worker.cc index 093d282..f3faa34 100644 --- a/chrome/browser/sync/glue/browser_thread_model_worker.cc +++ b/chrome/browser/sync/glue/browser_thread_model_worker.cc @@ -62,7 +62,7 @@ void BrowserThreadModelWorker::CallDoWorkAndSignalTask( const syncer::WorkCallback& work, WaitableEvent* done, syncer::SyncerError* error) { - DCHECK(BrowserThread::CurrentlyOn(thread_)); + DCHECK_CURRENTLY_ON(thread_); if (!IsStopped()) *error = work.Run(); done->Signal(); diff --git a/chrome/browser/sync_file_system/local/sync_file_system_backend.cc b/chrome/browser/sync_file_system/local/sync_file_system_backend.cc index 57ba116..b57995d 100644 --- a/chrome/browser/sync_file_system/local/sync_file_system_backend.cc +++ b/chrome/browser/sync_file_system/local/sync_file_system_backend.cc @@ -269,7 +269,7 @@ void SyncFileSystemBackend::InitializeSyncFileSystemService( const SyncStatusCallback& callback) { // Repost to switch from IO thread to UI thread. if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); // It is safe to pass Unretained(this) (see comments in OpenFileSystem()). BrowserThread::PostTask( BrowserThread::UI, FROM_HERE, @@ -299,7 +299,7 @@ void SyncFileSystemBackend::DidInitializeSyncFileSystemService( SyncStatusCode status) { // Repost to switch from UI thread to IO thread. if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); // It is safe to pass Unretained(this) since |context| owns it. BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, diff --git a/chrome/browser/task_manager/task_manager.cc b/chrome/browser/task_manager/task_manager.cc index 02d2549..b46c6f5 100644 --- a/chrome/browser/task_manager/task_manager.cc +++ b/chrome/browser/task_manager/task_manager.cc @@ -1250,7 +1250,7 @@ void TaskManagerModel::NotifyVideoMemoryUsageStats( void TaskManagerModel::NotifyBytesRead(const net::URLRequest& request, int64_t byte_count) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); if (!is_updating_byte_count_) return; @@ -1282,7 +1282,7 @@ void TaskManagerModel::NotifyBytesRead(const net::URLRequest& request, // This is called on the UI thread. void TaskManagerModel::NotifyDataReady() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); for (size_t i = 0; i < on_data_ready_callbacks_.size(); ++i) { if (!on_data_ready_callbacks_[i].is_null()) on_data_ready_callbacks_[i].Run(); @@ -1380,7 +1380,7 @@ void TaskManagerModel::BytesRead(BytesReadParam param) { void TaskManagerModel::MultipleBytesRead( const std::vector<BytesReadParam>* params) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); for (std::vector<BytesReadParam>::const_iterator it = params->begin(); it != params->end(); ++it) { BytesRead(*it); @@ -1388,7 +1388,7 @@ void TaskManagerModel::MultipleBytesRead( } void TaskManagerModel::NotifyMultipleBytesRead() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); DCHECK(!bytes_read_buffer_.empty()); std::vector<BytesReadParam>* bytes_read_buffer = @@ -1401,7 +1401,7 @@ void TaskManagerModel::NotifyMultipleBytesRead() { } void TaskManagerModel::SetUpdatingByteCount(bool is_updating) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); is_updating_byte_count_ = is_updating; } diff --git a/chrome/browser/upgrade_detector_impl.cc b/chrome/browser/upgrade_detector_impl.cc index cc22b51..9efdb74 100644 --- a/chrome/browser/upgrade_detector_impl.cc +++ b/chrome/browser/upgrade_detector_impl.cc @@ -98,7 +98,7 @@ bool IsUnstableChannel() { // this. On Windows, the file thread used to be required for registry access // but no anymore. But other platform may still need the file thread. // crbug.com/366647. - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); + DCHECK_CURRENTLY_ON(BrowserThread::FILE); version_info::Channel channel = chrome::GetChannel(); return channel == version_info::Channel::DEV || channel == version_info::Channel::CANARY; @@ -136,7 +136,7 @@ bool IsSystemInstall() { void DetectUpdatability(const base::Closure& callback_task, bool* is_unstable_channel, bool* is_auto_update_enabled) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); + DCHECK_CURRENTLY_ON(BrowserThread::FILE); // Don't try to turn on autoupdate when we failed previously. if (is_auto_update_enabled) { @@ -311,7 +311,7 @@ base::Version UpgradeDetectorImpl::GetCurrentlyInstalledVersion() { // be interrupted from the UI thread. void UpgradeDetectorImpl::DetectUpgradeTask( base::WeakPtr<UpgradeDetectorImpl> upgrade_detector) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); + DCHECK_CURRENTLY_ON(BrowserThread::FILE); Version critical_update; Version installed_version = @@ -439,7 +439,7 @@ void UpgradeDetectorImpl::OnExperimentChangesDetected(Severity severity) { } void UpgradeDetectorImpl::UpgradeDetected(UpgradeAvailable upgrade_available) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); set_upgrade_available(upgrade_available); // Stop the recurring timer (that is checking for changes). |