diff options
author | mostynb <mostynb@opera.com> | 2015-03-16 15:13:40 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-03-16 22:15:02 +0000 |
commit | 042582e3d43600e5aa88feffd72ccf48fc2c047f (patch) | |
tree | 4bd0226738508d2ccb351f446e8cf33308ab3fa3 | |
parent | cbbe20f81b775fb77d545127e6f9771c08a12508 (diff) | |
download | chromium_src-042582e3d43600e5aa88feffd72ccf48fc2c047f.zip chromium_src-042582e3d43600e5aa88feffd72ccf48fc2c047f.tar.gz chromium_src-042582e3d43600e5aa88feffd72ccf48fc2c047f.tar.bz2 |
favor DCHECK_CURRENTLY_ON for better logs in content/browser/[q-z]*
BUG=466848
Review URL: https://codereview.chromium.org/1005683003
Cr-Commit-Position: refs/heads/master@{#320804}
33 files changed, 161 insertions, 161 deletions
diff --git a/content/browser/renderer_data_memoizing_store.h b/content/browser/renderer_data_memoizing_store.h index 7ff15fa..035f70b 100644 --- a/content/browser/renderer_data_memoizing_store.h +++ b/content/browser/renderer_data_memoizing_store.h @@ -126,7 +126,7 @@ class RendererDataMemoizingStore : public RenderProcessHostObserver { }; void StartObservingProcess(int process_id) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); RenderProcessHost* host = RenderProcessHost::FromID(process_id); if (!host) { // We lost the race to observe the host before it was destroyed. Since @@ -154,7 +154,7 @@ class RendererDataMemoizingStore : public RenderProcessHostObserver { } void RenderProcessHostDestroyed(RenderProcessHost* host) override { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); RemoveRenderProcessItems(host->GetID()); } diff --git a/content/browser/renderer_host/media/audio_input_renderer_host.cc b/content/browser/renderer_host/media/audio_input_renderer_host.cc index 7b421ba..5777463 100644 --- a/content/browser/renderer_host/media/audio_input_renderer_host.cc +++ b/content/browser/renderer_host/media/audio_input_renderer_host.cc @@ -84,7 +84,7 @@ AudioInputRendererHost::AudioInputRendererHost( media::AudioLogFactory::AUDIO_INPUT_CONTROLLER)) {} AudioInputRendererHost::~AudioInputRendererHost() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); DCHECK(audio_entries_.empty()); } diff --git a/content/browser/renderer_host/media/media_stream_ui_proxy.cc b/content/browser/renderer_host/media/media_stream_ui_proxy.cc index 84fb852..bcb3575 100644 --- a/content/browser/renderer_host/media/media_stream_ui_proxy.cc +++ b/content/browser/renderer_host/media/media_stream_ui_proxy.cc @@ -15,7 +15,7 @@ namespace content { void SetAndCheckAncestorFlag(MediaStreamRequest* request) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); RenderFrameHostImpl* rfh = RenderFrameHostImpl::FromID(request->render_process_id, request->render_frame_id); diff --git a/content/browser/renderer_host/media/peer_connection_tracker_host.cc b/content/browser/renderer_host/media/peer_connection_tracker_host.cc index cae185d..e3acceb 100644 --- a/content/browser/renderer_host/media/peer_connection_tracker_host.cc +++ b/content/browser/renderer_host/media/peer_connection_tracker_host.cc @@ -42,7 +42,7 @@ PeerConnectionTrackerHost::~PeerConnectionTrackerHost() { } void PeerConnectionTrackerHost::OnChannelConnected(int32 peer_pid) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); // Add PowerMonitor when connected to channel rather than in constructor due // to thread safety concerns. Observers of PowerMonitor must be added and // removed on the same thread. BrowserMessageFilter is created on the UI @@ -56,7 +56,7 @@ void PeerConnectionTrackerHost::OnChannelConnected(int32 peer_pid) { } void PeerConnectionTrackerHost::OnChannelClosing() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); base::PowerMonitor* power_monitor = base::PowerMonitor::Get(); if (power_monitor) power_monitor->RemoveObserver(this); @@ -112,7 +112,7 @@ void PeerConnectionTrackerHost::OnSuspend() { } void PeerConnectionTrackerHost::SendOnSuspendOnUIThread() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); content::RenderProcessHost* host = content::RenderProcessHost::FromID(render_process_id_); if (host) diff --git a/content/browser/renderer_host/p2p/socket_dispatcher_host.cc b/content/browser/renderer_host/p2p/socket_dispatcher_host.cc index 2e3afbd..913adf7 100644 --- a/content/browser/renderer_host/p2p/socket_dispatcher_host.cc +++ b/content/browser/renderer_host/p2p/socket_dispatcher_host.cc @@ -158,7 +158,7 @@ void P2PSocketDispatcherHost::StartRtpDump( bool incoming, bool outgoing, const RenderProcessHost::WebRtcRtpPacketCallback& packet_callback) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); if ((!dump_incoming_rtp_packet_ && incoming) || (!dump_outgoing_rtp_packet_ && outgoing)) { @@ -176,7 +176,7 @@ void P2PSocketDispatcherHost::StartRtpDump( void P2PSocketDispatcherHost::StopRtpDumpOnUIThread(bool incoming, bool outgoing) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, diff --git a/content/browser/renderer_host/p2p/socket_host.cc b/content/browser/renderer_host/p2p/socket_host.cc index bc54d400..f2e76c3 100644 --- a/content/browser/renderer_host/p2p/socket_host.cc +++ b/content/browser/renderer_host/p2p/socket_host.cc @@ -578,7 +578,7 @@ void P2PSocketHost::StartRtpDump( bool incoming, bool outgoing, const RenderProcessHost::WebRtcRtpPacketCallback& packet_callback) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); DCHECK(!packet_callback.is_null()); DCHECK(incoming || outgoing); @@ -594,7 +594,7 @@ void P2PSocketHost::StartRtpDump( } void P2PSocketHost::StopRtpDump(bool incoming, bool outgoing) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); DCHECK(incoming || outgoing); if (incoming) { @@ -652,7 +652,7 @@ void P2PSocketHost::DumpRtpPacketOnIOThread(scoped_ptr<uint8[]> packet_header, size_t header_length, size_t packet_length, bool incoming) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); if ((incoming && !dump_incoming_rtp_packet_) || (!incoming && !dump_outgoing_rtp_packet_) || diff --git a/content/browser/resource_context_impl.cc b/content/browser/resource_context_impl.cc index d481206..b99c80d 100644 --- a/content/browser/resource_context_impl.cc +++ b/content/browser/resource_context_impl.cc @@ -69,21 +69,21 @@ void ResourceContext::CreateKeygenHandler( ChromeBlobStorageContext* GetChromeBlobStorageContextForResourceContext( const ResourceContext* resource_context) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); return UserDataAdapter<ChromeBlobStorageContext>::Get( resource_context, kBlobStorageContextKeyName); } StreamContext* GetStreamContextForResourceContext( const ResourceContext* resource_context) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); return UserDataAdapter<StreamContext>::Get( resource_context, kStreamContextKeyName); } URLDataManagerBackend* GetURLDataManagerForResourceContext( ResourceContext* context) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); if (!context->GetUserData(kURLDataManagerBackendKeyName)) { context->SetUserData(kURLDataManagerBackendKeyName, new URLDataManagerBackend()); diff --git a/content/browser/service_worker/embedded_worker_instance.cc b/content/browser/service_worker/embedded_worker_instance.cc index cad7f99..03895d0 100644 --- a/content/browser/service_worker/embedded_worker_instance.cc +++ b/content/browser/service_worker/embedded_worker_instance.cc @@ -36,19 +36,19 @@ struct SecondGreater { void NotifyWorkerReadyForInspectionOnUI(int worker_process_id, int worker_route_id) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); ServiceWorkerDevToolsManager::GetInstance()->WorkerReadyForInspection( worker_process_id, worker_route_id); } void NotifyWorkerDestroyedOnUI(int worker_process_id, int worker_route_id) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); ServiceWorkerDevToolsManager::GetInstance()->WorkerDestroyed( worker_process_id, worker_route_id); } void NotifyWorkerStopIgnoredOnUI(int worker_process_id, int worker_route_id) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); ServiceWorkerDevToolsManager::GetInstance()->WorkerStopIgnored( worker_process_id, worker_route_id); } @@ -61,7 +61,7 @@ void RegisterToWorkerDevToolsManagerOnUI( const GURL& url, const base::Callback<void(int worker_devtools_agent_route_id, bool wait_for_debugger)>& callback) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); int worker_devtools_agent_route_id = MSG_ROUTING_NONE; bool wait_for_debugger = false; if (RenderProcessHost* rph = RenderProcessHost::FromID(process_id)) { diff --git a/content/browser/service_worker/service_worker_browsertest.cc b/content/browser/service_worker/service_worker_browsertest.cc index 69f5173..e8c2e69 100644 --- a/content/browser/service_worker/service_worker_browsertest.cc +++ b/content/browser/service_worker/service_worker_browsertest.cc @@ -227,7 +227,7 @@ class LongLivedResourceInterceptor : public net::URLRequestInterceptor { void CreateLongLivedResourceInterceptors( const GURL& worker_url, const GURL& import_url) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); scoped_ptr<net::URLRequestInterceptor> interceptor; interceptor.reset(new LongLivedResourceInterceptor( diff --git a/content/browser/service_worker/service_worker_internals_ui.cc b/content/browser/service_worker/service_worker_internals_ui.cc index 4a3d0fe..2e35ccb 100644 --- a/content/browser/service_worker/service_worker_internals_ui.cc +++ b/content/browser/service_worker/service_worker_internals_ui.cc @@ -47,7 +47,7 @@ void OperationCompleteCallback(WeakPtr<ServiceWorkerInternalsUI> internals, base::Bind(OperationCompleteCallback, internals, callback_id, status)); return; } - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); if (internals) { internals->web_ui()->CallJavascriptFunction( "serviceworker.onOperationComplete", @@ -72,7 +72,7 @@ void CallServiceWorkerVersionMethodWithVersionID( callback)); return; } - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); scoped_refptr<ServiceWorkerVersion> version = context->context()->GetLiveVersion(version_id); if (!version.get()) { @@ -96,7 +96,7 @@ void DispatchPushEventWithVersionID( callback)); return; } - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); scoped_refptr<ServiceWorkerVersion> version = context->context()->GetLiveVersion(version_id); if (!version.get()) { @@ -118,7 +118,7 @@ void UnregisterWithScope( base::Bind(UnregisterWithScope, context, scope, callback)); return; } - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); context->context()->UnregisterServiceWorker(scope, callback); } @@ -132,7 +132,7 @@ void StartActiveWorker( const ServiceWorkerInternalsUI::StatusCallback& callback, ServiceWorkerStatusCode status, const scoped_refptr<ServiceWorkerRegistration>& registration) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); if (status == SERVICE_WORKER_OK) { // Pass the reference of |registration| to WorkerStarted callback to prevent // it from being deleted while starting the worker. If the refcount of @@ -155,7 +155,7 @@ void FindRegistrationForPattern( base::Bind(FindRegistrationForPattern, context, scope, callback)); return; } - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); context->context()->storage()->FindRegistrationForPattern(scope, callback); } @@ -253,7 +253,7 @@ void GetRegistrationsOnIOThread( scoped_refptr<ServiceWorkerContextWrapper> context, base::Callback<void(const std::vector<ServiceWorkerRegistrationInfo>&)> callback) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); context->context()->storage()->GetAllRegistrations(callback); } @@ -264,7 +264,7 @@ void OnStoredRegistrations( const std::vector<ServiceWorkerRegistrationInfo>&)> callback, const std::vector<ServiceWorkerRegistrationInfo>& stored_registrations) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); BrowserThread::PostTask( BrowserThread::UI, FROM_HERE, @@ -281,7 +281,7 @@ void OnAllRegistrations( const std::vector<ServiceWorkerRegistrationInfo>& live_registrations, const std::vector<ServiceWorkerVersionInfo>& live_versions, const std::vector<ServiceWorkerRegistrationInfo>& stored_registrations) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); if (!internals) return; @@ -305,13 +305,13 @@ class ServiceWorkerInternalsUI::PartitionObserver ~PartitionObserver() override {} // ServiceWorkerContextObserver overrides: void OnRunningStateChanged(int64 version_id) override { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); web_ui_->CallJavascriptFunction( "serviceworker.onRunningStateChanged", FundamentalValue(partition_id_), StringValue(base::Int64ToString(version_id))); } void OnVersionStateChanged(int64 version_id) override { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); web_ui_->CallJavascriptFunction( "serviceworker.onVersionStateChanged", FundamentalValue(partition_id_), @@ -321,7 +321,7 @@ class ServiceWorkerInternalsUI::PartitionObserver int process_id, int thread_id, const ErrorInfo& info) override { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); ScopedVector<const Value> args; args.push_back(new FundamentalValue(partition_id_)); args.push_back(new StringValue(base::Int64ToString(version_id))); @@ -340,7 +340,7 @@ class ServiceWorkerInternalsUI::PartitionObserver int process_id, int thread_id, const ConsoleMessage& message) override { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); ScopedVector<const Value> args; args.push_back(new FundamentalValue(partition_id_)); args.push_back(new StringValue(base::Int64ToString(version_id))); @@ -358,7 +358,7 @@ class ServiceWorkerInternalsUI::PartitionObserver } void OnRegistrationStored(int64 registration_id, const GURL& pattern) override { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); web_ui_->CallJavascriptFunction("serviceworker.onRegistrationStored", StringValue(pattern.spec())); } @@ -460,7 +460,7 @@ void ServiceWorkerInternalsUI::SetOption(const ListValue* args) { } void ServiceWorkerInternalsUI::GetAllRegistrations(const ListValue* args) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); BrowserContext* browser_context = web_ui()->GetWebContents()->GetBrowserContext(); // Safe to use base::Unretained(this) because @@ -548,7 +548,7 @@ bool ServiceWorkerInternalsUI::GetServiceWorkerContext( void ServiceWorkerInternalsUI::CallServiceWorkerVersionMethod( ServiceWorkerVersionMethod method, const ListValue* args) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); int callback_id; const DictionaryValue* cmd_args = NULL; int partition_id; @@ -572,7 +572,7 @@ void ServiceWorkerInternalsUI::CallServiceWorkerVersionMethod( void ServiceWorkerInternalsUI::DispatchPushEvent( const ListValue* args) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); int callback_id; int partition_id; int64 version_id = 0; @@ -594,7 +594,7 @@ void ServiceWorkerInternalsUI::DispatchPushEvent( } void ServiceWorkerInternalsUI::InspectWorker(const ListValue* args) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); int callback_id; const DictionaryValue* cmd_args = NULL; int process_id = 0; @@ -620,7 +620,7 @@ void ServiceWorkerInternalsUI::InspectWorker(const ListValue* args) { } void ServiceWorkerInternalsUI::Unregister(const ListValue* args) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); int callback_id; int partition_id; std::string scope_string; @@ -640,7 +640,7 @@ void ServiceWorkerInternalsUI::Unregister(const ListValue* args) { } void ServiceWorkerInternalsUI::StartWorker(const ListValue* args) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); int callback_id; int partition_id; std::string scope_string; diff --git a/content/browser/service_worker/service_worker_registration.cc b/content/browser/service_worker/service_worker_registration.cc index eba1997..f436f95 100644 --- a/content/browser/service_worker/service_worker_registration.cc +++ b/content/browser/service_worker/service_worker_registration.cc @@ -34,13 +34,13 @@ ServiceWorkerRegistration::ServiceWorkerRegistration( should_activate_when_ready_(false), resources_total_size_bytes_(0), context_(context) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); DCHECK(context_); context_->AddLiveRegistration(this); } ServiceWorkerRegistration::~ServiceWorkerRegistration() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); DCHECK(!listeners_.might_have_observers()); if (context_) context_->RemoveLiveRegistration(registration_id_); @@ -73,7 +73,7 @@ void ServiceWorkerRegistration::NotifyUpdateFound() { } ServiceWorkerRegistrationInfo ServiceWorkerRegistration::GetInfo() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); return ServiceWorkerRegistrationInfo( pattern(), registration_id_, diff --git a/content/browser/service_worker/service_worker_version.cc b/content/browser/service_worker/service_worker_version.cc index 113ed1c..0682c5a 100644 --- a/content/browser/service_worker/service_worker_version.cc +++ b/content/browser/service_worker/service_worker_version.cc @@ -370,7 +370,7 @@ void ServiceWorkerVersion::RegisterStatusChangeCallback( } ServiceWorkerVersionInfo ServiceWorkerVersion::GetInfo() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); return ServiceWorkerVersionInfo( running_status(), status(), script_url(), registration_id(), version_id(), embedded_worker()->process_id(), embedded_worker()->thread_id(), diff --git a/content/browser/shared_worker/shared_worker_host.cc b/content/browser/shared_worker/shared_worker_host.cc index 8500a79..d9b6d9f 100644 --- a/content/browser/shared_worker/shared_worker_host.cc +++ b/content/browser/shared_worker/shared_worker_host.cc @@ -72,11 +72,11 @@ SharedWorkerHost::SharedWorkerHost(SharedWorkerInstance* instance, closed_(false), creation_time_(base::TimeTicks::Now()), weak_factory_(this) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); } SharedWorkerHost::~SharedWorkerHost() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); UMA_HISTOGRAM_LONG_TIMES("SharedWorker.TimeToDeleted", base::TimeTicks::Now() - creation_time_); // If we crashed, tell the RenderViewHosts. diff --git a/content/browser/shared_worker/shared_worker_message_filter.cc b/content/browser/shared_worker/shared_worker_message_filter.cc index 20e2526..9f75967 100644 --- a/content/browser/shared_worker/shared_worker_message_filter.cc +++ b/content/browser/shared_worker/shared_worker_message_filter.cc @@ -32,7 +32,7 @@ SharedWorkerMessageFilter::SharedWorkerMessageFilter( } SharedWorkerMessageFilter::~SharedWorkerMessageFilter() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); } void SharedWorkerMessageFilter::OnChannelClosing() { diff --git a/content/browser/shared_worker/shared_worker_service_impl.cc b/content/browser/shared_worker/shared_worker_service_impl.cc index fa19ebe..0f6958b 100644 --- a/content/browser/shared_worker/shared_worker_service_impl.cc +++ b/content/browser/shared_worker/shared_worker_service_impl.cc @@ -190,7 +190,7 @@ class SharedWorkerServiceImpl::SharedWorkerReserver void TryReserve(const base::Callback<void(bool)>& success_cb, const base::Closure& failure_cb, bool (*try_increment_worker_ref_count)(int)) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); if (!try_increment_worker_ref_count(worker_process_id_)) { BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, failure_cb); return; @@ -220,7 +220,7 @@ bool (*SharedWorkerServiceImpl::s_try_increment_worker_ref_count_)(int) = TryIncrementWorkerRefCount; SharedWorkerServiceImpl* SharedWorkerServiceImpl::GetInstance() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); return Singleton<SharedWorkerServiceImpl>::get(); } @@ -269,12 +269,12 @@ std::vector<WorkerService::WorkerInfo> SharedWorkerServiceImpl::GetWorkers() { } void SharedWorkerServiceImpl::AddObserver(WorkerServiceObserver* observer) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); observers_.AddObserver(observer); } void SharedWorkerServiceImpl::RemoveObserver(WorkerServiceObserver* observer) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); observers_.RemoveObserver(observer); } @@ -285,7 +285,7 @@ void SharedWorkerServiceImpl::CreateWorker( ResourceContext* resource_context, const WorkerStoragePartitionId& partition_id, bool* url_mismatch) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); *url_mismatch = false; scoped_ptr<SharedWorkerInstance> instance( new SharedWorkerInstance(params.url, @@ -468,7 +468,7 @@ void SharedWorkerServiceImpl::NotifyWorkerDestroyed(int worker_process_id, void SharedWorkerServiceImpl::ReserveRenderProcessToCreateWorker( scoped_ptr<SharedWorkerPendingInstance> pending_instance, bool* url_mismatch) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); DCHECK(!FindPendingInstance(*pending_instance->instance())); if (url_mismatch) *url_mismatch = false; @@ -529,7 +529,7 @@ void SharedWorkerServiceImpl::RenderProcessReservedCallback( int worker_route_id, bool is_new_worker, bool pause_on_start) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); // To offset the TryIncrementWorkerRefCount called for the reservation, // calls DecrementWorkerRefCount after CheckWorkerDependency in // ScopeWorkerDependencyChecker's destructor. diff --git a/content/browser/speech/speech_recognition_manager_impl.cc b/content/browser/speech/speech_recognition_manager_impl.cc index 8a4d1b4..f02c29f 100644 --- a/content/browser/speech/speech_recognition_manager_impl.cc +++ b/content/browser/speech/speech_recognition_manager_impl.cc @@ -39,7 +39,7 @@ namespace { SpeechRecognitionManagerImpl* g_speech_recognition_manager_impl; void ShowAudioInputSettingsOnFileThread(media::AudioManager* audio_manager) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); + DCHECK_CURRENTLY_ON(BrowserThread::FILE); audio_manager->ShowAudioInputSettings(); } @@ -91,7 +91,7 @@ SpeechRecognitionManagerImpl::~SpeechRecognitionManagerImpl() { int SpeechRecognitionManagerImpl::CreateSession( const SpeechRecognitionSessionConfig& config) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); const int session_id = GetNextSessionID(); DCHECK(!SessionExists(session_id)); @@ -160,7 +160,7 @@ int SpeechRecognitionManagerImpl::CreateSession( } void SpeechRecognitionManagerImpl::StartSession(int session_id) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); if (!SessionExists(session_id)) return; @@ -184,7 +184,7 @@ void SpeechRecognitionManagerImpl::StartSession(int session_id) { void SpeechRecognitionManagerImpl::RecognitionAllowedCallback(int session_id, bool ask_user, bool is_allowed) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); if (!SessionExists(session_id)) return; @@ -232,7 +232,7 @@ void SpeechRecognitionManagerImpl::MediaRequestPermissionCallback( int session_id, const MediaStreamDevices& devices, scoped_ptr<MediaStreamUIProxy> stream_ui) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); SessionsTable::iterator iter = sessions_.find(session_id); if (iter == sessions_.end()) @@ -255,7 +255,7 @@ void SpeechRecognitionManagerImpl::MediaRequestPermissionCallback( } void SpeechRecognitionManagerImpl::AbortSession(int session_id) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); if (!SessionExists(session_id)) return; @@ -276,7 +276,7 @@ void SpeechRecognitionManagerImpl::AbortSession(int session_id) { } void SpeechRecognitionManagerImpl::StopAudioCaptureForSession(int session_id) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); if (!SessionExists(session_id)) return; @@ -297,7 +297,7 @@ void SpeechRecognitionManagerImpl::StopAudioCaptureForSession(int session_id) { // (if any). void SpeechRecognitionManagerImpl::OnRecognitionStart(int session_id) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); if (!SessionExists(session_id)) return; @@ -316,7 +316,7 @@ void SpeechRecognitionManagerImpl::OnRecognitionStart(int session_id) { } void SpeechRecognitionManagerImpl::OnAudioStart(int session_id) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); if (!SessionExists(session_id)) return; @@ -329,7 +329,7 @@ void SpeechRecognitionManagerImpl::OnAudioStart(int session_id) { void SpeechRecognitionManagerImpl::OnEnvironmentEstimationComplete( int session_id) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); if (!SessionExists(session_id)) return; @@ -341,7 +341,7 @@ void SpeechRecognitionManagerImpl::OnEnvironmentEstimationComplete( } void SpeechRecognitionManagerImpl::OnSoundStart(int session_id) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); if (!SessionExists(session_id)) return; @@ -353,7 +353,7 @@ void SpeechRecognitionManagerImpl::OnSoundStart(int session_id) { } void SpeechRecognitionManagerImpl::OnSoundEnd(int session_id) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); if (!SessionExists(session_id)) return; @@ -364,7 +364,7 @@ void SpeechRecognitionManagerImpl::OnSoundEnd(int session_id) { } void SpeechRecognitionManagerImpl::OnAudioEnd(int session_id) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); if (!SessionExists(session_id)) return; @@ -382,7 +382,7 @@ void SpeechRecognitionManagerImpl::OnAudioEnd(int session_id) { void SpeechRecognitionManagerImpl::OnRecognitionResults( int session_id, const SpeechRecognitionResults& results) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); if (!SessionExists(session_id)) return; @@ -394,7 +394,7 @@ void SpeechRecognitionManagerImpl::OnRecognitionResults( void SpeechRecognitionManagerImpl::OnRecognitionError( int session_id, const SpeechRecognitionError& error) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); if (!SessionExists(session_id)) return; @@ -406,7 +406,7 @@ void SpeechRecognitionManagerImpl::OnRecognitionError( void SpeechRecognitionManagerImpl::OnAudioLevelsChange( int session_id, float volume, float noise_volume) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); if (!SessionExists(session_id)) return; @@ -417,7 +417,7 @@ void SpeechRecognitionManagerImpl::OnAudioLevelsChange( } void SpeechRecognitionManagerImpl::OnRecognitionEnd(int session_id) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); if (!SessionExists(session_id)) return; @@ -435,7 +435,7 @@ void SpeechRecognitionManagerImpl::OnRecognitionEnd(int session_id) { int SpeechRecognitionManagerImpl::GetSession( int render_process_id, int render_view_id, int request_id) const { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); SessionsTable::const_iterator iter; for (iter = sessions_.begin(); iter != sessions_.end(); ++iter) { const int session_id = iter->first; @@ -459,7 +459,7 @@ void SpeechRecognitionManagerImpl::AbortAllSessionsForRenderProcess( // This method gracefully destroys sessions for the listener. However, since // the listener itself is likely to be destroyed after this call, we avoid // dispatching further events to it, marking the |listener_is_active| flag. - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); for (SessionsTable::iterator it = sessions_.begin(); it != sessions_.end(); ++it) { Session* session = it->second; @@ -473,7 +473,7 @@ void SpeechRecognitionManagerImpl::AbortAllSessionsForRenderProcess( void SpeechRecognitionManagerImpl::AbortAllSessionsForRenderView( int render_process_id, int render_view_id) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); for (SessionsTable::iterator it = sessions_.begin(); it != sessions_.end(); ++it) { Session* session = it->second; @@ -487,7 +487,7 @@ void SpeechRecognitionManagerImpl::AbortAllSessionsForRenderView( // ----------------------- Core FSM implementation --------------------------- void SpeechRecognitionManagerImpl::DispatchEvent(int session_id, FSMEvent event) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); // There are some corner cases in which the session might be deleted (due to // an EndRecognition event) between a request (e.g. Abort) and its dispatch. @@ -651,7 +651,7 @@ bool SpeechRecognitionManagerImpl::SessionExists(int session_id) const { SpeechRecognitionManagerImpl::Session* SpeechRecognitionManagerImpl::GetSession(int session_id) const { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); SessionsTable::const_iterator iter = sessions_.find(session_id); DCHECK(iter != sessions_.end()); return iter->second; diff --git a/content/browser/speech/speech_recognizer_impl.cc b/content/browser/speech/speech_recognizer_impl.cc index 94876ac..7b1d53f 100644 --- a/content/browser/speech/speech_recognizer_impl.cc +++ b/content/browser/speech/speech_recognizer_impl.cc @@ -231,12 +231,12 @@ void SpeechRecognizerImpl::StopAudioCapture() { bool SpeechRecognizerImpl::IsActive() const { // Checking the FSM state from another thread (thus, while the FSM is // potentially concurrently evolving) is meaningless. - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); return state_ != STATE_IDLE && state_ != STATE_ENDED; } bool SpeechRecognizerImpl::IsCapturingAudio() const { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); // See IsActive(). + DCHECK_CURRENTLY_ON(BrowserThread::IO); // See IsActive(). const bool is_capturing_audio = state_ >= STATE_STARTING && state_ <= STATE_RECOGNIZING; DCHECK((is_capturing_audio && (audio_controller_.get() != NULL)) || @@ -250,7 +250,7 @@ SpeechRecognizerImpl::recognition_engine() const { } SpeechRecognizerImpl::~SpeechRecognizerImpl() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); endpointer_.EndSession(); if (audio_controller_.get()) { audio_controller_->Close( @@ -312,7 +312,7 @@ void SpeechRecognizerImpl::OnSpeechRecognitionEngineError( // does, but they will become flaky if TestAudioInputController will be fixed. void SpeechRecognizerImpl::DispatchEvent(const FSMEventArgs& event_args) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); DCHECK_LE(event_args.event, EVENT_MAX_VALUE); DCHECK_LE(state_, STATE_MAX_VALUE); diff --git a/content/browser/speech/speech_recognizer_impl_android.cc b/content/browser/speech/speech_recognizer_impl_android.cc index 2e8c57e..0a43def 100644 --- a/content/browser/speech/speech_recognizer_impl_android.cc +++ b/content/browser/speech/speech_recognizer_impl_android.cc @@ -37,7 +37,7 @@ SpeechRecognizerImplAndroid::~SpeechRecognizerImplAndroid() { } void SpeechRecognizerImplAndroid::StartRecognition( const std::string& device_id) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); // TODO(xians): Open the correct device for speech on Android. BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, base::Bind( &SpeechRecognitionEventListener::OnRecognitionStart, @@ -52,7 +52,7 @@ void SpeechRecognizerImplAndroid::StartRecognition( void SpeechRecognizerImplAndroid::StartRecognitionOnUIThread( std::string language, bool continuous, bool interim_results) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); JNIEnv* env = AttachCurrentThread(); j_recognition_.Reset(Java_SpeechRecognition_createSpeechRecognition(env, GetApplicationContext(), reinterpret_cast<intptr_t>(this))); @@ -68,7 +68,7 @@ void SpeechRecognizerImplAndroid::AbortRecognition() { &content::SpeechRecognizerImplAndroid::AbortRecognition, this)); return; } - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); JNIEnv* env = AttachCurrentThread(); if (!j_recognition_.is_null()) Java_SpeechRecognition_abortRecognition(env, j_recognition_.obj()); @@ -80,19 +80,19 @@ void SpeechRecognizerImplAndroid::StopAudioCapture() { &content::SpeechRecognizerImplAndroid::StopAudioCapture, this)); return; } - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); JNIEnv* env = AttachCurrentThread(); if (!j_recognition_.is_null()) Java_SpeechRecognition_stopRecognition(env, j_recognition_.obj()); } bool SpeechRecognizerImplAndroid::IsActive() const { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); return state_ != STATE_IDLE; } bool SpeechRecognizerImplAndroid::IsCapturingAudio() const { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); return state_ == STATE_CAPTURING_AUDIO; } @@ -103,7 +103,7 @@ void SpeechRecognizerImplAndroid::OnAudioStart(JNIEnv* env, jobject obj) { static_cast<JNIEnv*>(NULL), static_cast<jobject>(NULL))); return; } - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); state_ = STATE_CAPTURING_AUDIO; listener()->OnAudioStart(session_id()); } @@ -115,7 +115,7 @@ void SpeechRecognizerImplAndroid::OnSoundStart(JNIEnv* env, jobject obj) { static_cast<JNIEnv*>(NULL), static_cast<jobject>(NULL))); return; } - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); listener()->OnSoundStart(session_id()); } @@ -126,7 +126,7 @@ void SpeechRecognizerImplAndroid::OnSoundEnd(JNIEnv* env, jobject obj) { static_cast<JNIEnv*>(NULL), static_cast<jobject>(NULL))); return; } - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); listener()->OnSoundEnd(session_id()); } @@ -137,7 +137,7 @@ void SpeechRecognizerImplAndroid::OnAudioEnd(JNIEnv* env, jobject obj) { static_cast<JNIEnv*>(NULL), static_cast<jobject>(NULL))); return; } - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); if (state_ == STATE_CAPTURING_AUDIO) state_ = STATE_AWAITING_FINAL_RESULT; listener()->OnAudioEnd(session_id()); @@ -145,7 +145,7 @@ void SpeechRecognizerImplAndroid::OnAudioEnd(JNIEnv* env, jobject obj) { void SpeechRecognizerImplAndroid::OnRecognitionResults(JNIEnv* env, jobject obj, jobjectArray strings, jfloatArray floats, jboolean provisional) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); std::vector<base::string16> options; AppendJavaStringArrayToStringVector(env, strings, &options); std::vector<float> scores(options.size(), 0.0); @@ -167,7 +167,7 @@ void SpeechRecognizerImplAndroid::OnRecognitionResults(JNIEnv* env, jobject obj, void SpeechRecognizerImplAndroid::OnRecognitionResultsOnIOThread( SpeechRecognitionResults const &results) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); listener()->OnRecognitionResults(session_id(), results); } @@ -179,7 +179,7 @@ void SpeechRecognizerImplAndroid::OnRecognitionError(JNIEnv* env, static_cast<JNIEnv*>(NULL), static_cast<jobject>(NULL), error)); return; } - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); SpeechRecognitionErrorCode code = static_cast<SpeechRecognitionErrorCode>(error); listener()->OnRecognitionError(session_id(), SpeechRecognitionError(code)); @@ -193,7 +193,7 @@ void SpeechRecognizerImplAndroid::OnRecognitionEnd(JNIEnv* env, static_cast<JNIEnv*>(NULL), static_cast<jobject>(NULL))); return; } - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); state_ = STATE_IDLE; listener()->OnRecognitionEnd(session_id()); } diff --git a/content/browser/ssl/ssl_error_handler.cc b/content/browser/ssl/ssl_error_handler.cc index f8deb75..45b6dfd 100644 --- a/content/browser/ssl/ssl_error_handler.cc +++ b/content/browser/ssl/ssl_error_handler.cc @@ -56,7 +56,7 @@ SSLCertErrorHandler* SSLErrorHandler::AsSSLCertErrorHandler() { } void SSLErrorHandler::Dispatch() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); WebContents* web_contents = NULL; RenderFrameHost* render_frame_host = @@ -78,7 +78,7 @@ void SSLErrorHandler::Dispatch() { } void SSLErrorHandler::CancelRequest() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); // We need to complete this task on the IO thread. BrowserThread::PostTask( @@ -88,7 +88,7 @@ void SSLErrorHandler::CancelRequest() { } void SSLErrorHandler::DenyRequest() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); // We need to complete this task on the IO thread. BrowserThread::PostTask( @@ -99,7 +99,7 @@ void SSLErrorHandler::DenyRequest() { } void SSLErrorHandler::ContinueRequest() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); // We need to complete this task on the IO thread. BrowserThread::PostTask( @@ -108,7 +108,7 @@ void SSLErrorHandler::ContinueRequest() { } void SSLErrorHandler::TakeNoAction() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); // We need to complete this task on the IO thread. BrowserThread::PostTask( @@ -117,7 +117,7 @@ void SSLErrorHandler::TakeNoAction() { } void SSLErrorHandler::CompleteCancelRequest(int error) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); // It is important that we notify the net::URLRequest only once. If we try // to notify the request twice, it may no longer exist and |this| might have @@ -139,7 +139,7 @@ void SSLErrorHandler::CompleteCancelRequest(int error) { } void SSLErrorHandler::CompleteContinueRequest() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); // It is important that we notify the net::URLRequest only once. If we try to // notify the request twice, it may no longer exist and |this| might have @@ -157,7 +157,7 @@ void SSLErrorHandler::CompleteContinueRequest() { } void SSLErrorHandler::CompleteTakeNoAction() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); // It is important that we notify the net::URLRequest only once. If we try to // notify the request twice, it may no longer exist and |this| might have diff --git a/content/browser/storage_partition_impl.cc b/content/browser/storage_partition_impl.cc index 4bce3ab..a454405 100644 --- a/content/browser/storage_partition_impl.cc +++ b/content/browser/storage_partition_impl.cc @@ -50,7 +50,7 @@ void ClearCookiesOnIOThread( const base::Time end, const GURL& storage_origin, const base::Closure& callback) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); net::CookieStore* cookie_store = rq_context-> GetURLRequestContext()->cookie_store(); if (storage_origin.is_empty()) { @@ -68,7 +68,7 @@ void ClearCookiesOnIOThread( void CheckQuotaManagedDataDeletionStatus(size_t* deletion_task_count, const base::Closure& callback) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); if (*deletion_task_count == 0) { delete deletion_task_count; callback.Run(); @@ -80,7 +80,7 @@ void OnQuotaManagedOriginDeleted(const GURL& origin, size_t* deletion_task_count, const base::Closure& callback, storage::QuotaStatusCode status) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); DCHECK_GT(*deletion_task_count, 0u); if (status != storage::kQuotaStatusOk) { DLOG(ERROR) << "Couldn't remove data of type " << type << " for origin " @@ -105,7 +105,7 @@ void ClearShaderCacheOnIOThread(const base::FilePath& path, const base::Time begin, const base::Time end, const base::Closure& callback) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); ShaderCacheFactory::GetInstance()->ClearByPath( path, begin, end, base::Bind(&ClearedShaderCache, callback)); } @@ -118,7 +118,7 @@ void OnLocalStorageUsageInfo( const base::Time delete_end, const base::Closure& callback, const std::vector<LocalStorageUsageInfo>& infos) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); for (size_t i = 0; i < infos.size(); ++i) { if (!origin_matcher.is_null() && @@ -140,7 +140,7 @@ void OnSessionStorageUsageInfo( const StoragePartition::OriginMatcherFunction& origin_matcher, const base::Closure& callback, const std::vector<SessionStorageUsageInfo>& infos) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); for (size_t i = 0; i < infos.size(); ++i) { if (!origin_matcher.is_null() && @@ -161,7 +161,7 @@ void ClearLocalStorageOnUIThread( const base::Time begin, const base::Time end, const base::Closure& callback) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); if (!storage_origin.is_empty()) { bool can_delete = origin_matcher.is_null() || @@ -185,7 +185,7 @@ void ClearSessionStorageOnUIThread( const scoped_refptr<storage::SpecialStoragePolicy>& special_storage_policy, const StoragePartition::OriginMatcherFunction& origin_matcher, const base::Closure& callback) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); dom_storage_context->GetSessionStorageUsage( base::Bind(&OnSessionStorageUsageInfo, dom_storage_context, @@ -348,7 +348,7 @@ void StoragePartitionImpl::DataDeletionHelper::ClearQuotaManagedDataOnIOThread( const scoped_refptr<storage::SpecialStoragePolicy>& special_storage_policy, const StoragePartition::OriginMatcherFunction& origin_matcher, const base::Closure& callback) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); StoragePartitionImpl::QuotaManagedDataDeletionHelper* helper = new StoragePartitionImpl::QuotaManagedDataDeletionHelper( @@ -582,7 +582,7 @@ void StoragePartitionImpl::ClearDataImpl( const base::Time begin, const base::Time end, const base::Closure& callback) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); DataDeletionHelper* helper = new DataDeletionHelper(remove_mask, quota_storage_remove_mask, callback); @@ -602,13 +602,13 @@ void StoragePartitionImpl::ClearDataImpl( void StoragePartitionImpl:: QuotaManagedDataDeletionHelper::IncrementTaskCountOnIO() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); ++task_count; } void StoragePartitionImpl:: QuotaManagedDataDeletionHelper::DecrementTaskCountOnIO() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); DCHECK_GT(task_count, 0); --task_count; if (task_count) @@ -686,7 +686,7 @@ StoragePartitionImpl::QuotaManagedDataDeletionHelper::ClearOriginsOnIOThread( // The QuotaManager manages all storage other than cookies, LocalStorage, // and SessionStorage. This loop wipes out most HTML5 storage for the given // origins. - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); if (!origins.size()) { callback.Run(); return; @@ -719,7 +719,7 @@ StoragePartitionImpl::QuotaManagedDataDeletionHelper::ClearOriginsOnIOThread( } void StoragePartitionImpl::DataDeletionHelper::IncrementTaskCountOnUI() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); ++task_count; } @@ -836,7 +836,7 @@ void StoragePartitionImpl::ClearDataForOrigin( const GURL& storage_origin, net::URLRequestContextGetter* request_context_getter, const base::Closure& callback) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); ClearDataImpl(remove_mask, quota_storage_remove_mask, storage_origin, diff --git a/content/browser/streams/stream_context.cc b/content/browser/streams/stream_context.cc index 357e68c..e338396 100644 --- a/content/browser/streams/stream_context.cc +++ b/content/browser/streams/stream_context.cc @@ -36,7 +36,7 @@ StreamContext* StreamContext::GetFor(BrowserContext* context) { } void StreamContext::InitializeOnIOThread() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); registry_.reset(new StreamRegistry()); } diff --git a/content/browser/tcmalloc_internals_request_job.cc b/content/browser/tcmalloc_internals_request_job.cc index 58e78af..85ec2ed 100644 --- a/content/browser/tcmalloc_internals_request_job.cc +++ b/content/browser/tcmalloc_internals_request_job.cc @@ -33,13 +33,13 @@ void AboutTcmallocOutputs::OnStatsForChildProcess( void AboutTcmallocOutputs::SetOutput(const std::string& header, const std::string& output) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); outputs_[header] = output; } void AboutTcmallocOutputs::DumpToHTMLTable(std::string* data) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); data->append("<table width=\"100%\">\n"); for (AboutTcmallocOutputsType::const_iterator oit = outputs_.begin(); diff --git a/content/browser/theme_helper_mac.mm b/content/browser/theme_helper_mac.mm index af3b428..3103a5c 100644 --- a/content/browser/theme_helper_mac.mm +++ b/content/browser/theme_helper_mac.mm @@ -135,7 +135,7 @@ void ThemeHelperMac::Observe(int type, const NotificationDetails& details) { DCHECK_EQ(NOTIFICATION_RENDERER_PROCESS_CREATED, type); - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults]; [defaults synchronize]; diff --git a/content/browser/time_zone_monitor.cc b/content/browser/time_zone_monitor.cc index 0c17f8e..f61280b 100644 --- a/content/browser/time_zone_monitor.cc +++ b/content/browser/time_zone_monitor.cc @@ -11,15 +11,15 @@ namespace content { TimeZoneMonitor::TimeZoneMonitor() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); } TimeZoneMonitor::~TimeZoneMonitor() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); } void TimeZoneMonitor::NotifyRenderers() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); for (RenderProcessHost::iterator iterator = RenderProcessHost::AllHostsIterator(); !iterator.IsAtEnd(); diff --git a/content/browser/time_zone_monitor_linux.cc b/content/browser/time_zone_monitor_linux.cc index 0836d5b..dd0a26f 100644 --- a/content/browser/time_zone_monitor_linux.cc +++ b/content/browser/time_zone_monitor_linux.cc @@ -51,7 +51,7 @@ class TimeZoneMonitorLinuxImpl : base::RefCountedThreadSafe<TimeZoneMonitorLinuxImpl>(), file_path_watchers_(), owner_(owner) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); BrowserThread::PostTask( BrowserThread::FILE, FROM_HERE, @@ -59,7 +59,7 @@ class TimeZoneMonitorLinuxImpl } void StopWatching() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); owner_ = NULL; BrowserThread::PostTask( BrowserThread::FILE, @@ -76,7 +76,7 @@ class TimeZoneMonitorLinuxImpl } void StartWatchingOnFileThread() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); + DCHECK_CURRENTLY_ON(BrowserThread::FILE); // There is no true standard for where time zone information is actually // stored. glibc uses /etc/localtime, uClibc uses /etc/TZ, and some older @@ -101,12 +101,12 @@ class TimeZoneMonitorLinuxImpl } void StopWatchingOnFileThread() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); + DCHECK_CURRENTLY_ON(BrowserThread::FILE); STLDeleteElements(&file_path_watchers_); } void OnTimeZoneFileChanged(const base::FilePath& path, bool error) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); + DCHECK_CURRENTLY_ON(BrowserThread::FILE); BrowserThread::PostTask( BrowserThread::UI, FROM_HERE, @@ -115,7 +115,7 @@ class TimeZoneMonitorLinuxImpl } void OnTimeZoneFileChangedOnUIThread() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); if (owner_) { owner_->NotifyRenderersFromImpl(); } diff --git a/content/browser/tracing/trace_message_filter.cc b/content/browser/tracing/trace_message_filter.cc index e1dbdeb..223fbd6 100644 --- a/content/browser/tracing/trace_message_filter.cc +++ b/content/browser/tracing/trace_message_filter.cc @@ -59,14 +59,14 @@ bool TraceMessageFilter::OnMessageReceived(const IPC::Message& message) { void TraceMessageFilter::SendBeginTracing( const base::trace_event::CategoryFilter& category_filter, const base::trace_event::TraceOptions& options) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); Send(new TracingMsg_BeginTracing(category_filter.ToString(), base::TimeTicks::NowFromSystemTraceTime(), options.ToString())); } void TraceMessageFilter::SendEndTracing() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK(!is_awaiting_end_ack_); is_awaiting_end_ack_ = true; Send(new TracingMsg_EndTracing); @@ -75,26 +75,26 @@ void TraceMessageFilter::SendEndTracing() { void TraceMessageFilter::SendEnableMonitoring( const base::trace_event::CategoryFilter& category_filter, const base::trace_event::TraceOptions& options) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); Send(new TracingMsg_EnableMonitoring(category_filter.ToString(), base::TimeTicks::NowFromSystemTraceTime(), options.ToString())); } void TraceMessageFilter::SendDisableMonitoring() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); Send(new TracingMsg_DisableMonitoring); } void TraceMessageFilter::SendCaptureMonitoringSnapshot() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK(!is_awaiting_capture_monitoring_snapshot_ack_); is_awaiting_capture_monitoring_snapshot_ack_ = true; Send(new TracingMsg_CaptureMonitoringSnapshot); } void TraceMessageFilter::SendGetTraceLogStatus() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK(!is_awaiting_buffer_percent_full_ack_); is_awaiting_buffer_percent_full_ack_ = true; Send(new TracingMsg_GetTraceLogStatus); diff --git a/content/browser/tracing/tracing_controller_impl.cc b/content/browser/tracing/tracing_controller_impl.cc index afff073..480481f 100644 --- a/content/browser/tracing/tracing_controller_impl.cc +++ b/content/browser/tracing/tracing_controller_impl.cc @@ -188,7 +188,7 @@ TracingControllerImpl* TracingControllerImpl::GetInstance() { bool TracingControllerImpl::GetCategories( const GetCategoriesDoneCallback& callback) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); // Known categories come back from child processes with the EndTracingAck // message. So to get known categories, just begin and end tracing immediately @@ -210,7 +210,7 @@ void TracingControllerImpl::SetEnabledOnFileThread( int mode, const TraceOptions& trace_options, const base::Closure& callback) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); + DCHECK_CURRENTLY_ON(BrowserThread::FILE); TraceLog::GetInstance()->SetEnabled( category_filter, static_cast<TraceLog::Mode>(mode), trace_options); @@ -219,7 +219,7 @@ void TracingControllerImpl::SetEnabledOnFileThread( void TracingControllerImpl::SetDisabledOnFileThread( const base::Closure& callback) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); + DCHECK_CURRENTLY_ON(BrowserThread::FILE); TraceLog::GetInstance()->SetDisabled(); BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, callback); @@ -229,7 +229,7 @@ bool TracingControllerImpl::EnableRecording( const CategoryFilter& category_filter, const TraceOptions& trace_options, const EnableRecordingDoneCallback& callback) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); if (!can_enable_recording()) return false; @@ -274,7 +274,7 @@ void TracingControllerImpl::OnEnableRecordingDone( const CategoryFilter& category_filter, const TraceOptions& trace_options, const EnableRecordingDoneCallback& callback) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); // Notify all child processes. for (TraceMessageFilterSet::iterator it = trace_message_filters_.begin(); @@ -288,7 +288,7 @@ void TracingControllerImpl::OnEnableRecordingDone( bool TracingControllerImpl::DisableRecording( const scoped_refptr<TraceDataSink>& trace_data_sink) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); if (!can_disable_recording()) return false; @@ -307,7 +307,7 @@ bool TracingControllerImpl::DisableRecording( } void TracingControllerImpl::OnDisableRecordingDone() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); #if defined(OS_ANDROID) if (pending_get_categories_done_callback_.is_null()) @@ -363,7 +363,7 @@ bool TracingControllerImpl::EnableMonitoring( const CategoryFilter& category_filter, const TraceOptions& trace_options, const EnableMonitoringDoneCallback& callback) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); if (!can_enable_monitoring()) return false; @@ -393,7 +393,7 @@ void TracingControllerImpl::OnEnableMonitoringDone( const CategoryFilter& category_filter, const TraceOptions& trace_options, const EnableMonitoringDoneCallback& callback) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); // Notify all child processes. for (TraceMessageFilterSet::iterator it = trace_message_filters_.begin(); @@ -407,7 +407,7 @@ void TracingControllerImpl::OnEnableMonitoringDone( bool TracingControllerImpl::DisableMonitoring( const DisableMonitoringDoneCallback& callback) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); if (!can_disable_monitoring()) return false; @@ -437,7 +437,7 @@ TracingController::CreateFileSink(const base::FilePath& file_path, void TracingControllerImpl::OnDisableMonitoringDone( const DisableMonitoringDoneCallback& callback) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); OnMonitoringStateChanged(false); @@ -461,7 +461,7 @@ void TracingControllerImpl::GetMonitoringStatus( bool TracingControllerImpl::CaptureMonitoringSnapshot( const scoped_refptr<TraceDataSink>& monitoring_data_sink) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); if (!can_disable_monitoring()) return false; @@ -502,7 +502,7 @@ bool TracingControllerImpl::CaptureMonitoringSnapshot( bool TracingControllerImpl::GetTraceBufferUsage( const GetTraceBufferUsageCallback& callback) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); if (!can_get_trace_buffer_usage() || callback.is_null()) return false; @@ -538,7 +538,7 @@ bool TracingControllerImpl::SetWatchEvent( const std::string& category_name, const std::string& event_name, const WatchEventCallback& callback) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); if (callback.is_null()) return false; @@ -560,7 +560,7 @@ bool TracingControllerImpl::SetWatchEvent( } bool TracingControllerImpl::CancelWatchEvent() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); if (!can_cancel_watch_event()) return false; @@ -706,7 +706,7 @@ void TracingControllerImpl::OnDisableRecordingAcked( #if defined(OS_CHROMEOS) || defined(OS_WIN) void TracingControllerImpl::OnEndSystemTracingAcked( const scoped_refptr<base::RefCountedString>& events_str_ptr) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); if (trace_data_sink_.get()) { #if defined(OS_WIN) diff --git a/content/browser/utility_process_host_impl.cc b/content/browser/utility_process_host_impl.cc index 576d510..df1eb13 100644 --- a/content/browser/utility_process_host_impl.cc +++ b/content/browser/utility_process_host_impl.cc @@ -110,7 +110,7 @@ UtilityProcessHostImpl::UtilityProcessHostImpl( } UtilityProcessHostImpl::~UtilityProcessHostImpl() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); if (is_batch_mode_) EndBatchMode(); diff --git a/content/browser/web_contents/web_contents_android.cc b/content/browser/web_contents/web_contents_android.cc index 372a45f..ef10c9e 100644 --- a/content/browser/web_contents/web_contents_android.cc +++ b/content/browser/web_contents/web_contents_android.cc @@ -60,7 +60,7 @@ namespace content { // static WebContents* WebContents::FromJavaWebContents( jobject jweb_contents_android) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); if (!jweb_contents_android) return NULL; diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc index 1f75388..9b4875c 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc @@ -4462,7 +4462,7 @@ bool WebContentsImpl::CreateRenderFrameForRenderManager( base::android::ScopedJavaLocalRef<jobject> WebContentsImpl::GetJavaWebContents() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); return GetWebContentsAndroid()->GetJavaObject(); } diff --git a/content/browser/webui/url_data_manager.cc b/content/browser/webui/url_data_manager.cc index 74fa0a6..ffd992e 100644 --- a/content/browser/webui/url_data_manager.cc +++ b/content/browser/webui/url_data_manager.cc @@ -39,7 +39,7 @@ URLDataManager* GetFromBrowserContext(BrowserContext* context) { static void AddDataSourceOnIOThread( ResourceContext* resource_context, scoped_refptr<URLDataSourceImpl> data_source) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); GetURLDataManagerForResourceContext(resource_context)->AddDataSource( data_source.get()); } @@ -57,7 +57,7 @@ URLDataManager::~URLDataManager() { } void URLDataManager::AddDataSource(URLDataSourceImpl* source) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, base::Bind(&AddDataSourceOnIOThread, @@ -67,7 +67,7 @@ void URLDataManager::AddDataSource(URLDataSourceImpl* source) { // static void URLDataManager::DeleteDataSources() { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); URLDataSources sources; { base::AutoLock lock(g_delete_lock.Get()); diff --git a/content/browser/webui/url_data_manager_backend.cc b/content/browser/webui/url_data_manager_backend.cc index d79a617..2b2a666 100644 --- a/content/browser/webui/url_data_manager_backend.cc +++ b/content/browser/webui/url_data_manager_backend.cc @@ -440,7 +440,7 @@ namespace { void GetMimeTypeOnUI(URLDataSourceImpl* source, const std::string& path, const base::WeakPtr<URLRequestChromeJob>& job) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK_CURRENTLY_ON(BrowserThread::UI); std::string mime_type = source->source()->GetMimeType(path); BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, @@ -556,7 +556,7 @@ URLDataManagerBackend::CreateProtocolHandler( void URLDataManagerBackend::AddDataSource( URLDataSourceImpl* source) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); DataSourceMap::iterator i = data_sources_.find(source->source_name()); if (i != data_sources_.end()) { if (!source->source()->ShouldReplaceExistingSource()) diff --git a/content/browser/webui/url_data_source_impl.cc b/content/browser/webui/url_data_source_impl.cc index 31e45ad..10b88ec 100644 --- a/content/browser/webui/url_data_source_impl.cc +++ b/content/browser/webui/url_data_source_impl.cc @@ -51,7 +51,7 @@ void URLDataSourceImpl::SendResponse( void URLDataSourceImpl::SendResponseOnIOThread( int request_id, scoped_refptr<base::RefCountedMemory> bytes) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + DCHECK_CURRENTLY_ON(BrowserThread::IO); if (backend_) backend_->DataAvailable(request_id, bytes.get()); } |