OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/extension_data_deleter.h" | 5 #include "chrome/browser/extensions/extension_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/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
11 #include "chrome/browser/extensions/settings/settings_frontend.h" | 11 #include "chrome/browser/extensions/settings/settings_frontend.h" |
12 #include "chrome/common/chrome_constants.h" | 12 #include "chrome/common/chrome_constants.h" |
13 #include "chrome/common/extensions/extension.h" | 13 #include "chrome/common/extensions/extension.h" |
14 #include "chrome/common/url_constants.h" | 14 #include "chrome/common/url_constants.h" |
15 #include "content/browser/appcache/chrome_appcache_service.h" | 15 #include "content/browser/appcache/chrome_appcache_service.h" |
16 #include "content/browser/in_process_webkit/webkit_context.h" | 16 #include "content/browser/in_process_webkit/webkit_context.h" |
17 #include "net/base/cookie_monster.h" | 17 #include "net/base/cookie_monster.h" |
18 #include "net/base/net_errors.h" | 18 #include "net/base/net_errors.h" |
19 #include "net/url_request/url_request_context.h" | 19 #include "net/url_request/url_request_context.h" |
20 #include "net/url_request/url_request_context_getter.h" | 20 #include "net/url_request/url_request_context_getter.h" |
21 #include "webkit/database/database_tracker.h" | 21 #include "webkit/database/database_tracker.h" |
22 #include "webkit/database/database_util.h" | 22 #include "webkit/database/database_util.h" |
23 #include "webkit/fileapi/file_system_context.h" | 23 #include "webkit/fileapi/file_system_context.h" |
24 | 24 |
25 using content::BrowserThread; | 25 using content::BrowserThread; |
26 | 26 |
27 /* static */ | 27 // static |
28 void ExtensionDataDeleter::StartDeleting( | 28 void ExtensionDataDeleter::StartDeleting( |
29 Profile* profile, | 29 Profile* profile, |
30 const std::string& extension_id, | 30 const std::string& extension_id, |
31 const GURL& storage_origin, | 31 const GURL& storage_origin, |
32 bool is_storage_isolated) { | 32 bool is_storage_isolated) { |
33 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 33 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
34 DCHECK(profile); | 34 DCHECK(profile); |
35 scoped_refptr<ExtensionDataDeleter> deleter = | 35 scoped_refptr<ExtensionDataDeleter> deleter = |
36 new ExtensionDataDeleter( | 36 new ExtensionDataDeleter( |
37 profile, extension_id, storage_origin, is_storage_isolated); | 37 profile, extension_id, storage_origin, is_storage_isolated); |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 | 134 |
135 // TODO(creis): The following call fails because the request context is still | 135 // TODO(creis): The following call fails because the request context is still |
136 // around, and holding open file handles in this directory. | 136 // around, and holding open file handles in this directory. |
137 // See http://crbug.com/85127 | 137 // See http://crbug.com/85127 |
138 if (!isolated_app_path_.empty()) | 138 if (!isolated_app_path_.empty()) |
139 file_util::Delete(isolated_app_path_, true); | 139 file_util::Delete(isolated_app_path_, true); |
140 } | 140 } |
141 | 141 |
142 void ExtensionDataDeleter::DeleteAppcachesOnIOThread() { | 142 void ExtensionDataDeleter::DeleteAppcachesOnIOThread() { |
143 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 143 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
144 appcache_service_->DeleteAppCachesForOrigin(storage_origin_, NULL); | 144 appcache_service_->DeleteAppCachesForOrigin( |
| 145 storage_origin_, net::CompletionCallback()); |
145 } | 146 } |
OLD | NEW |