| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |