| 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 database_tracker_ = BrowserContext::GetDefaultStoragePartition(profile)-> | 86 database_tracker_ = BrowserContext::GetDefaultStoragePartition(profile)-> |
| 87 GetDatabaseTracker(); | 87 GetDatabaseTracker(); |
| 88 // 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, |
| 89 // isolated app, or regular app. | 89 // isolated app, or regular app. |
| 90 content::StoragePartition* storage_partition = | 90 content::StoragePartition* storage_partition = |
| 91 BrowserContext::GetDefaultStoragePartition(profile); | 91 BrowserContext::GetDefaultStoragePartition(profile); |
| 92 if (storage_origin.SchemeIs(chrome::kExtensionScheme)) { | 92 if (storage_origin.SchemeIs(chrome::kExtensionScheme)) { |
| 93 extension_request_context_ = profile->GetRequestContextForExtensions(); | 93 extension_request_context_ = profile->GetRequestContextForExtensions(); |
| 94 } else if (is_storage_isolated) { | 94 } else if (is_storage_isolated) { |
| 95 extension_request_context_ = | 95 extension_request_context_ = |
| 96 profile->GetRequestContextForIsolatedApp(extension_id); | 96 profile->GetRequestContextForStoragePartition(extension_id); |
| 97 isolated_app_path_ = | 97 isolated_app_path_ = |
| 98 profile->GetPath().Append( | 98 profile->GetPath().Append( |
| 99 content::StoragePartition::GetPartitionPath(extension_id)); | 99 content::StoragePartition::GetPartitionPath(extension_id)); |
| 100 } else { | 100 } else { |
| 101 extension_request_context_ = profile->GetRequestContext(); | 101 extension_request_context_ = profile->GetRequestContext(); |
| 102 } | 102 } |
| 103 | 103 file_system_context_ = storage_partition->GetFileSystemContext(); |
| 104 file_system_context_ = BrowserContext::GetFileSystemContext(profile); | |
| 105 indexed_db_context_ = storage_partition->GetIndexedDBContext(); | 104 indexed_db_context_ = storage_partition->GetIndexedDBContext(); |
| 106 | 105 |
| 107 storage_origin_ = storage_origin; | 106 storage_origin_ = storage_origin; |
| 108 origin_id_ = | 107 origin_id_ = |
| 109 webkit_database::DatabaseUtil::GetOriginIdentifier(storage_origin_); | 108 webkit_database::DatabaseUtil::GetOriginIdentifier(storage_origin_); |
| 110 } | 109 } |
| 111 | 110 |
| 112 DataDeleter::~DataDeleter() { | 111 DataDeleter::~DataDeleter() { |
| 113 } | 112 } |
| 114 | 113 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 } | 145 } |
| 147 | 146 |
| 148 void DataDeleter::DeleteAppcachesOnIOThread( | 147 void DataDeleter::DeleteAppcachesOnIOThread( |
| 149 appcache::AppCacheService* appcache_service) { | 148 appcache::AppCacheService* appcache_service) { |
| 150 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 149 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 151 appcache_service->DeleteAppCachesForOrigin(storage_origin_, | 150 appcache_service->DeleteAppCachesForOrigin(storage_origin_, |
| 152 net::CompletionCallback()); | 151 net::CompletionCallback()); |
| 153 } | 152 } |
| 154 | 153 |
| 155 } // namespace extensions | 154 } // namespace extensions |
| OLD | NEW |