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

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

Issue 2011553003: Revert of [Binding] Add [OverrideBuiltins] label onto HTMLDocument interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 void ScriptController::updateDocument() 281 void ScriptController::updateDocument()
282 { 282 {
283 // For an uninitialized main window windowProxy, do not incur the cost of co ntext initialization. 283 // For an uninitialized main window windowProxy, do not incur the cost of co ntext initialization.
284 if (!m_windowProxyManager->mainWorldProxy()->isGlobalInitialized()) 284 if (!m_windowProxyManager->mainWorldProxy()->isGlobalInitialized())
285 return; 285 return;
286 286
287 if (!initializeMainWorld()) 287 if (!initializeMainWorld())
288 windowProxy(DOMWrapperWorld::mainWorld())->updateDocument(); 288 windowProxy(DOMWrapperWorld::mainWorld())->updateDocument();
289 } 289 }
290 290
291 void ScriptController::namedItemAdded(HTMLDocument* doc, const AtomicString& nam e)
292 {
293 windowProxy(DOMWrapperWorld::mainWorld())->namedItemAdded(doc, name);
294 }
295
296 void ScriptController::namedItemRemoved(HTMLDocument* doc, const AtomicString& n ame)
297 {
298 windowProxy(DOMWrapperWorld::mainWorld())->namedItemRemoved(doc, name);
299 }
300
291 static bool isInPrivateScriptIsolateWorld(v8::Isolate* isolate) 301 static bool isInPrivateScriptIsolateWorld(v8::Isolate* isolate)
292 { 302 {
293 v8::Local<v8::Context> context = isolate->GetCurrentContext(); 303 v8::Local<v8::Context> context = isolate->GetCurrentContext();
294 return !context.IsEmpty() && toDOMWindow(context) && DOMWrapperWorld::curren t(isolate).isPrivateScriptIsolatedWorld(); 304 return !context.IsEmpty() && toDOMWindow(context) && DOMWrapperWorld::curren t(isolate).isPrivateScriptIsolatedWorld();
295 } 305 }
296 306
297 bool ScriptController::canExecuteScripts(ReasonForCallingCanExecuteScripts reaso n) 307 bool ScriptController::canExecuteScripts(ReasonForCallingCanExecuteScripts reaso n)
298 { 308 {
299 // For performance reasons, we check isInPrivateScriptIsolateWorld() only if 309 // For performance reasons, we check isInPrivateScriptIsolateWorld() only if
300 // canExecuteScripts is going to return false. 310 // canExecuteScripts is going to return false.
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 for (size_t i = 0; i < resultArray->Length(); ++i) { 443 for (size_t i = 0; i < resultArray->Length(); ++i) {
434 v8::Local<v8::Value> value; 444 v8::Local<v8::Value> value;
435 if (!resultArray->Get(scriptState->context(), i).ToLocal(&value)) 445 if (!resultArray->Get(scriptState->context(), i).ToLocal(&value))
436 return; 446 return;
437 results->append(value); 447 results->append(value);
438 } 448 }
439 } 449 }
440 } 450 }
441 451
442 } // namespace blink 452 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698