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

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

Issue 419203004: DevTools: wrapping arguments addConsoleMessage in ConsoleMessage (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@wrap-not-all-console-args
Patch Set: Created 6 years, 4 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
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 477 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « no previous file | Source/core/css/MediaList.cpp » ('j') | Source/core/frame/csp/CSPDirectiveList.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698