Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(99)

Side by Side Diff: Source/bindings/v8/ScriptController.cpp

Issue 146683003: Settings should not call into inspector (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: incorporated review comments Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | Source/core/fetch/ResourceFetcher.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | Source/core/fetch/ResourceFetcher.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698