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

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

Issue 468033002: Remove worker process related codes from ContentBrowserClient. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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 // 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/url_request_util.h" 5 #include "chrome/browser/extensions/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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 namespace extensions { 133 namespace extensions {
134 namespace url_request_util { 134 namespace url_request_util {
135 135
136 bool AllowCrossRendererResourceLoad(net::URLRequest* request, 136 bool AllowCrossRendererResourceLoad(net::URLRequest* request,
137 bool is_incognito, 137 bool is_incognito,
138 const Extension* extension, 138 const Extension* extension,
139 InfoMap* extension_info_map) { 139 InfoMap* extension_info_map) {
140 const content::ResourceRequestInfo* info = 140 const content::ResourceRequestInfo* info =
141 content::ResourceRequestInfo::ForRequest(request); 141 content::ResourceRequestInfo::ForRequest(request);
142 142
143 // Check workers so that importScripts works from extension workers.
144 if (extension_info_map->worker_process_map().Contains(request->url().host(),
145 info->GetChildID())) {
146 return true;
147 }
148
149 bool is_guest = false; 143 bool is_guest = false;
150 144
151 // Extensions with webview: allow loading certain resources by guest renderers 145 // Extensions with webview: allow loading certain resources by guest renderers
152 // with privileged partition IDs as specified in the manifest file. 146 // with privileged partition IDs as specified in the manifest file.
153 WebViewRendererState* web_view_renderer_state = 147 WebViewRendererState* web_view_renderer_state =
154 WebViewRendererState::GetInstance(); 148 WebViewRendererState::GetInstance();
155 std::string partition_id; 149 std::string partition_id;
156 is_guest = web_view_renderer_state->GetPartitionID(info->GetChildID(), 150 is_guest = web_view_renderer_state->GetPartitionID(info->GetChildID(),
157 &partition_id); 151 &partition_id);
158 std::string resource_path = request->url().path(); 152 std::string resource_path = request->url().path();
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 const content::ResourceRequestInfo* info = 243 const content::ResourceRequestInfo* info =
250 content::ResourceRequestInfo::ForRequest(request); 244 content::ResourceRequestInfo::ForRequest(request);
251 // |info| can be NULL sometimes: http://crbug.com/370070. 245 // |info| can be NULL sometimes: http://crbug.com/370070.
252 if (!info) 246 if (!info)
253 return false; 247 return false;
254 return WebViewRendererState::GetInstance()->IsGuest(info->GetChildID()); 248 return WebViewRendererState::GetInstance()->IsGuest(info->GetChildID());
255 } 249 }
256 250
257 } // namespace url_request_util 251 } // namespace url_request_util
258 } // namespace extensions 252 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698