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

Unified Diff: extensions/browser/api/vpn_provider/vpn_service.cc

Issue 1028213002: Destroy configurations created by VPN extension on disable (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 | « extensions/browser/api/vpn_provider/vpn_service.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/api/vpn_provider/vpn_service.cc
diff --git a/extensions/browser/api/vpn_provider/vpn_service.cc b/extensions/browser/api/vpn_provider/vpn_service.cc
index 1e94b18fc73937a948ee328e69d538610abe8e27..9c0aad716b5190594eb601f904be47e9a3757b8d 100644
--- a/extensions/browser/api/vpn_provider/vpn_service.cc
+++ b/extensions/browser/api/vpn_provider/vpn_service.cc
@@ -431,15 +431,8 @@ bool VpnService::VerifyConfigIsConnectedForTesting(
return DoesActiveConfigurationExistAndIsAccessAuthorized(extension_id);
}
-void VpnService::OnExtensionUninstalled(
- content::BrowserContext* browser_context,
- const extensions::Extension* extension,
- extensions::UninstallReason reason) {
- if (browser_context != browser_context_) {
- NOTREACHED();
- return;
- }
-
+void VpnService::DestroyConfigurationsForExtension(
+ const extensions::Extension* extension) {
std::vector<VpnConfiguration*> to_be_destroyed;
for (const auto& iter : key_to_configuration_map_) {
if (iter.second->extension_id() == extension->id()) {
@@ -455,6 +448,18 @@ void VpnService::OnExtensionUninstalled(
}
}
+void VpnService::OnExtensionUninstalled(
+ content::BrowserContext* browser_context,
+ const extensions::Extension* extension,
+ extensions::UninstallReason reason) {
+ if (browser_context != browser_context_) {
+ NOTREACHED();
+ return;
+ }
+
+ DestroyConfigurationsForExtension(extension);
+}
+
void VpnService::OnExtensionUnloaded(
content::BrowserContext* browser_context,
const extensions::Extension* extension,
@@ -471,6 +476,9 @@ void VpnService::OnExtensionUnloaded(
static_cast<uint32_t>(api_vpn::VPN_CONNECTION_STATE_FAILURE),
base::Bind(base::DoNothing), base::Bind(DoNothingFailureCallback));
}
+ if (extension_registry_->disabled_extensions().Contains(extension->id())) {
pneubeck (no reviews) 2015/03/24 08:55:25 The documentation at ExtensionRegistryObserver::O
kaliamoorthi 2015/03/24 10:14:46 We discussed this.
+ DestroyConfigurationsForExtension(extension);
+ }
pneubeck (no reviews) 2015/03/24 08:55:25 nit: remove {}
kaliamoorthi 2015/03/24 10:14:46 This is not relevant anymore.
}
void VpnService::OnCreateConfigurationSuccess(
« no previous file with comments | « extensions/browser/api/vpn_provider/vpn_service.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698