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

Side by Side Diff: extensions/browser/extension_protocols.cc

Issue 2441843002: Fix <webview> subframe resource loads with PlzNavigate. (Closed)
Patch Set: fix NavigationRequest to handle blocking, and fix unit tests Created 4 years, 1 month 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 | « content/browser/frame_host/navigation_request.cc ('k') | no next file » | 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 "extensions/browser/extension_protocols.h" 5 #include "extensions/browser/extension_protocols.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 18 matching lines...) Expand all
29 #include "base/strings/string_util.h" 29 #include "base/strings/string_util.h"
30 #include "base/strings/stringprintf.h" 30 #include "base/strings/stringprintf.h"
31 #include "base/strings/utf_string_conversions.h" 31 #include "base/strings/utf_string_conversions.h"
32 #include "base/threading/sequenced_worker_pool.h" 32 #include "base/threading/sequenced_worker_pool.h"
33 #include "base/threading/thread_restrictions.h" 33 #include "base/threading/thread_restrictions.h"
34 #include "base/timer/elapsed_timer.h" 34 #include "base/timer/elapsed_timer.h"
35 #include "build/build_config.h" 35 #include "build/build_config.h"
36 #include "content/public/browser/browser_thread.h" 36 #include "content/public/browser/browser_thread.h"
37 #include "content/public/browser/resource_request_info.h" 37 #include "content/public/browser/resource_request_info.h"
38 #include "content/public/common/browser_side_navigation_policy.h" 38 #include "content/public/common/browser_side_navigation_policy.h"
39 #include "content/public/common/resource_type.h"
39 #include "crypto/secure_hash.h" 40 #include "crypto/secure_hash.h"
40 #include "crypto/sha2.h" 41 #include "crypto/sha2.h"
41 #include "extensions/browser/content_verifier.h" 42 #include "extensions/browser/content_verifier.h"
42 #include "extensions/browser/content_verify_job.h" 43 #include "extensions/browser/content_verify_job.h"
43 #include "extensions/browser/extensions_browser_client.h" 44 #include "extensions/browser/extensions_browser_client.h"
44 #include "extensions/browser/info_map.h" 45 #include "extensions/browser/info_map.h"
45 #include "extensions/browser/url_request_util.h" 46 #include "extensions/browser/url_request_util.h"
46 #include "extensions/common/constants.h" 47 #include "extensions/common/constants.h"
47 #include "extensions/common/extension.h" 48 #include "extensions/common/extension.h"
48 #include "extensions/common/extension_resource.h" 49 #include "extensions/common/extension_resource.h"
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 // check, since the renderer can lie about which extension has made the 363 // check, since the renderer can lie about which extension has made the
363 // request. 364 // request.
364 if (extension_info_map->process_map().Contains( 365 if (extension_info_map->process_map().Contains(
365 request->url().host(), info->GetChildID())) { 366 request->url().host(), info->GetChildID())) {
366 return true; 367 return true;
367 } 368 }
368 369
369 // PlzNavigate: frame navigations to extensions have already been checked in 370 // PlzNavigate: frame navigations to extensions have already been checked in
370 // the ExtensionNavigationThrottle. 371 // the ExtensionNavigationThrottle.
371 if (info->GetChildID() == -1 && 372 if (info->GetChildID() == -1 &&
372 info->GetResourceType() == content::RESOURCE_TYPE_MAIN_FRAME && 373 content::IsResourceTypeFrame(info->GetResourceType()) &&
373 content::IsBrowserSideNavigationEnabled()) { 374 content::IsBrowserSideNavigationEnabled()) {
374 return true; 375 return true;
375 } 376 }
376 377
377 // Allow the extension module embedder to grant permission for loads. 378 // Allow the extension module embedder to grant permission for loads.
378 if (ExtensionsBrowserClient::Get()->AllowCrossRendererResourceLoad( 379 if (ExtensionsBrowserClient::Get()->AllowCrossRendererResourceLoad(
379 request, is_incognito, extension, extension_info_map)) { 380 request, is_incognito, extension, extension_info_map)) {
380 return true; 381 return true;
381 } 382 }
382 383
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
583 } 584 }
584 585
585 std::unique_ptr<net::URLRequestJobFactory::ProtocolHandler> 586 std::unique_ptr<net::URLRequestJobFactory::ProtocolHandler>
586 CreateExtensionProtocolHandler(bool is_incognito, 587 CreateExtensionProtocolHandler(bool is_incognito,
587 extensions::InfoMap* extension_info_map) { 588 extensions::InfoMap* extension_info_map) {
588 return base::MakeUnique<ExtensionProtocolHandler>(is_incognito, 589 return base::MakeUnique<ExtensionProtocolHandler>(is_incognito,
589 extension_info_map); 590 extension_info_map);
590 } 591 }
591 592
592 } // namespace extensions 593 } // namespace extensions
OLDNEW
« no previous file with comments | « content/browser/frame_host/navigation_request.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698