summaryrefslogtreecommitdiffstats
path: root/webkit/glue/webdevtoolsagent_impl.cc
diff options
context:
space:
mode:
Diffstat (limited to 'webkit/glue/webdevtoolsagent_impl.cc')
-rw-r--r--webkit/glue/webdevtoolsagent_impl.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/webkit/glue/webdevtoolsagent_impl.cc b/webkit/glue/webdevtoolsagent_impl.cc
index 4a6201f..5602f45 100644
--- a/webkit/glue/webdevtoolsagent_impl.cc
+++ b/webkit/glue/webdevtoolsagent_impl.cc
@@ -49,6 +49,9 @@ WebDevToolsAgentImpl::WebDevToolsAgentImpl(
dom_agent_delegate_stub_.set(new DomAgentDelegateStub(this));
net_agent_delegate_stub_.set(new NetAgentDelegateStub(this));
tools_agent_delegate_stub_.set(new ToolsAgentDelegateStub(this));
+
+ // Sniff for requests from the beginning, do not wait for attach.
+ net_agent_impl_.set(new NetAgentImpl(net_agent_delegate_stub_.get()));
}
WebDevToolsAgentImpl::~WebDevToolsAgentImpl() {
@@ -63,7 +66,6 @@ void WebDevToolsAgentImpl::Attach() {
debugger_agent_delegate_stub_.get(),
this));
dom_agent_impl_.set(new DomAgentImpl(dom_agent_delegate_stub_.get()));
- net_agent_impl_.set(new NetAgentImpl(net_agent_delegate_stub_.get()));
// We are potentially attaching to the running page -> init agents with
// Document if any.
@@ -84,13 +86,14 @@ void WebDevToolsAgentImpl::Attach() {
it->line_no);
}
+ net_agent_impl_->Attach();
attached_ = true;
}
void WebDevToolsAgentImpl::Detach() {
debugger_agent_impl_.set(NULL);
dom_agent_impl_.set(NULL);
- net_agent_impl_.set(NULL);
+ net_agent_impl_->Detach();
attached_ = false;
}
@@ -116,6 +119,9 @@ void WebDevToolsAgentImpl::DidCommitLoadForFrame(
WebViewImpl* webview,
WebFrame* frame,
bool is_new_navigation) {
+ if (webview->GetMainFrame() == frame) {
+ net_agent_impl_->DidCommitMainResourceLoad();
+ }
if (!attached_) {
return;
}