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 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
488 bool ScriptController::canExecuteScripts(ReasonForCallingCanExecuteScripts reaso
n) | 488 bool ScriptController::canExecuteScripts(ReasonForCallingCanExecuteScripts reaso
n) |
489 { | 489 { |
490 // For performance reasons, we check isInPrivateScriptIsolateWorld() only if | 490 // For performance reasons, we check isInPrivateScriptIsolateWorld() only if |
491 // canExecuteScripts is going to return false. | 491 // canExecuteScripts is going to return false. |
492 | 492 |
493 if (m_frame->document() && m_frame->document()->isSandboxed(SandboxScripts))
{ | 493 if (m_frame->document() && m_frame->document()->isSandboxed(SandboxScripts))
{ |
494 if (isInPrivateScriptIsolateWorld(m_isolate)) | 494 if (isInPrivateScriptIsolateWorld(m_isolate)) |
495 return true; | 495 return true; |
496 // FIXME: This message should be moved off the console once a solution t
o https://bugs.webkit.org/show_bug.cgi?id=103274 exists. | 496 // FIXME: This message should be moved off the console once a solution t
o https://bugs.webkit.org/show_bug.cgi?id=103274 exists. |
497 if (reason == AboutToExecuteScript) | 497 if (reason == AboutToExecuteScript) |
498 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."); | 498 m_frame->document()->addConsoleMessage(ConsoleMessage::create(Securi
tyMessageSource, ErrorMessageLevel, "Blocked script execution in '" + m_frame->d
ocument()->url().elidedString() + "' because the document's frame is sandboxed a
nd the 'allow-scripts' permission is not set.")); |
499 return false; | 499 return false; |
500 } | 500 } |
501 | 501 |
502 if (m_frame->document() && m_frame->document()->isViewSource()) { | 502 if (m_frame->document() && m_frame->document()->isViewSource()) { |
503 ASSERT(m_frame->document()->securityOrigin()->isUnique()); | 503 ASSERT(m_frame->document()->securityOrigin()->isUnique()); |
504 return true; | 504 return true; |
505 } | 505 } |
506 | 506 |
507 Settings* settings = m_frame->settings(); | 507 Settings* settings = m_frame->settings(); |
508 const bool allowed = m_frame->loader().client()->allowScript(settings && set
tings->scriptEnabled()) | 508 const bool allowed = m_frame->loader().client()->allowScript(settings && set
tings->scriptEnabled()) |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
628 resultArray->Set(i, evaluationResult); | 628 resultArray->Set(i, evaluationResult); |
629 } | 629 } |
630 | 630 |
631 if (results) { | 631 if (results) { |
632 for (size_t i = 0; i < resultArray->Length(); ++i) | 632 for (size_t i = 0; i < resultArray->Length(); ++i) |
633 results->append(handleScope.Escape(resultArray->Get(i))); | 633 results->append(handleScope.Escape(resultArray->Get(i))); |
634 } | 634 } |
635 } | 635 } |
636 | 636 |
637 } // namespace blink | 637 } // namespace blink |
OLD | NEW |