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 20 matching lines...) Expand all Loading... |
31 | 31 |
32 namespace extensions { | 32 namespace extensions { |
33 | 33 |
34 namespace { | 34 namespace { |
35 | 35 |
36 // Helper function that deletes data of a given |storage_origin| in a given | 36 // Helper function that deletes data of a given |storage_origin| in a given |
37 // |partition|. | 37 // |partition|. |
38 void DeleteOrigin(Profile* profile, | 38 void DeleteOrigin(Profile* profile, |
39 StoragePartition* partition, | 39 StoragePartition* partition, |
40 const GURL& origin) { | 40 const GURL& origin) { |
41 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 41 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
42 DCHECK(profile); | 42 DCHECK(profile); |
43 DCHECK(partition); | 43 DCHECK(partition); |
44 | 44 |
45 if (origin.SchemeIs(kExtensionScheme)) { | 45 if (origin.SchemeIs(kExtensionScheme)) { |
46 // TODO(ajwong): Cookies are not properly isolated for | 46 // TODO(ajwong): Cookies are not properly isolated for |
47 // chrome-extension:// scheme. (http://crbug.com/158386). | 47 // chrome-extension:// scheme. (http://crbug.com/158386). |
48 // | 48 // |
49 // However, no isolated apps actually can write to kExtensionScheme | 49 // However, no isolated apps actually can write to kExtensionScheme |
50 // origins. Thus, it is benign to delete from the | 50 // origins. Thus, it is benign to delete from the |
51 // RequestContextForExtensions because there's nothing stored there. We | 51 // RequestContextForExtensions because there's nothing stored there. We |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 #if defined(ENABLE_EXTENSIONS) | 109 #if defined(ENABLE_EXTENSIONS) |
110 // Begin removal of the settings for the current extension. | 110 // Begin removal of the settings for the current extension. |
111 // StorageFrontend may not exist in unit tests. | 111 // StorageFrontend may not exist in unit tests. |
112 StorageFrontend* frontend = StorageFrontend::Get(profile); | 112 StorageFrontend* frontend = StorageFrontend::Get(profile); |
113 if (frontend) | 113 if (frontend) |
114 frontend->DeleteStorageSoon(extension->id()); | 114 frontend->DeleteStorageSoon(extension->id()); |
115 #endif // defined(ENABLE_EXTENSIONS) | 115 #endif // defined(ENABLE_EXTENSIONS) |
116 } | 116 } |
117 | 117 |
118 } // namespace extensions | 118 } // namespace extensions |
OLD | NEW |