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

Unified Diff: extensions/browser/extension_navigation_throttle.cc

Issue 2048693004: Check for registry and extension existence before web_accessible_resources. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/extension_navigation_throttle.cc
diff --git a/extensions/browser/extension_navigation_throttle.cc b/extensions/browser/extension_navigation_throttle.cc
index 3c63dd76bf152bc75bef182b82b3a6b1fd2b09ca..235c779cafb7aa859eef19f844940fe92ac57c7d 100644
--- a/extensions/browser/extension_navigation_throttle.cc
+++ b/extensions/browser/extension_navigation_throttle.cc
@@ -78,9 +78,14 @@ ExtensionNavigationThrottle::WillStartRequest() {
std::string resource_path = navigation_handle()->GetURL().path();
ExtensionRegistry* registry = ExtensionRegistry::Get(
navigation_handle()->GetWebContents()->GetBrowserContext());
+ if (!registry)
+ return content::NavigationThrottle::BLOCK_REQUEST;
asargent_no_longer_on_chrome 2016/06/08 18:30:13 Off the top of my head I can't think of situations
+
const extensions::Extension* extension =
registry->enabled_extensions().GetByID(
navigation_handle()->GetURL().host());
+ if (!extension)
+ return content::NavigationThrottle::BLOCK_REQUEST;
if (WebAccessibleResourcesInfo::IsResourceWebAccessible(extension,
resource_path)) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698