Commit 2f9e0c10 authored by Evan Stade's avatar Evan Stade Committed by Commit Bot

Fix crash when an orphaned extension has a content script

Bug: 1036028
Change-Id: If402bda0f6532f1254a710223ff66bb77e0cf15f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2079530Reviewed-by: default avatarDevlin <rdevlin.cronin@chromium.org>
Commit-Queue: Evan Stade <estade@chromium.org>
Cr-Commit-Position: refs/heads/master@{#745633}
parent afa3544a
...@@ -237,6 +237,12 @@ void UserScriptListener::OnExtensionUnloaded( ...@@ -237,6 +237,12 @@ void UserScriptListener::OnExtensionUnloaded(
if (ContentScriptsInfo::GetContentScripts(extension).empty()) if (ContentScriptsInfo::GetContentScripts(extension).empty())
return; // No patterns to delete for this extension. return; // No patterns to delete for this extension.
// It's possible to unload extensions before loading extensions when the
// ExtensionService uninstalls an orphaned extension. In this case we don't
// need to update |profile_data_|. See crbug.com/1036028
if (profile_data_.count(browser_context) == 0)
return;
// Clear all our patterns and reregister all the still-loaded extensions. // Clear all our patterns and reregister all the still-loaded extensions.
const ExtensionSet& extensions = const ExtensionSet& extensions =
ExtensionRegistry::Get(browser_context)->enabled_extensions(); ExtensionRegistry::Get(browser_context)->enabled_extensions();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment