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

Side by Side Diff: third_party/WebKit/Source/core/dom/ScriptLoader.cpp

Issue 2701993002: DO NOT COMMIT: Results of running new (proposed) clang-format on Blink (Closed)
Patch Set: Created 3 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights
6 * reserved. 6 * reserved.
7 * Copyright (C) 2008 Nikolas Zimmermann <zimmermann@kde.org> 7 * Copyright (C) 2008 Nikolas Zimmermann <zimmermann@kde.org>
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after
716 716
717 if (m_isExternalScript) { 717 if (m_isExternalScript) {
718 ScriptResource* resource = 718 ScriptResource* resource =
719 m_resource ? m_resource.get() : sourceCode.resource(); 719 m_resource ? m_resource.get() : sourceCode.resource();
720 if (resource) { 720 if (resource) {
721 if (!ScriptResource::mimeTypeAllowedByNosniff(resource->response())) { 721 if (!ScriptResource::mimeTypeAllowedByNosniff(resource->response())) {
722 contextDocument->addConsoleMessage(ConsoleMessage::create( 722 contextDocument->addConsoleMessage(ConsoleMessage::create(
723 SecurityMessageSource, ErrorMessageLevel, 723 SecurityMessageSource, ErrorMessageLevel,
724 "Refused to execute script from '" + 724 "Refused to execute script from '" +
725 resource->url().elidedString() + "' because its MIME type ('" + 725 resource->url().elidedString() + "' because its MIME type ('" +
726 resource->httpContentType() + "') is not executable, and " 726 resource->httpContentType() +
727 "strict MIME type checking is " 727 "') is not executable, and "
728 "enabled.")); 728 "strict MIME type checking is "
729 "enabled."));
729 return false; 730 return false;
730 } 731 }
731 732
732 String mimeType = resource->httpContentType(); 733 String mimeType = resource->httpContentType();
733 if (mimeType.startsWith("image/") || mimeType == "text/csv" || 734 if (mimeType.startsWith("image/") || mimeType == "text/csv" ||
734 mimeType.startsWith("audio/") || mimeType.startsWith("video/")) { 735 mimeType.startsWith("audio/") || mimeType.startsWith("video/")) {
735 contextDocument->addConsoleMessage(ConsoleMessage::create( 736 contextDocument->addConsoleMessage(ConsoleMessage::create(
736 SecurityMessageSource, ErrorMessageLevel, 737 SecurityMessageSource, ErrorMessageLevel,
737 "Refused to execute script from '" + 738 "Refused to execute script from '" +
738 resource->url().elidedString() + "' because its MIME type ('" + 739 resource->url().elidedString() + "' because its MIME type ('" +
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
917 if (isHTMLScriptLoader(element)) 918 if (isHTMLScriptLoader(element))
918 return toHTMLScriptElement(element)->loader(); 919 return toHTMLScriptElement(element)->loader();
919 920
920 if (isSVGScriptLoader(element)) 921 if (isSVGScriptLoader(element))
921 return toSVGScriptElement(element)->loader(); 922 return toSVGScriptElement(element)->loader();
922 923
923 return 0; 924 return 0;
924 } 925 }
925 926
926 } // namespace blink 927 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Range.cpp ('k') | third_party/WebKit/Source/core/dom/ScriptRunner.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698