| 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 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 575 void ScriptController::namedItemRemoved(HTMLDocument* doc, const AtomicString& n
ame) | 575 void ScriptController::namedItemRemoved(HTMLDocument* doc, const AtomicString& n
ame) |
| 576 { | 576 { |
| 577 windowShell(mainThreadNormalWorld())->namedItemRemoved(doc, name); | 577 windowShell(mainThreadNormalWorld())->namedItemRemoved(doc, name); |
| 578 } | 578 } |
| 579 | 579 |
| 580 bool ScriptController::canExecuteScripts(ReasonForCallingCanExecuteScripts reaso
n) | 580 bool ScriptController::canExecuteScripts(ReasonForCallingCanExecuteScripts reaso
n) |
| 581 { | 581 { |
| 582 if (m_frame->document() && m_frame->document()->isSandboxed(SandboxScripts))
{ | 582 if (m_frame->document() && m_frame->document()->isSandboxed(SandboxScripts))
{ |
| 583 // FIXME: This message should be moved off the console once a solution t
o https://bugs.webkit.org/show_bug.cgi?id=103274 exists. | 583 // FIXME: This message should be moved off the console once a solution t
o https://bugs.webkit.org/show_bug.cgi?id=103274 exists. |
| 584 if (reason == AboutToExecuteScript) | 584 if (reason == AboutToExecuteScript) |
| 585 m_frame->document()->addConsoleMessage(SecurityMessageSource, ErrorM
essageLevel, "Blocked script execution in '" + m_frame->document()->url().elided
String() + "' because the document's frame is sandboxed and the 'allow-scripts'
permission is not set."); | 585 m_frame->document()->addConsoleMessage(SecurityMessageSource, ErrorM
essageLevel, "Blocked script execution in '" + m_frame->document()->url().elided
String() + "' because the document's frame is sandboxed and the 'allow-scripts'
permission is not set.", 0, ForceParserStateCollection); |
| 586 return false; | 586 return false; |
| 587 } | 587 } |
| 588 | 588 |
| 589 if (m_frame->document() && m_frame->document()->isViewSource()) { | 589 if (m_frame->document() && m_frame->document()->isViewSource()) { |
| 590 ASSERT(m_frame->document()->securityOrigin()->isUnique()); | 590 ASSERT(m_frame->document()->securityOrigin()->isUnique()); |
| 591 return true; | 591 return true; |
| 592 } | 592 } |
| 593 | 593 |
| 594 Settings* settings = m_frame->settings(); | 594 Settings* settings = m_frame->settings(); |
| 595 const bool allowed = m_frame->loader()->client()->allowScript(settings && se
ttings->isScriptEnabled()); | 595 const bool allowed = m_frame->loader()->client()->allowScript(settings && se
ttings->isScriptEnabled()); |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 708 v8Results = evaluateHandleScope.Close(resultArray); | 708 v8Results = evaluateHandleScope.Close(resultArray); |
| 709 } | 709 } |
| 710 | 710 |
| 711 if (results && !v8Results.IsEmpty()) { | 711 if (results && !v8Results.IsEmpty()) { |
| 712 for (size_t i = 0; i < v8Results->Length(); ++i) | 712 for (size_t i = 0; i < v8Results->Length(); ++i) |
| 713 results->append(ScriptValue(v8Results->Get(i))); | 713 results->append(ScriptValue(v8Results->Get(i))); |
| 714 } | 714 } |
| 715 } | 715 } |
| 716 | 716 |
| 717 } // namespace WebCore | 717 } // namespace WebCore |
| OLD | NEW |