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

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: migrated to inspector-protocol test 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 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 MainThreadDebugger::instance()->didClearContextsForFrame(frame()); 259 MainThreadDebugger::instance()->didClearContextsForFrame(frame());
260 } 260 }
261 261
262 void ScriptController::collectIsolatedContexts(Vector<std::pair<ScriptState*, Se curityOrigin*>>& result) 262 void ScriptController::collectIsolatedContexts(Vector<std::pair<ScriptState*, Se curityOrigin*>>& result)
263 { 263 {
264 m_windowProxyManager->collectIsolatedContexts(result); 264 m_windowProxyManager->collectIsolatedContexts(result);
265 } 265 }
266 266
267 void ScriptController::updateDocument() 267 void ScriptController::updateDocument()
268 { 268 {
269 bool forceMainWorldInitialization = false;
270 if (canExecuteScripts(NotAboutToExecuteScript) && !frame()->loader().stateMa chine()->creatingInitialEmptyDocument()) {
271 Settings* settings = frame()->settings();
272 forceMainWorldInitialization = settings && settings->forceMainWorldIniti alization();
273 }
274
269 // For an uninitialized main window windowProxy, do not incur the cost of co ntext initialization. 275 // For an uninitialized main window windowProxy, do not incur the cost of co ntext initialization.
270 if (!m_windowProxyManager->mainWorldProxy()->isGlobalInitialized()) 276 if (!forceMainWorldInitialization && !m_windowProxyManager->mainWorldProxy() ->isGlobalInitialized())
271 return; 277 return;
272 278
273 if (!initializeMainWorld()) 279 if (!initializeMainWorld())
274 windowProxy(DOMWrapperWorld::mainWorld())->updateDocument(); 280 windowProxy(DOMWrapperWorld::mainWorld())->updateDocument();
275 } 281 }
276 282
277 void ScriptController::namedItemAdded(HTMLDocument* doc, const AtomicString& nam e) 283 void ScriptController::namedItemAdded(HTMLDocument* doc, const AtomicString& nam e)
278 { 284 {
279 windowProxy(DOMWrapperWorld::mainWorld())->namedItemAdded(doc, name); 285 windowProxy(DOMWrapperWorld::mainWorld())->namedItemAdded(doc, name);
280 } 286 }
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 for (size_t i = 0; i < resultArray->Length(); ++i) { 435 for (size_t i = 0; i < resultArray->Length(); ++i) {
430 v8::Local<v8::Value> value; 436 v8::Local<v8::Value> value;
431 if (!resultArray->Get(scriptState->context(), i).ToLocal(&value)) 437 if (!resultArray->Get(scriptState->context(), i).ToLocal(&value))
432 return; 438 return;
433 results->append(value); 439 results->append(value);
434 } 440 }
435 } 441 }
436 } 442 }
437 443
438 } // namespace blink 444 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698