summaryrefslogtreecommitdiffstats
path: root/webkit/glue/webdevtoolsagent_impl.cc
diff options
context:
space:
mode:
authorpfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-29 15:16:51 +0000
committerpfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-29 15:16:51 +0000
commitd43c374dc64085f100a65698d5b88387694c4232 (patch)
treecf54cfdbd09539f659dd36df0aa2466e751c0a79 /webkit/glue/webdevtoolsagent_impl.cc
parent0b5f62f66a72fb3b1ae447637a492960d6de517c (diff)
downloadchromium_src-d43c374dc64085f100a65698d5b88387694c4232.zip
chromium_src-d43c374dc64085f100a65698d5b88387694c4232.tar.gz
chromium_src-d43c374dc64085f100a65698d5b88387694c4232.tar.bz2
DevTools: keep links on the edited styles so that they are not collected between debugging sessions.
Review URL: http://codereview.chromium.org/100159 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14844 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/webdevtoolsagent_impl.cc')
-rw-r--r--webkit/glue/webdevtoolsagent_impl.cc14
1 files changed, 10 insertions, 4 deletions
diff --git a/webkit/glue/webdevtoolsagent_impl.cc b/webkit/glue/webdevtoolsagent_impl.cc
index 6faba5b..49f457b 100644
--- a/webkit/glue/webdevtoolsagent_impl.cc
+++ b/webkit/glue/webdevtoolsagent_impl.cc
@@ -56,6 +56,9 @@ WebDevToolsAgentImpl::WebDevToolsAgentImpl(
}
WebDevToolsAgentImpl::~WebDevToolsAgentImpl() {
+ if (!utility_context_.IsEmpty()) {
+ utility_context_.Dispose();
+ }
}
void WebDevToolsAgentImpl::Attach() {
@@ -73,7 +76,10 @@ void WebDevToolsAgentImpl::Attach() {
Page* page = web_view_impl_->page();
Document* doc = page->mainFrame()->document();
if (doc) {
- debugger_agent_impl_->SetDocument(doc);
+ // Reuse existing context in case detached/attached.
+ if (utility_context_.IsEmpty()) {
+ debugger_agent_impl_->CreateUtilityContext(doc, &utility_context_);
+ }
dom_agent_impl_->SetDocument(doc);
net_agent_impl_->SetDocument(doc);
}
@@ -110,7 +116,7 @@ void WebDevToolsAgentImpl::SetMainFrameDocumentReady(bool ready) {
} else {
doc = NULL;
}
- debugger_agent_impl_->SetDocument(doc);
+ debugger_agent_impl_->CreateUtilityContext(doc, &utility_context_);
dom_agent_impl_->SetDocument(doc);
net_agent_impl_->SetDocument(doc);
}
@@ -197,8 +203,8 @@ void WebDevToolsAgentImpl::ExecuteUtilityFunction(
String result;
String exception;
if (node) {
- result = debugger_agent_impl_->ExecuteUtilityFunction(function_name, node,
- json_args, &exception);
+ result = debugger_agent_impl_->ExecuteUtilityFunction(utility_context_,
+ function_name, node, json_args, &exception);
}
tools_agent_delegate_stub_->DidExecuteUtilityFunction(call_id,
result, exception);