diff options
author | dgozman <dgozman@chromium.org> | 2015-05-18 02:39:12 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-05-18 09:39:22 +0000 |
commit | ab3324deb7e3601929558d7f7fa003f6399c7fcf (patch) | |
tree | 982937c3faf378bada408c90262ce9c1dbdfcef9 /components | |
parent | b2da245aa3a437766d78a2c8eb26b9f819809efd (diff) | |
download | chromium_src-ab3324deb7e3601929558d7f7fa003f6399c7fcf.zip chromium_src-ab3324deb7e3601929558d7f7fa003f6399c7fcf.tar.gz chromium_src-ab3324deb7e3601929558d7f7fa003f6399c7fcf.tar.bz2 |
[DevTools] DCHECK that DevToolsAgentHostClientImpl is operated on UI.
This is to ensure that threading is not the cause of http handler crashes.
BUG=none
TBR=pfeldman@chromium.org
Review URL: https://codereview.chromium.org/1138323003
Cr-Commit-Position: refs/heads/master@{#330340}
Diffstat (limited to 'components')
-rw-r--r-- | components/devtools_http_handler/devtools_http_handler.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/components/devtools_http_handler/devtools_http_handler.cc b/components/devtools_http_handler/devtools_http_handler.cc index 67c061c..babaa6f 100644 --- a/components/devtools_http_handler/devtools_http_handler.cc +++ b/components/devtools_http_handler/devtools_http_handler.cc @@ -268,16 +268,19 @@ class DevToolsAgentHostClientImpl : public DevToolsAgentHostClient { server_wrapper_(server_wrapper), connection_id_(connection_id), agent_host_(agent_host) { + DCHECK_CURRENTLY_ON(BrowserThread::UI); agent_host_->AttachClient(this); } ~DevToolsAgentHostClientImpl() override { + DCHECK_CURRENTLY_ON(BrowserThread::UI); if (agent_host_.get()) agent_host_->DetachClient(); } void AgentHostClosed(DevToolsAgentHost* agent_host, bool replaced_with_another_client) override { + DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK(agent_host == agent_host_.get()); std::string message = base::StringPrintf( @@ -297,6 +300,7 @@ class DevToolsAgentHostClientImpl : public DevToolsAgentHostClient { void DispatchProtocolMessage(DevToolsAgentHost* agent_host, const std::string& message) override { + DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK(agent_host == agent_host_.get()); message_loop_->PostTask( FROM_HERE, @@ -307,6 +311,7 @@ class DevToolsAgentHostClientImpl : public DevToolsAgentHostClient { } void OnMessage(const std::string& message) { + DCHECK_CURRENTLY_ON(BrowserThread::UI); if (agent_host_.get()) agent_host_->DispatchProtocolMessage(message); } |