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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 // http://crbug.com/85127 | 86 // http://crbug.com/85127 |
87 database_tracker_ = BrowserContext::GetDefaultStoragePartition(profile)-> | 87 database_tracker_ = BrowserContext::GetDefaultStoragePartition(profile)-> |
88 GetDatabaseTracker(); | 88 GetDatabaseTracker(); |
89 // Pick the right request context depending on whether it's an extension, | 89 // Pick the right request context depending on whether it's an extension, |
90 // isolated app, or regular app. | 90 // isolated app, or regular app. |
91 if (storage_origin.SchemeIs(chrome::kExtensionScheme)) { | 91 if (storage_origin.SchemeIs(chrome::kExtensionScheme)) { |
92 extension_request_context_ = profile->GetRequestContextForExtensions(); | 92 extension_request_context_ = profile->GetRequestContextForExtensions(); |
93 } else if (is_storage_isolated) { | 93 } else if (is_storage_isolated) { |
94 extension_request_context_ = | 94 extension_request_context_ = |
95 profile->GetRequestContextForIsolatedApp(extension_id); | 95 profile->GetRequestContextForIsolatedApp(extension_id); |
96 isolated_app_path_ = profile->GetPath(). | 96 isolated_app_path_ = |
97 Append(content::kStoragePartitionDirname).AppendASCII(extension_id); | 97 profile->GetPath().Append( |
| 98 content::StoragePartition::GetPartitionPath(extension_id)); |
98 } else { | 99 } else { |
99 extension_request_context_ = profile->GetRequestContext(); | 100 extension_request_context_ = profile->GetRequestContext(); |
100 } | 101 } |
101 file_system_context_ = BrowserContext::GetFileSystemContext(profile); | 102 file_system_context_ = BrowserContext::GetFileSystemContext(profile); |
102 storage_origin_ = storage_origin; | 103 storage_origin_ = storage_origin; |
103 origin_id_ = | 104 origin_id_ = |
104 webkit_database::DatabaseUtil::GetOriginIdentifier(storage_origin_); | 105 webkit_database::DatabaseUtil::GetOriginIdentifier(storage_origin_); |
105 } | 106 } |
106 | 107 |
107 DataDeleter::~DataDeleter() { | 108 DataDeleter::~DataDeleter() { |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 } | 143 } |
143 | 144 |
144 void DataDeleter::DeleteAppcachesOnIOThread( | 145 void DataDeleter::DeleteAppcachesOnIOThread( |
145 appcache::AppCacheService* appcache_service) { | 146 appcache::AppCacheService* appcache_service) { |
146 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 147 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
147 appcache_service->DeleteAppCachesForOrigin(storage_origin_, | 148 appcache_service->DeleteAppCachesForOrigin(storage_origin_, |
148 net::CompletionCallback()); | 149 net::CompletionCallback()); |
149 } | 150 } |
150 | 151 |
151 } // namespace extensions | 152 } // namespace extensions |
OLD | NEW |