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