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_process_manager.h" |
9 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
10 #include "chrome/browser/extensions/settings/settings_frontend.h" | 11 #include "chrome/browser/extensions/settings/settings_frontend.h" |
11 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
12 #include "chrome/common/chrome_constants.h" | 13 #include "chrome/common/chrome_constants.h" |
13 #include "chrome/common/extensions/extension.h" | 14 #include "chrome/common/extensions/extension.h" |
14 #include "chrome/common/url_constants.h" | 15 #include "chrome/common/url_constants.h" |
15 #include "content/public/browser/dom_storage_context.h" | 16 #include "content/public/browser/dom_storage_context.h" |
16 #include "content/public/browser/indexed_db_context.h" | 17 #include "content/public/browser/indexed_db_context.h" |
| 18 #include "content/public/browser/resource_context.h" |
| 19 #include "content/public/browser/site_instance.h" |
17 #include "content/public/browser/storage_partition.h" | 20 #include "content/public/browser/storage_partition.h" |
18 #include "content/public/common/content_constants.h" | 21 #include "content/public/common/content_constants.h" |
19 #include "net/base/completion_callback.h" | 22 #include "net/base/completion_callback.h" |
20 #include "net/base/net_errors.h" | 23 #include "net/base/net_errors.h" |
21 #include "net/cookies/cookie_monster.h" | 24 #include "net/cookies/cookie_monster.h" |
22 #include "net/url_request/url_request_context.h" | 25 #include "net/url_request/url_request_context.h" |
23 #include "net/url_request/url_request_context_getter.h" | 26 #include "net/url_request/url_request_context_getter.h" |
24 #include "webkit/appcache/appcache_service.h" | 27 #include "webkit/appcache/appcache_service.h" |
25 #include "webkit/database/database_tracker.h" | 28 #include "webkit/database/database_tracker.h" |
26 #include "webkit/database/database_util.h" | 29 #include "webkit/database/database_util.h" |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 if (storage_origin.SchemeIs(chrome::kExtensionScheme)) { | 94 if (storage_origin.SchemeIs(chrome::kExtensionScheme)) { |
92 extension_request_context_ = profile->GetRequestContextForExtensions(); | 95 extension_request_context_ = profile->GetRequestContextForExtensions(); |
93 } else if (is_storage_isolated) { | 96 } else if (is_storage_isolated) { |
94 extension_request_context_ = | 97 extension_request_context_ = |
95 profile->GetRequestContextForIsolatedApp(extension_id); | 98 profile->GetRequestContextForIsolatedApp(extension_id); |
96 isolated_app_path_ = profile->GetPath(). | 99 isolated_app_path_ = profile->GetPath(). |
97 Append(content::kStoragePartitionDirname).AppendASCII(extension_id); | 100 Append(content::kStoragePartitionDirname).AppendASCII(extension_id); |
98 } else { | 101 } else { |
99 extension_request_context_ = profile->GetRequestContext(); | 102 extension_request_context_ = profile->GetRequestContext(); |
100 } | 103 } |
101 file_system_context_ = BrowserContext::GetFileSystemContext(profile); | 104 file_system_context_ = |
| 105 BrowserContext::GetDefaultStoragePartition(profile)-> |
| 106 GetFileSystemContext(); |
102 storage_origin_ = storage_origin; | 107 storage_origin_ = storage_origin; |
103 origin_id_ = | 108 origin_id_ = |
104 webkit_database::DatabaseUtil::GetOriginIdentifier(storage_origin_); | 109 webkit_database::DatabaseUtil::GetOriginIdentifier(storage_origin_); |
105 } | 110 } |
106 | 111 |
107 DataDeleter::~DataDeleter() { | 112 DataDeleter::~DataDeleter() { |
108 } | 113 } |
109 | 114 |
110 void DataDeleter::DeleteCookiesOnIOThread() { | 115 void DataDeleter::DeleteCookiesOnIOThread() { |
111 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 116 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
(...skipping 30 matching lines...) Expand all Loading... |
142 } | 147 } |
143 | 148 |
144 void DataDeleter::DeleteAppcachesOnIOThread( | 149 void DataDeleter::DeleteAppcachesOnIOThread( |
145 appcache::AppCacheService* appcache_service) { | 150 appcache::AppCacheService* appcache_service) { |
146 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 151 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
147 appcache_service->DeleteAppCachesForOrigin(storage_origin_, | 152 appcache_service->DeleteAppCachesForOrigin(storage_origin_, |
148 net::CompletionCallback()); | 153 net::CompletionCallback()); |
149 } | 154 } |
150 | 155 |
151 } // namespace extensions | 156 } // namespace extensions |
OLD | NEW |