| Index: extensions/browser/url_request_util.cc
|
| diff --git a/extensions/browser/url_request_util.cc b/extensions/browser/url_request_util.cc
|
| index 28d863389078857b11a65b32410543a20e7d433a..95b9131c7749b7ec1547226a5b000bc2ffefa579 100644
|
| --- a/extensions/browser/url_request_util.cc
|
| +++ b/extensions/browser/url_request_util.cc
|
| @@ -28,7 +28,7 @@ bool AllowCrossRendererResourceLoad(net::URLRequest* request,
|
| bool* allowed) {
|
| const content::ResourceRequestInfo* info =
|
| content::ResourceRequestInfo::ForRequest(request);
|
| - std::string resource_path = request->url().path();
|
| + base::StringPiece resource_path = request->url().path();
|
|
|
| // PlzNavigate: this logic is performed for main frame requests in
|
| // ExtensionNavigationThrottle::WillStartRequest.
|
| @@ -49,8 +49,8 @@ bool AllowCrossRendererResourceLoad(net::URLRequest* request,
|
| info->GetChildID(), &partition_id);
|
|
|
| if (AllowCrossRendererResourceLoadHelper(
|
| - is_guest, extension, owner_extension, partition_id, resource_path,
|
| - info->GetPageTransition(), allowed)) {
|
| + is_guest, extension, owner_extension, partition_id,
|
| + resource_path.as_string(), info->GetPageTransition(), allowed)) {
|
| return true;
|
| }
|
| }
|
| @@ -68,8 +68,9 @@ bool AllowCrossRendererResourceLoad(net::URLRequest* request,
|
| // some extensions want to be able to do things like create their own
|
| // launchers.
|
| std::string resource_root_relative_path =
|
| - request->url().path().empty() ? std::string()
|
| - : request->url().path().substr(1);
|
| + request->url().path().empty()
|
| + ? std::string()
|
| + : request->url().path().substr(1).as_string();
|
| if (extension->is_hosted_app() &&
|
| !IconsInfo::GetIcons(extension)
|
| .ContainsPath(resource_root_relative_path)) {
|
| @@ -103,8 +104,8 @@ bool AllowCrossRendererResourceLoad(net::URLRequest* request,
|
| }
|
|
|
| // Also allow if the file is explicitly listed as a web_accessible_resource.
|
| - if (WebAccessibleResourcesInfo::IsResourceWebAccessible(extension,
|
| - resource_path)) {
|
| + if (WebAccessibleResourcesInfo::IsResourceWebAccessible(
|
| + extension, resource_path.as_string())) {
|
| *allowed = true;
|
| return true;
|
| }
|
|
|