OLD | NEW |
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 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 void ScriptController::updateDocument() { | 305 void ScriptController::updateDocument() { |
306 // For an uninitialized main window windowProxy, do not incur the cost of | 306 // For an uninitialized main window windowProxy, do not incur the cost of |
307 // context initialization. | 307 // context initialization. |
308 if (!m_windowProxyManager->mainWorldProxy()->isGlobalInitialized()) | 308 if (!m_windowProxyManager->mainWorldProxy()->isGlobalInitialized()) |
309 return; | 309 return; |
310 | 310 |
311 if (!initializeMainWorld()) | 311 if (!initializeMainWorld()) |
312 windowProxy(DOMWrapperWorld::mainWorld())->updateDocument(); | 312 windowProxy(DOMWrapperWorld::mainWorld())->updateDocument(); |
313 } | 313 } |
314 | 314 |
315 void ScriptController::namedItemAdded(HTMLDocument* doc, | |
316 const AtomicString& name) { | |
317 windowProxy(DOMWrapperWorld::mainWorld())->namedItemAdded(doc, name); | |
318 } | |
319 | |
320 void ScriptController::namedItemRemoved(HTMLDocument* doc, | |
321 const AtomicString& name) { | |
322 windowProxy(DOMWrapperWorld::mainWorld())->namedItemRemoved(doc, name); | |
323 } | |
324 | |
325 bool ScriptController::canExecuteScripts( | 315 bool ScriptController::canExecuteScripts( |
326 ReasonForCallingCanExecuteScripts reason) { | 316 ReasonForCallingCanExecuteScripts reason) { |
327 | 317 |
328 if (frame()->document() && frame()->document()->isSandboxed(SandboxScripts)) { | 318 if (frame()->document() && frame()->document()->isSandboxed(SandboxScripts)) { |
329 // FIXME: This message should be moved off the console once a solution to | 319 // FIXME: This message should be moved off the console once a solution to |
330 // https://bugs.webkit.org/show_bug.cgi?id=103274 exists. | 320 // https://bugs.webkit.org/show_bug.cgi?id=103274 exists. |
331 if (reason == AboutToExecuteScript) | 321 if (reason == AboutToExecuteScript) |
332 frame()->document()->addConsoleMessage(ConsoleMessage::create( | 322 frame()->document()->addConsoleMessage(ConsoleMessage::create( |
333 SecurityMessageSource, ErrorMessageLevel, | 323 SecurityMessageSource, ErrorMessageLevel, |
334 "Blocked script execution in '" + | 324 "Blocked script execution in '" + |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
489 for (size_t i = 0; i < resultArray->Length(); ++i) { | 479 for (size_t i = 0; i < resultArray->Length(); ++i) { |
490 v8::Local<v8::Value> value; | 480 v8::Local<v8::Value> value; |
491 if (!resultArray->Get(scriptState->context(), i).ToLocal(&value)) | 481 if (!resultArray->Get(scriptState->context(), i).ToLocal(&value)) |
492 return; | 482 return; |
493 results->push_back(value); | 483 results->push_back(value); |
494 } | 484 } |
495 } | 485 } |
496 } | 486 } |
497 | 487 |
498 } // namespace blink | 488 } // namespace blink |
OLD | NEW |