summaryrefslogtreecommitdiffstats
path: root/webkit/glue/devtools
diff options
context:
space:
mode:
authorpfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-18 14:48:37 +0000
committerpfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-18 14:48:37 +0000
commitda4b92fee136f90425c3400c2fe11469972178cf (patch)
tree184d916852c6e697fc7da11cef5696f09dbf3be3 /webkit/glue/devtools
parente80cb893343a457c181b0bd26a208bd71a99f661 (diff)
downloadchromium_src-da4b92fee136f90425c3400c2fe11469972178cf.zip
chromium_src-da4b92fee136f90425c3400c2fe11469972178cf.tar.gz
chromium_src-da4b92fee136f90425c3400c2fe11469972178cf.tar.bz2
DevTools: Reset utility context for given document only once.
Review URL: http://codereview.chromium.org/172091 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23621 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/devtools')
-rw-r--r--webkit/glue/devtools/debugger_agent_impl.cc12
-rw-r--r--webkit/glue/devtools/debugger_agent_impl.h4
2 files changed, 6 insertions, 10 deletions
diff --git a/webkit/glue/devtools/debugger_agent_impl.cc b/webkit/glue/devtools/debugger_agent_impl.cc
index 8bcbe80..80db427 100644
--- a/webkit/glue/devtools/debugger_agent_impl.cc
+++ b/webkit/glue/devtools/debugger_agent_impl.cc
@@ -90,25 +90,21 @@ void DebuggerAgentImpl::DebuggerOutput(const std::string& command) {
}
// static
-void DebuggerAgentImpl::ResetUtilityContext(
- Document* document,
+void DebuggerAgentImpl::CreateUtilityContext(
+ Frame* frame,
v8::Persistent<v8::Context>* context) {
- if (!context->IsEmpty()) {
- context->Dispose();
- context->Clear();
- }
v8::HandleScope scope;
// TODO(pfeldman): Validate against Soeren.
// Set up the DOM window as the prototype of the new global object.
v8::Handle<v8::Context> window_context =
- V8Proxy::context(document->frame());
+ V8Proxy::context(frame);
v8::Handle<v8::Object> window_global = window_context->Global();
v8::Handle<v8::Object> window_wrapper =
V8DOMWrapper::lookupDOMWrapper(V8ClassIndex::DOMWINDOW, window_global);
ASSERT(V8DOMWrapper::convertDOMWrapperToNative<DOMWindow>(window_wrapper) ==
- document->frame()->domWindow());
+ frame->domWindow());
// Create a new environment using an empty template for the shadow
// object. Reuse the global object if one has been created earlier.
diff --git a/webkit/glue/devtools/debugger_agent_impl.h b/webkit/glue/devtools/debugger_agent_impl.h
index 36c9367..20db532 100644
--- a/webkit/glue/devtools/debugger_agent_impl.h
+++ b/webkit/glue/devtools/debugger_agent_impl.h
@@ -26,8 +26,8 @@ class String;
class DebuggerAgentImpl : public DebuggerAgent {
public:
// Creates utility context with injected js agent.
- static void ResetUtilityContext(WebCore::Document* document,
- v8::Persistent<v8::Context>* context);
+ static void CreateUtilityContext(WebCore::Frame* frame,
+ v8::Persistent<v8::Context>* context);
DebuggerAgentImpl(WebViewImpl* web_view_impl,
DebuggerAgentDelegate* delegate,