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 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
551 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."); | 551 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."); |
552 return false; | 552 return false; |
553 } | 553 } |
554 | 554 |
555 if (m_frame->document() && m_frame->document()->isViewSource()) { | 555 if (m_frame->document() && m_frame->document()->isViewSource()) { |
556 ASSERT(m_frame->document()->securityOrigin()->isUnique()); | 556 ASSERT(m_frame->document()->securityOrigin()->isUnique()); |
557 return true; | 557 return true; |
558 } | 558 } |
559 | 559 |
560 Settings* settings = m_frame->settings(); | 560 Settings* settings = m_frame->settings(); |
561 const bool allowed = m_frame->loader().client()->allowScript(settings && set
tings->isScriptEnabled()); | 561 const bool allowed = m_frame->loader().client()->allowScript(settings && set
tings->scriptEnabled()); |
562 if (!allowed && reason == AboutToExecuteScript) | 562 if (!allowed && reason == AboutToExecuteScript) |
563 m_frame->loader().client()->didNotAllowScript(); | 563 m_frame->loader().client()->didNotAllowScript(); |
564 return allowed; | 564 return allowed; |
565 } | 565 } |
566 | 566 |
567 bool ScriptController::executeScriptIfJavaScriptURL(const KURL& url) | 567 bool ScriptController::executeScriptIfJavaScriptURL(const KURL& url) |
568 { | 568 { |
569 if (!protocolIsJavaScript(url)) | 569 if (!protocolIsJavaScript(url)) |
570 return false; | 570 return false; |
571 | 571 |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
682 v8Results = evaluateHandleScope.Escape(resultArray); | 682 v8Results = evaluateHandleScope.Escape(resultArray); |
683 } | 683 } |
684 | 684 |
685 if (results && !v8Results.IsEmpty()) { | 685 if (results && !v8Results.IsEmpty()) { |
686 for (size_t i = 0; i < v8Results->Length(); ++i) | 686 for (size_t i = 0; i < v8Results->Length(); ++i) |
687 results->append(ScriptValue(v8Results->Get(i), m_isolate)); | 687 results->append(ScriptValue(v8Results->Get(i), m_isolate)); |
688 } | 688 } |
689 } | 689 } |
690 | 690 |
691 } // namespace WebCore | 691 } // namespace WebCore |
OLD | NEW |