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

Unified Diff: webkit/glue/webdevtoolsagent_impl.cc

Issue 56149: DevTools: add support for main resource load tracking. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 9 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 12953)
+++ webkit/glue/webdevtoolsagent_impl.cc (working copy)
@@ -42,10 +42,10 @@
web_view_impl_(web_view_impl),
document_(NULL),
attached_(false) {
- debugger_agent_delegate_stub_.reset(new DebuggerAgentDelegateStub(this));
- dom_agent_delegate_stub_.reset(new DomAgentDelegateStub(this));
- net_agent_delegate_stub_.reset(new NetAgentDelegateStub(this));
- tools_agent_delegate_stub_.reset(new ToolsAgentDelegateStub(this));
+ debugger_agent_delegate_stub_.set(new DebuggerAgentDelegateStub(this));
+ dom_agent_delegate_stub_.set(new DomAgentDelegateStub(this));
+ net_agent_delegate_stub_.set(new NetAgentDelegateStub(this));
+ tools_agent_delegate_stub_.set(new ToolsAgentDelegateStub(this));
}
WebDevToolsAgentImpl::~WebDevToolsAgentImpl() {
@@ -55,10 +55,10 @@
if (attached_) {
return;
}
- debugger_agent_impl_.reset(
+ debugger_agent_impl_.set(
new DebuggerAgentImpl(debugger_agent_delegate_stub_.get()));
- dom_agent_impl_.reset(new DomAgentImpl(dom_agent_delegate_stub_.get()));
- net_agent_impl_.reset(new NetAgentImpl(net_agent_delegate_stub_.get()));
+ dom_agent_impl_.set(new DomAgentImpl(dom_agent_delegate_stub_.get()));
+ net_agent_impl_.set(new NetAgentImpl(net_agent_delegate_stub_.get()));
if (document_) {
debugger_agent_impl_->SetDocument(document_);
dom_agent_impl_->SetDocument(document_);
@@ -68,13 +68,14 @@
}
void WebDevToolsAgentImpl::Detach() {
- debugger_agent_impl_.reset(NULL);
- dom_agent_impl_.reset(NULL);
- net_agent_impl_.reset(NULL);
+ debugger_agent_impl_.set(NULL);
+ dom_agent_impl_.set(NULL);
+ net_agent_impl_.set(NULL);
attached_ = false;
}
void WebDevToolsAgentImpl::SetMainFrameDocumentReady(bool ready) {
+ // Store document reference no matter if client is attached.
if (ready) {
Page* page = web_view_impl_->page();
document_ = page->mainFrame()->document();
@@ -106,11 +107,13 @@
}
void WebDevToolsAgentImpl::HighlightDOMNode(int node_id) {
- if (!attached_)
+ if (!attached_) {
return;
+ }
Node* node = dom_agent_impl_->GetNodeForId(node_id);
- if (!node)
+ if (!node) {
return;
+ }
Page* page = web_view_impl_->page();
page->inspectorController()->highlight(node);
}
@@ -152,28 +155,34 @@
const std::string& raw_msg) {
OwnPtr<ListValue> message(
static_cast<ListValue*>(DevToolsRpc::ParseMessage(raw_msg)));
- if (ToolsAgentDispatch::Dispatch(this, *message.get()))
+ if (ToolsAgentDispatch::Dispatch(this, *message.get())) {
return;
+ }
- if (!attached_)
+ if (!attached_) {
return;
+ }
if (debugger_agent_impl_.get() &&
DebuggerAgentDispatch::Dispatch(
debugger_agent_impl_.get(),
- *message.get()))
+ *message.get())) {
return;
+ }
- if (DomAgentDispatch::Dispatch(dom_agent_impl_.get(), *message.get()))
+ if (DomAgentDispatch::Dispatch(dom_agent_impl_.get(), *message.get())) {
return;
- if (NetAgentDispatch::Dispatch(net_agent_impl_.get(), *message.get()))
+ }
+ if (NetAgentDispatch::Dispatch(net_agent_impl_.get(), *message.get())) {
return;
+ }
}
void WebDevToolsAgentImpl::InspectElement(int x, int y) {
Node* node = web_view_impl_->GetNodeForWindowPos(x, y);
- if (!node)
+ if (!node) {
return;
+ }
int node_id = dom_agent_impl_->PushNodePathToClient(node);
tools_agent_delegate_stub_->UpdateFocusedNode(node_id);
« 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