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

Side by Side Diff: Source/bindings/v8/V8Binding.cpp

Issue 18169002: Improve Dart Debugger performance and robustness by creating Dart wrappers using the standard SetNa… (Closed) Base URL: svn://svn.chromium.org/multivm/trunk/webkit
Patch Set: code review fixes Created 7 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 } 304 }
305 305
306 DOMWindow* toDOMWindow(v8::Handle<v8::Context> context) 306 DOMWindow* toDOMWindow(v8::Handle<v8::Context> context)
307 { 307 {
308 v8::Handle<v8::Object> global = context->Global(); 308 v8::Handle<v8::Object> global = context->Global();
309 ASSERT(!global.IsEmpty()); 309 ASSERT(!global.IsEmpty());
310 v8::Handle<v8::Object> window = global->FindInstanceInPrototypeChain(V8DOMWi ndow::GetTemplate(context->GetIsolate(), MainWorld)); 310 v8::Handle<v8::Object> window = global->FindInstanceInPrototypeChain(V8DOMWi ndow::GetTemplate(context->GetIsolate(), MainWorld));
311 if (!window.IsEmpty()) 311 if (!window.IsEmpty())
312 return V8DOMWindow::toNative(window); 312 return V8DOMWindow::toNative(window);
313 window = global->FindInstanceInPrototypeChain(V8DOMWindow::GetTemplate(conte xt->GetIsolate(), IsolatedWorld)); 313 window = global->FindInstanceInPrototypeChain(V8DOMWindow::GetTemplate(conte xt->GetIsolate(), IsolatedWorld));
314 if (window.IsEmpty()) {
Anton Muhin 2013/07/16 13:27:40 when do you trigger this path?
Jacob 2013/07/16 16:44:59 This path is triggered if you invoke a Dart method
Jacob 2013/07/17 05:58:16 It took far longer than it should but figured out
315 // FIXME: correct the Dart debugger implementation so this isn't require d.
316 return toDOMWindow(v8::Context::GetEntered());
317 }
314 ASSERT(!window.IsEmpty()); 318 ASSERT(!window.IsEmpty());
315 return V8DOMWindow::toNative(window); 319 return V8DOMWindow::toNative(window);
316 } 320 }
317 321
318 ScriptExecutionContext* toScriptExecutionContext(v8::Handle<v8::Context> context ) 322 ScriptExecutionContext* toScriptExecutionContext(v8::Handle<v8::Context> context )
319 { 323 {
320 v8::Handle<v8::Object> global = context->Global(); 324 v8::Handle<v8::Object> global = context->Global();
321 v8::Handle<v8::Object> windowWrapper = global->FindInstanceInPrototypeChain( V8DOMWindow::GetTemplate(context->GetIsolate(), MainWorld)); 325 v8::Handle<v8::Object> windowWrapper = global->FindInstanceInPrototypeChain( V8DOMWindow::GetTemplate(context->GetIsolate(), MainWorld));
322 if (!windowWrapper.IsEmpty()) 326 if (!windowWrapper.IsEmpty())
323 return V8DOMWindow::toNative(windowWrapper)->scriptExecutionContext(); 327 return V8DOMWindow::toNative(windowWrapper)->scriptExecutionContext();
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 if (!DOMWrapperWorld::isolatedWorldsExist()) 431 if (!DOMWrapperWorld::isolatedWorldsExist())
428 return MainWorld; 432 return MainWorld;
429 ASSERT(!v8::Context::GetEntered().IsEmpty()); 433 ASSERT(!v8::Context::GetEntered().IsEmpty());
430 DOMWrapperWorld* isolatedWorld = DOMWrapperWorld::isolatedWorld(v8::Context: :GetEntered()); 434 DOMWrapperWorld* isolatedWorld = DOMWrapperWorld::isolatedWorld(v8::Context: :GetEntered());
431 if (isolatedWorld) 435 if (isolatedWorld)
432 return IsolatedWorld; 436 return IsolatedWorld;
433 return MainWorld; 437 return MainWorld;
434 } 438 }
435 439
436 } // namespace WebCore 440 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698