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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
75 profile->GetExtensionService()->settings_frontend()-> | 75 profile->GetExtensionService()->settings_frontend()-> |
76 DeleteStorageSoon(extension_id); | 76 DeleteStorageSoon(extension_id); |
77 } | 77 } |
78 | 78 |
79 DataDeleter::DataDeleter( | 79 DataDeleter::DataDeleter( |
80 Profile* profile, | 80 Profile* profile, |
81 const std::string& extension_id, | 81 const std::string& extension_id, |
82 const GURL& storage_origin, | 82 const GURL& storage_origin, |
83 bool is_storage_isolated) | 83 bool is_storage_isolated) |
84 : extension_id_(extension_id) { | 84 : extension_id_(extension_id) { |
85 database_tracker_ = BrowserContext::GetDatabaseTracker(profile); | 85 // TODO(michaeln): use contexts from the right StoragePartition |
awong
2012/08/27 21:11:25
Capitalization and punctuation.
Also, if you want
michaeln
2012/08/27 22:09:57
Done.
| |
86 database_tracker_ = BrowserContext::GetDefaultStoragePartition(profile)-> | |
87 GetDatabaseTracker(); | |
86 // 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, |
87 // isolated app, or regular app. | 89 // isolated app, or regular app. |
88 if (storage_origin.SchemeIs(chrome::kExtensionScheme)) { | 90 if (storage_origin.SchemeIs(chrome::kExtensionScheme)) { |
89 extension_request_context_ = profile->GetRequestContextForExtensions(); | 91 extension_request_context_ = profile->GetRequestContextForExtensions(); |
90 } else if (is_storage_isolated) { | 92 } else if (is_storage_isolated) { |
91 extension_request_context_ = | 93 extension_request_context_ = |
92 profile->GetRequestContextForIsolatedApp(extension_id); | 94 profile->GetRequestContextForIsolatedApp(extension_id); |
93 isolated_app_path_ = profile->GetPath(). | 95 isolated_app_path_ = profile->GetPath(). |
94 Append(chrome::kIsolatedAppStateDirname).AppendASCII(extension_id); | 96 Append(chrome::kIsolatedAppStateDirname).AppendASCII(extension_id); |
95 } else { | 97 } else { |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
138 file_util::Delete(isolated_app_path_, true); | 140 file_util::Delete(isolated_app_path_, true); |
139 } | 141 } |
140 | 142 |
141 void DataDeleter::DeleteAppcachesOnIOThread(ResourceContext* context) { | 143 void DataDeleter::DeleteAppcachesOnIOThread(ResourceContext* context) { |
142 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 144 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
143 ResourceContext::GetAppCacheService(context)->DeleteAppCachesForOrigin( | 145 ResourceContext::GetAppCacheService(context)->DeleteAppCachesForOrigin( |
144 storage_origin_, net::CompletionCallback()); | 146 storage_origin_, net::CompletionCallback()); |
145 } | 147 } |
146 | 148 |
147 } // namespace extensions | 149 } // namespace extensions |
OLD | NEW |