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

Side by Side Diff: third_party/WebKit/Source/core/loader/resource/ScriptResource.cpp

Issue 2774843002: Pass AccessControlStatus to compileModule() (Closed)
Patch Set: const Created 3 years, 8 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) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de)
3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org) 3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org)
4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org) 4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org)
5 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) 5 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
6 Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 6 Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
7 7
8 This library is free software; you can redistribute it and/or 8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Library General Public 9 modify it under the terms of the GNU Library General Public
10 License as published by the Free Software Foundation; either 10 License as published by the Free Software Foundation; either
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 101
102 // static 102 // static
103 bool ScriptResource::mimeTypeAllowedByNosniff( 103 bool ScriptResource::mimeTypeAllowedByNosniff(
104 const ResourceResponse& response) { 104 const ResourceResponse& response) {
105 return parseContentTypeOptionsHeader(response.httpHeaderField( 105 return parseContentTypeOptionsHeader(response.httpHeaderField(
106 HTTPNames::X_Content_Type_Options)) != ContentTypeOptionsNosniff || 106 HTTPNames::X_Content_Type_Options)) != ContentTypeOptionsNosniff ||
107 MIMETypeRegistry::isSupportedJavaScriptMIMEType( 107 MIMETypeRegistry::isSupportedJavaScriptMIMEType(
108 response.httpContentType()); 108 response.httpContentType());
109 } 109 }
110 110
111 AccessControlStatus ScriptResource::calculateAccessControlStatus(
112 const SecurityOrigin* securityOrigin) const {
113 if (response().wasFetchedViaServiceWorker()) {
114 if (response().serviceWorkerResponseType() ==
115 WebServiceWorkerResponseTypeOpaque) {
116 return OpaqueResource;
117 }
118
119 return SharableCrossOrigin;
120 }
121
122 if (passesAccessControlCheck(securityOrigin))
123 return SharableCrossOrigin;
124
125 return NotSharableCrossOrigin;
126 }
127
111 } // namespace blink 128 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698