| Index: chrome/browser/extensions/extension_system_impl.cc
|
| diff --git a/chrome/browser/extensions/extension_system_impl.cc b/chrome/browser/extensions/extension_system_impl.cc
|
| index fa7596f5ad8971e9170674d058eb884391aea2e6..b806532e7e0a2c90d9114fa3ae1e2e318f1e7c45 100644
|
| --- a/chrome/browser/extensions/extension_system_impl.cc
|
| +++ b/chrome/browser/extensions/extension_system_impl.cc
|
| @@ -17,6 +17,7 @@
|
| #include "build/build_config.h"
|
| #include "chrome/browser/browser_process.h"
|
| #include "chrome/browser/extensions/chrome_app_sorting.h"
|
| +#include "chrome/browser/extensions/chrome_content_browser_client_extensions_part.h"
|
| #include "chrome/browser/extensions/chrome_content_verifier_delegate.h"
|
| #include "chrome/browser/extensions/component_loader.h"
|
| #include "chrome/browser/extensions/extension_error_reporter.h"
|
| @@ -457,9 +458,10 @@ void ExtensionSystemImpl::RegisterExtensionWithRequestContexts(
|
|
|
| BrowserThread::PostTaskAndReply(
|
| BrowserThread::IO, FROM_HERE,
|
| - base::Bind(&InfoMap::AddExtension, info_map(),
|
| - base::RetainedRef(extension), install_time, incognito_enabled,
|
| - notifications_disabled),
|
| + base::Bind(&ExtensionSystemImpl::RegisterExtensionHelper,
|
| + base::RetainedRef(info_map()), base::RetainedRef(extension),
|
| + install_time, incognito_enabled, notifications_disabled,
|
| + profile_->GetResourceContext()),
|
| callback);
|
| }
|
|
|
| @@ -467,9 +469,38 @@ void ExtensionSystemImpl::UnregisterExtensionWithRequestContexts(
|
| const std::string& extension_id,
|
| const UnloadedExtensionInfo::Reason reason) {
|
| BrowserThread::PostTask(
|
| - BrowserThread::IO,
|
| - FROM_HERE,
|
| - base::Bind(&InfoMap::RemoveExtension, info_map(), extension_id, reason));
|
| + BrowserThread::IO, FROM_HERE,
|
| + base::Bind(&ExtensionSystemImpl::UnregisterExtensionHelper,
|
| + base::RetainedRef(info_map()), extension_id, reason,
|
| + profile_->GetResourceContext()));
|
| +}
|
| +
|
| +// static
|
| +void ExtensionSystemImpl::RegisterExtensionHelper(
|
| + InfoMap* info_map,
|
| + const Extension* extension,
|
| + base::Time install_time,
|
| + bool incognito_enabled,
|
| + bool notifications_disabled,
|
| + const content::ResourceContext* context) {
|
| + DCHECK_CURRENTLY_ON(BrowserThread::IO);
|
| +
|
| + info_map->AddExtension(extension, install_time, incognito_enabled,
|
| + notifications_disabled);
|
| + ChromeContentBrowserClientExtensionsPart::AddExtension(context, extension);
|
| +}
|
| +
|
| +// static
|
| +void ExtensionSystemImpl::UnregisterExtensionHelper(
|
| + InfoMap* info_map,
|
| + const std::string& extension_id,
|
| + const UnloadedExtensionInfo::Reason reason,
|
| + const content::ResourceContext* context) {
|
| + DCHECK_CURRENTLY_ON(BrowserThread::IO);
|
| +
|
| + info_map->RemoveExtension(extension_id, reason);
|
| + ChromeContentBrowserClientExtensionsPart::RemoveExtension(context,
|
| + extension_id);
|
| }
|
|
|
| } // namespace extensions
|
|
|