| 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 "chrome/browser/extensions/data_deleter.h" | 5 #include "chrome/browser/extensions/data_deleter.h" |
| 6 | 6 |
| 7 #include "chrome/browser/extensions/extension_service.h" | 7 #include "chrome/browser/extensions/extension_service.h" |
| 8 #include "chrome/browser/extensions/extension_special_storage_policy.h" | 8 #include "chrome/browser/extensions/extension_special_storage_policy.h" |
| 9 #include "chrome/browser/extensions/extension_util.h" | 9 #include "chrome/browser/extensions/extension_util.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 } | 68 } |
| 69 } | 69 } |
| 70 | 70 |
| 71 void OnNeedsToGarbageCollectIsolatedStorage(WeakPtr<ExtensionService> es, | 71 void OnNeedsToGarbageCollectIsolatedStorage(WeakPtr<ExtensionService> es, |
| 72 const base::Closure& callback) { | 72 const base::Closure& callback) { |
| 73 if (es) | 73 if (es) |
| 74 ExtensionPrefs::Get(es->profile())->SetNeedsStorageGarbageCollection(true); | 74 ExtensionPrefs::Get(es->profile())->SetNeedsStorageGarbageCollection(true); |
| 75 callback.Run(); | 75 callback.Run(); |
| 76 } | 76 } |
| 77 | 77 |
| 78 } // namespace | 78 } // namespace |
| 79 | 79 |
| 80 // static | 80 // static |
| 81 void DataDeleter::StartDeleting(Profile* profile, | 81 void DataDeleter::StartDeleting(Profile* profile, |
| 82 const Extension* extension, | 82 const Extension* extension, |
| 83 const base::Closure& callback) { | 83 const base::Closure& callback) { |
| 84 DCHECK(profile); | 84 DCHECK(profile); |
| 85 DCHECK(extension); | 85 DCHECK(extension); |
| 86 | 86 |
| 87 if (AppIsolationInfo::HasIsolatedStorage(extension)) { | 87 if (AppIsolationInfo::HasIsolatedStorage(extension)) { |
| 88 BrowserContext::AsyncObliterateStoragePartition( | 88 BrowserContext::AsyncObliterateStoragePartition( |
| (...skipping 15 matching lines...) Expand all Loading... |
| 104 !profile->GetExtensionSpecialStoragePolicy()-> | 104 !profile->GetExtensionSpecialStoragePolicy()-> |
| 105 IsStorageProtected(launch_web_url_origin)) { | 105 IsStorageProtected(launch_web_url_origin)) { |
| 106 DeleteOrigin(profile, | 106 DeleteOrigin(profile, |
| 107 partition, | 107 partition, |
| 108 launch_web_url_origin, | 108 launch_web_url_origin, |
| 109 base::Bind(&base::DoNothing)); | 109 base::Bind(&base::DoNothing)); |
| 110 } | 110 } |
| 111 DeleteOrigin(profile, partition, extension->url(), callback); | 111 DeleteOrigin(profile, partition, extension->url(), callback); |
| 112 } | 112 } |
| 113 | 113 |
| 114 #if defined(ENABLE_EXTENSIONS) | |
| 115 // Begin removal of the settings for the current extension. | 114 // Begin removal of the settings for the current extension. |
| 116 // StorageFrontend may not exist in unit tests. | 115 // StorageFrontend may not exist in unit tests. |
| 117 StorageFrontend* frontend = StorageFrontend::Get(profile); | 116 StorageFrontend* frontend = StorageFrontend::Get(profile); |
| 118 if (frontend) | 117 if (frontend) |
| 119 frontend->DeleteStorageSoon(extension->id()); | 118 frontend->DeleteStorageSoon(extension->id()); |
| 120 #endif // defined(ENABLE_EXTENSIONS) | |
| 121 } | 119 } |
| 122 | 120 |
| 123 } // namespace extensions | 121 } // namespace extensions |
| OLD | NEW |