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

Unified Diff: webkit/glue/devtools/debugger_agent_impl.cc

Issue 100159: DevTools: keep links on the edited styles so that they are not collected betw... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 8 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/devtools/debugger_agent_impl.h ('k') | webkit/glue/devtools/js/devtools.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/devtools/debugger_agent_impl.cc
===================================================================
--- webkit/glue/devtools/debugger_agent_impl.cc (revision 14839)
+++ webkit/glue/devtools/debugger_agent_impl.cc (working copy)
@@ -61,14 +61,14 @@
webdevtools_agent_->ForceRepaint();
}
-void DebuggerAgentImpl::SetDocument(Document* document) {
+void DebuggerAgentImpl::CreateUtilityContext(
+ Document* document,
+ v8::Persistent<v8::Context>* context) {
+ if (!context->IsEmpty()) {
+ context->Dispose();
+ }
v8::HandleScope scope;
- if (!document) {
- context_.Dispose();
- return;
- }
-
// TODO(pfeldman): Validate against Soeren.
// Set up the DOM window as the prototype of the new global object.
v8::Handle<v8::Context> window_context =
@@ -91,12 +91,12 @@
V8Custom::v8DOMWindowIndexedSecurityCheck,
v8::Integer::New(V8ClassIndex::DOMWINDOW));
- context_ = v8::Context::New(
+ *context = v8::Context::New(
NULL /* no extensions */,
global_template,
v8::Handle<v8::Object>());
- v8::Context::Scope context_scope(context_);
- v8::Handle<v8::Object> global = context_->Global();
+ v8::Context::Scope context_scope(*context);
+ v8::Handle<v8::Object> global = (*context)->Global();
v8::Handle<v8::String> implicit_proto_string = v8::String::New("__proto__");
global->Set(implicit_proto_string, window_wrapper);
@@ -119,15 +119,16 @@
}
String DebuggerAgentImpl::ExecuteUtilityFunction(
+ v8::Handle<v8::Context> context,
const String &function_name,
Node* node,
const String& json_args,
String* exception) {
v8::HandleScope scope;
- ASSERT(!context_.IsEmpty());
- v8::Context::Scope context_scope(context_);
+ ASSERT(!context.IsEmpty());
+ v8::Context::Scope context_scope(context);
v8::Handle<v8::Function> function = v8::Local<v8::Function>::Cast(
- context_->Global()->Get(v8::String::New("devtools$$dispatch")));
+ context->Global()->Get(v8::String::New("devtools$$dispatch")));
v8::Handle<v8::Value> node_wrapper =
V8Proxy::ToV8Object(V8ClassIndex::NODE, node);
@@ -142,7 +143,7 @@
};
v8::TryCatch try_catch;
- v8::Handle<v8::Value> res_obj = function->Call(context_->Global(), 3, args);
+ v8::Handle<v8::Value> res_obj = function->Call(context->Global(), 3, args);
if (try_catch.HasCaught()) {
*exception = WebCore::ToWebCoreString(try_catch.Message()->Get());
return "";
« no previous file with comments | « webkit/glue/devtools/debugger_agent_impl.h ('k') | webkit/glue/devtools/js/devtools.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698