| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/api/declarative/rules_registry_service.h" | 5 #include "extensions/browser/api/declarative/rules_registry_service.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 // TODO(vabr): Remove once http://crbug.com/218451#c6 gets addressed. | 126 // TODO(vabr): Remove once http://crbug.com/218451#c6 gets addressed. |
| 127 rule_registries_.clear(); | 127 rule_registries_.clear(); |
| 128 content::BrowserThread::PostTask( | 128 content::BrowserThread::PostTask( |
| 129 content::BrowserThread::IO, FROM_HERE, | 129 content::BrowserThread::IO, FROM_HERE, |
| 130 base::Bind(&RegisterToExtensionWebRequestEventRouterOnIO, | 130 base::Bind(&RegisterToExtensionWebRequestEventRouterOnIO, |
| 131 browser_context_, | 131 browser_context_, |
| 132 RulesRegistryService::kDefaultRulesRegistryID, | 132 RulesRegistryService::kDefaultRulesRegistryID, |
| 133 scoped_refptr<WebRequestRulesRegistry>(NULL))); | 133 scoped_refptr<WebRequestRulesRegistry>(NULL))); |
| 134 } | 134 } |
| 135 | 135 |
| 136 static base::LazyInstance<BrowserContextKeyedAPIFactory<RulesRegistryService> > | 136 static base::LazyInstance<BrowserContextKeyedAPIFactory<RulesRegistryService>>:: |
| 137 g_factory = LAZY_INSTANCE_INITIALIZER; | 137 DestructorAtExit g_factory = LAZY_INSTANCE_INITIALIZER; |
| 138 | 138 |
| 139 // static | 139 // static |
| 140 BrowserContextKeyedAPIFactory<RulesRegistryService>* | 140 BrowserContextKeyedAPIFactory<RulesRegistryService>* |
| 141 RulesRegistryService::GetFactoryInstance() { | 141 RulesRegistryService::GetFactoryInstance() { |
| 142 return g_factory.Pointer(); | 142 return g_factory.Pointer(); |
| 143 } | 143 } |
| 144 | 144 |
| 145 // static | 145 // static |
| 146 RulesRegistryService* RulesRegistryService::Get( | 146 RulesRegistryService* RulesRegistryService::Get( |
| 147 content::BrowserContext* context) { | 147 content::BrowserContext* context) { |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 } | 229 } |
| 230 | 230 |
| 231 void RulesRegistryService::OnExtensionUninstalled( | 231 void RulesRegistryService::OnExtensionUninstalled( |
| 232 content::BrowserContext* browser_context, | 232 content::BrowserContext* browser_context, |
| 233 const Extension* extension, | 233 const Extension* extension, |
| 234 extensions::UninstallReason reason) { | 234 extensions::UninstallReason reason) { |
| 235 NotifyRegistriesHelper(&RulesRegistry::OnExtensionUninstalled, extension); | 235 NotifyRegistriesHelper(&RulesRegistry::OnExtensionUninstalled, extension); |
| 236 } | 236 } |
| 237 | 237 |
| 238 } // namespace extensions | 238 } // namespace extensions |
| OLD | NEW |