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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "chrome/browser/extensions/extension_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" |
10 #include "chrome/browser/extensions/settings/settings_frontend.h" | 10 #include "chrome/browser/extensions/settings/settings_frontend.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 profile->GetExtensionService()->settings_frontend()-> | 74 profile->GetExtensionService()->settings_frontend()-> |
75 DeleteStorageSoon(extension_id); | 75 DeleteStorageSoon(extension_id); |
76 } | 76 } |
77 | 77 |
78 DataDeleter::DataDeleter( | 78 DataDeleter::DataDeleter( |
79 Profile* profile, | 79 Profile* profile, |
80 const std::string& extension_id, | 80 const std::string& extension_id, |
81 const GURL& storage_origin, | 81 const GURL& storage_origin, |
82 bool is_storage_isolated) | 82 bool is_storage_isolated) |
83 : extension_id_(extension_id) { | 83 : extension_id_(extension_id) { |
84 database_tracker_ = BrowserContext::GetDatabaseTracker(profile); | 84 // TODO(michaeln): Delete from the right StoragePartition. |
| 85 // http://crbug.com/85127 |
| 86 database_tracker_ = BrowserContext::GetDefaultStoragePartition(profile)-> |
| 87 GetDatabaseTracker(); |
85 // Pick the right request context depending on whether it's an extension, | 88 // Pick the right request context depending on whether it's an extension, |
86 // isolated app, or regular app. | 89 // isolated app, or regular app. |
87 if (storage_origin.SchemeIs(chrome::kExtensionScheme)) { | 90 if (storage_origin.SchemeIs(chrome::kExtensionScheme)) { |
88 extension_request_context_ = profile->GetRequestContextForExtensions(); | 91 extension_request_context_ = profile->GetRequestContextForExtensions(); |
89 } else if (is_storage_isolated) { | 92 } else if (is_storage_isolated) { |
90 extension_request_context_ = | 93 extension_request_context_ = |
91 profile->GetRequestContextForIsolatedApp(extension_id); | 94 profile->GetRequestContextForIsolatedApp(extension_id); |
92 isolated_app_path_ = profile->GetPath(). | 95 isolated_app_path_ = profile->GetPath(). |
93 Append(chrome::kIsolatedAppStateDirname).AppendASCII(extension_id); | 96 Append(chrome::kIsolatedAppStateDirname).AppendASCII(extension_id); |
94 } else { | 97 } else { |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 } | 141 } |
139 | 142 |
140 void DataDeleter::DeleteAppcachesOnIOThread( | 143 void DataDeleter::DeleteAppcachesOnIOThread( |
141 appcache::AppCacheService* appcache_service) { | 144 appcache::AppCacheService* appcache_service) { |
142 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 145 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
143 appcache_service->DeleteAppCachesForOrigin(storage_origin_, | 146 appcache_service->DeleteAppCachesForOrigin(storage_origin_, |
144 net::CompletionCallback()); | 147 net::CompletionCallback()); |
145 } | 148 } |
146 | 149 |
147 } // namespace extensions | 150 } // namespace extensions |
OLD | NEW |