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

Side by Side Diff: chrome/browser/extensions/chrome_url_request_util.cc

Issue 2261043002: Do not immediately block cross-renderer extension resource loads for non-web-triggered transitions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2785
Patch Set: Created 4 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
« no previous file with comments | « no previous file | extensions/browser/url_request_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/extensions/chrome_url_request_util.h" 5 #include "chrome/browser/extensions/chrome_url_request_util.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 InfoMap* extension_info_map, 132 InfoMap* extension_info_map,
133 bool* allowed) { 133 bool* allowed) {
134 if (url_request_util::AllowCrossRendererResourceLoad( 134 if (url_request_util::AllowCrossRendererResourceLoad(
135 request, is_incognito, extension, extension_info_map, allowed)) { 135 request, is_incognito, extension, extension_info_map, allowed)) {
136 return true; 136 return true;
137 } 137 }
138 138
139 // If there aren't any explicitly marked web accessible resources, the 139 // If there aren't any explicitly marked web accessible resources, the
140 // load should be allowed only if it is by DevTools. A close approximation is 140 // load should be allowed only if it is by DevTools. A close approximation is
141 // checking if the extension contains a DevTools page. 141 // checking if the extension contains a DevTools page.
142 if (!chrome_manifest_urls::GetDevToolsPage(extension).is_empty()) { 142 if (extension &&
143 !chrome_manifest_urls::GetDevToolsPage(extension).is_empty()) {
143 *allowed = true; 144 *allowed = true;
144 return true; 145 return true;
145 } 146 }
146 147
147 // Couldn't determine if the resource is allowed or not. 148 // Couldn't determine if the resource is allowed or not.
148 return false; 149 return false;
149 } 150 }
150 151
151 net::URLRequestJob* MaybeCreateURLRequestResourceBundleJob( 152 net::URLRequestJob* MaybeCreateURLRequestResourceBundleJob(
152 net::URLRequest* request, 153 net::URLRequest* request,
(...skipping 26 matching lines...) Expand all
179 resource_id, 180 resource_id,
180 content_security_policy, 181 content_security_policy,
181 send_cors_header); 182 send_cors_header);
182 } 183 }
183 } 184 }
184 return NULL; 185 return NULL;
185 } 186 }
186 187
187 } // namespace chrome_url_request_util 188 } // namespace chrome_url_request_util
188 } // namespace extensions 189 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | extensions/browser/url_request_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698