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 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
495 bool ScriptController::canExecuteScripts(ReasonForCallingCanExecuteScripts reaso
n) | 495 bool ScriptController::canExecuteScripts(ReasonForCallingCanExecuteScripts reaso
n) |
496 { | 496 { |
497 // For performance reasons, we check isInPrivateScriptIsolateWorld() only if | 497 // For performance reasons, we check isInPrivateScriptIsolateWorld() only if |
498 // canExecuteScripts is going to return false. | 498 // canExecuteScripts is going to return false. |
499 | 499 |
500 if (m_frame->document() && m_frame->document()->isSandboxed(SandboxScripts))
{ | 500 if (m_frame->document() && m_frame->document()->isSandboxed(SandboxScripts))
{ |
501 if (isInPrivateScriptIsolateWorld(m_isolate)) | 501 if (isInPrivateScriptIsolateWorld(m_isolate)) |
502 return true; | 502 return true; |
503 // FIXME: This message should be moved off the console once a solution t
o https://bugs.webkit.org/show_bug.cgi?id=103274 exists. | 503 // FIXME: This message should be moved off the console once a solution t
o https://bugs.webkit.org/show_bug.cgi?id=103274 exists. |
504 if (reason == AboutToExecuteScript) | 504 if (reason == AboutToExecuteScript) |
505 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."); | 505 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.")); |
506 return false; | 506 return false; |
507 } | 507 } |
508 | 508 |
509 if (m_frame->document() && m_frame->document()->isViewSource()) { | 509 if (m_frame->document() && m_frame->document()->isViewSource()) { |
510 ASSERT(m_frame->document()->securityOrigin()->isUnique()); | 510 ASSERT(m_frame->document()->securityOrigin()->isUnique()); |
511 return true; | 511 return true; |
512 } | 512 } |
513 | 513 |
514 Settings* settings = m_frame->settings(); | 514 Settings* settings = m_frame->settings(); |
515 const bool allowed = m_frame->loader().client()->allowScript(settings && set
tings->scriptEnabled()) | 515 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... |
635 resultArray->Set(i, evaluationResult); | 635 resultArray->Set(i, evaluationResult); |
636 } | 636 } |
637 | 637 |
638 if (results) { | 638 if (results) { |
639 for (size_t i = 0; i < resultArray->Length(); ++i) | 639 for (size_t i = 0; i < resultArray->Length(); ++i) |
640 results->append(handleScope.Escape(resultArray->Get(i))); | 640 results->append(handleScope.Escape(resultArray->Get(i))); |
641 } | 641 } |
642 } | 642 } |
643 | 643 |
644 } // namespace blink | 644 } // namespace blink |
OLD | NEW |