diff options
author | pfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-26 11:12:53 +0000 |
---|---|---|
committer | pfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-26 11:12:53 +0000 |
commit | 63a5c2a2b231a3dca148360d3acf3b6903de0363 (patch) | |
tree | db4f8905b686de879f422c4c42704c5a4ee016b5 /chrome/renderer/devtools_agent.cc | |
parent | 5fcb32a48c26bbced1dc5989a7196dab39b7d675 (diff) | |
download | chromium_src-63a5c2a2b231a3dca148360d3acf3b6903de0363.zip chromium_src-63a5c2a2b231a3dca148360d3acf3b6903de0363.tar.gz chromium_src-63a5c2a2b231a3dca148360d3acf3b6903de0363.tar.bz2 |
Make DevTools client survive 'refresh' of the inspectable tab.
Review URL: http://codereview.chromium.org/54002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12541 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/devtools_agent.cc')
-rw-r--r-- | chrome/renderer/devtools_agent.cc | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/chrome/renderer/devtools_agent.cc b/chrome/renderer/devtools_agent.cc index 4d52fca1..1a60ed5 100644 --- a/chrome/renderer/devtools_agent.cc +++ b/chrome/renderer/devtools_agent.cc @@ -177,11 +177,26 @@ void DevToolsAgent::OnRpcMessage(const std::string& raw_msg) { } void DevToolsAgent::OnInspectElement(int x, int y) { - WebDevToolsAgent* web_agent = view_->webview()->GetWebDevToolsAgent(); - web_agent->InspectElement(x, y); + view_loop_->PostTask(FROM_HERE, NewRunnableMethod( + this, &DevToolsAgent::InspectElement, x, y)); } void DevToolsAgent::DispatchRpcMessage(const std::string& raw_msg) { - WebDevToolsAgent* web_agent = view_->webview()->GetWebDevToolsAgent(); + if (!view_) + return; + WebView* web_view = view_->webview(); + if (!web_view) + return; + WebDevToolsAgent* web_agent = web_view->GetWebDevToolsAgent(); web_agent->DispatchMessageFromClient(raw_msg); } + +void DevToolsAgent::InspectElement(int x, int y) { + if (!view_) + return; + WebView* web_view = view_->webview(); + if (!web_view) + return; + WebDevToolsAgent* web_agent = web_view->GetWebDevToolsAgent(); + web_agent->InspectElement(x, y); +} |