Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(510)

Unified Diff: webkit/glue/webdevtoolsagent_impl.cc

Issue 150220: DevTools: Set up utility context earlier (prevent from crash). (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/glue/webdevtoolsagent_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/webdevtoolsagent_impl.cc
===================================================================
--- webkit/glue/webdevtoolsagent_impl.cc (revision 19804)
+++ webkit/glue/webdevtoolsagent_impl.cc (working copy)
@@ -135,9 +135,18 @@
} else {
doc = NULL;
}
- debugger_agent_impl_->ResetUtilityContext(doc, &utility_context_);
if (doc) {
+ // Do not clear utility context when document is being cleared -
+ // there still can be pending messages from the client that require
+ // context to be processed.
+ debugger_agent_impl_->ResetUtilityContext(doc, &utility_context_);
InitDevToolsAgentHost();
+ if (!report_frame_navigate_url_.empty()) {
+ // This is a document from the first load, issue frame navigate
+ // scheduled in DidCommitLoadForFrame.
+ tools_agent_delegate_stub_->FrameNavigate(report_frame_navigate_url_);
+ report_frame_navigate_url_ = "";
+ }
}
dom_agent_impl_->SetDocument(doc);
}
@@ -155,9 +164,10 @@
GURL url = ds->hasUnreachableURL() ?
ds->unreachableURL() :
request.url();
- tools_agent_delegate_stub_->FrameNavigate(
- url.possibly_invalid_spec(),
- webview->GetMainFrame() == frame);
+ if (webview->GetMainFrame() == frame) {
+ // Schedule frame navigate event.
+ report_frame_navigate_url_ = url.possibly_invalid_spec();
+ }
InspectorController* ic = webview->page()->inspectorController();
// Unhide resources panel if necessary.
tools_agent_delegate_stub_->SetResourcesPanelEnabled(
« no previous file with comments | « webkit/glue/webdevtoolsagent_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698