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

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

Issue 1837823003: [Binding] Add [OverrideBuiltins] label onto HTMLDocument interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
301 static bool isInPrivateScriptIsolateWorld(v8::Isolate* isolate) 291 static bool isInPrivateScriptIsolateWorld(v8::Isolate* isolate)
302 { 292 {
303 v8::Local<v8::Context> context = isolate->GetCurrentContext(); 293 v8::Local<v8::Context> context = isolate->GetCurrentContext();
304 return !context.IsEmpty() && toDOMWindow(context) && DOMWrapperWorld::curren t(isolate).isPrivateScriptIsolatedWorld(); 294 return !context.IsEmpty() && toDOMWindow(context) && DOMWrapperWorld::curren t(isolate).isPrivateScriptIsolatedWorld();
305 } 295 }
306 296
307 bool ScriptController::canExecuteScripts(ReasonForCallingCanExecuteScripts reaso n) 297 bool ScriptController::canExecuteScripts(ReasonForCallingCanExecuteScripts reaso n)
308 { 298 {
309 // For performance reasons, we check isInPrivateScriptIsolateWorld() only if 299 // For performance reasons, we check isInPrivateScriptIsolateWorld() only if
310 // canExecuteScripts is going to return false. 300 // canExecuteScripts is going to return false.
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 for (size_t i = 0; i < resultArray->Length(); ++i) { 433 for (size_t i = 0; i < resultArray->Length(); ++i) {
444 v8::Local<v8::Value> value; 434 v8::Local<v8::Value> value;
445 if (!resultArray->Get(scriptState->context(), i).ToLocal(&value)) 435 if (!resultArray->Get(scriptState->context(), i).ToLocal(&value))
446 return; 436 return;
447 results->append(value); 437 results->append(value);
448 } 438 }
449 } 439 }
450 } 440 }
451 441
452 } // namespace blink 442 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698