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 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_DATA_DELETER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_DATA_DELETER_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_DATA_DELETER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_DATA_DELETER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
11 #include "base/string16.h" | 11 #include "base/string16.h" |
12 #include "content/public/browser/browser_thread.h" | 12 #include "content/public/browser/browser_thread.h" |
13 #include "googleurl/src/gurl.h" | 13 #include "googleurl/src/gurl.h" |
14 | 14 |
15 namespace webkit_database { | 15 namespace webkit_database { |
16 class DatabaseTracker; | 16 class DatabaseTracker; |
17 } | 17 } |
18 | 18 |
19 namespace fileapi { | 19 namespace fileapi { |
20 class FileSystemContext; | 20 class FileSystemContext; |
21 } | 21 } |
22 | 22 |
23 namespace net { | 23 namespace net { |
24 class URLRequestContextGetter; | 24 class URLRequestContextGetter; |
25 } | 25 } |
26 | 26 |
27 class ChromeAppCacheService; | 27 class ChromeAppCacheService; |
28 class ExtensionSettingsBackend; | |
29 class Profile; | 28 class Profile; |
30 class WebKitContext; | 29 class WebKitContext; |
31 | 30 |
32 // A helper class that takes care of removing local storage, databases and | 31 // A helper class that takes care of removing local storage, databases and |
33 // cookies for a given extension. This is used by | 32 // cookies for a given extension. This is used by |
34 // ExtensionService::ClearExtensionData() upon uninstalling an extension. | 33 // ExtensionService::ClearExtensionData() upon uninstalling an extension. |
35 class ExtensionDataDeleter | 34 class ExtensionDataDeleter |
36 : public base::RefCountedThreadSafe<ExtensionDataDeleter, | 35 : public base::RefCountedThreadSafe<ExtensionDataDeleter, |
37 BrowserThread::DeleteOnUIThread> { | 36 BrowserThread::DeleteOnUIThread> { |
38 public: | 37 public: |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 void DeleteIndexedDBOnWebkitThread(); | 73 void DeleteIndexedDBOnWebkitThread(); |
75 | 74 |
76 // Deletes filesystem files for the extension. May only be called on the | 75 // Deletes filesystem files for the extension. May only be called on the |
77 // file thread. | 76 // file thread. |
78 void DeleteFileSystemOnFileThread(); | 77 void DeleteFileSystemOnFileThread(); |
79 | 78 |
80 // Deletes appcache files for the extension. May only be called on the IO | 79 // Deletes appcache files for the extension. May only be called on the IO |
81 // thread. | 80 // thread. |
82 void DeleteAppcachesOnIOThread(); | 81 void DeleteAppcachesOnIOThread(); |
83 | 82 |
84 // Deletes extension settings for the extension. Will be called on the FILE | |
85 // thread via the ExtensionSettingsFrontend. | |
86 void DeleteExtensionSettingsOnFileThread(ExtensionSettingsBackend* backend); | |
87 | |
88 // The ID of the extension being deleted. | 83 // The ID of the extension being deleted. |
89 const std::string extension_id_; | 84 const std::string extension_id_; |
90 | 85 |
91 // The database context for deleting the database. | 86 // The database context for deleting the database. |
92 scoped_refptr<webkit_database::DatabaseTracker> database_tracker_; | 87 scoped_refptr<webkit_database::DatabaseTracker> database_tracker_; |
93 | 88 |
94 // Provides access to the request context. | 89 // Provides access to the request context. |
95 scoped_refptr<net::URLRequestContextGetter> extension_request_context_; | 90 scoped_refptr<net::URLRequestContextGetter> extension_request_context_; |
96 | 91 |
97 // The origin of the extension/app for which we're going to clear data. | 92 // The origin of the extension/app for which we're going to clear data. |
(...skipping 10 matching lines...) Expand all Loading... |
108 scoped_refptr<ChromeAppCacheService> appcache_service_; | 103 scoped_refptr<ChromeAppCacheService> appcache_service_; |
109 | 104 |
110 // If non-empty, the extension we're deleting is an isolated app, and this | 105 // If non-empty, the extension we're deleting is an isolated app, and this |
111 // is its directory which we should delete. | 106 // is its directory which we should delete. |
112 FilePath isolated_app_path_; | 107 FilePath isolated_app_path_; |
113 | 108 |
114 DISALLOW_COPY_AND_ASSIGN(ExtensionDataDeleter); | 109 DISALLOW_COPY_AND_ASSIGN(ExtensionDataDeleter); |
115 }; | 110 }; |
116 | 111 |
117 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_DATA_DELETER_H_ | 112 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_DATA_DELETER_H_ |
OLD | NEW |