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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/ScriptController.cpp

Issue 2112593003: [DevTools] Remove [V8] from InspectorInstrumentation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cleanup, moving csp event to dom debugger Created 4 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008, 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2008, 2009 Google Inc. All rights reserved.
3 * Copyright (C) 2009 Apple Inc. All rights reserved. 3 * Copyright (C) 2009 Apple Inc. All rights reserved.
4 * Copyright (C) 2014 Opera Software ASA. All rights reserved. 4 * Copyright (C) 2014 Opera Software ASA. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are 7 * modification, are permitted provided that the following conditions are
8 * met: 8 * met:
9 * 9 *
10 * * Redistributions of source code must retain the above copyright 10 * * Redistributions of source code must retain the above copyright
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 MainThreadDebugger::instance()->didClearContextsForFrame(frame()); 270 MainThreadDebugger::instance()->didClearContextsForFrame(frame());
271 } 271 }
272 272
273 void ScriptController::collectIsolatedContexts(Vector<std::pair<ScriptState*, Se curityOrigin*>>& result) 273 void ScriptController::collectIsolatedContexts(Vector<std::pair<ScriptState*, Se curityOrigin*>>& result)
274 { 274 {
275 m_windowProxyManager->collectIsolatedContexts(result); 275 m_windowProxyManager->collectIsolatedContexts(result);
276 } 276 }
277 277
278 void ScriptController::updateDocument() 278 void ScriptController::updateDocument()
279 { 279 {
280 bool forceMainWorldInitialization = false;
281 if (canExecuteScripts(NotAboutToExecuteScript) && !frame()->loader().stateMa chine()->creatingInitialEmptyDocument()) {
282 Settings* settings = frame()->settings();
283 forceMainWorldInitialization = settings && settings->forceMainWorldIniti alization();
284 }
285
280 // For an uninitialized main window windowProxy, do not incur the cost of co ntext initialization. 286 // For an uninitialized main window windowProxy, do not incur the cost of co ntext initialization.
281 if (!m_windowProxyManager->mainWorldProxy()->isGlobalInitialized()) 287 if (!forceMainWorldInitialization && !m_windowProxyManager->mainWorldProxy() ->isGlobalInitialized())
haraken 2016/07/01 02:28:03 Hmm, it looks a bit nasty to force the main world
dgozman 2016/07/06 17:02:20 Alternatives are LocalDOMWindow::installNewDocumen
282 return; 288 return;
283 289
284 if (!initializeMainWorld()) 290 if (!initializeMainWorld())
285 windowProxy(DOMWrapperWorld::mainWorld())->updateDocument(); 291 windowProxy(DOMWrapperWorld::mainWorld())->updateDocument();
286 } 292 }
287 293
288 void ScriptController::namedItemAdded(HTMLDocument* doc, const AtomicString& nam e) 294 void ScriptController::namedItemAdded(HTMLDocument* doc, const AtomicString& nam e)
289 { 295 {
290 windowProxy(DOMWrapperWorld::mainWorld())->namedItemAdded(doc, name); 296 windowProxy(DOMWrapperWorld::mainWorld())->namedItemAdded(doc, name);
291 } 297 }
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
440 for (size_t i = 0; i < resultArray->Length(); ++i) { 446 for (size_t i = 0; i < resultArray->Length(); ++i) {
441 v8::Local<v8::Value> value; 447 v8::Local<v8::Value> value;
442 if (!resultArray->Get(scriptState->context(), i).ToLocal(&value)) 448 if (!resultArray->Get(scriptState->context(), i).ToLocal(&value))
443 return; 449 return;
444 results->append(value); 450 results->append(value);
445 } 451 }
446 } 452 }
447 } 453 }
448 454
449 } // namespace blink 455 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698