OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/ref_counted.h" | 10 #include "base/ref_counted.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 public: | 26 public: |
27 ExtensionDataDeleter(Profile* profile, const GURL& extension_url); | 27 ExtensionDataDeleter(Profile* profile, const GURL& extension_url); |
28 | 28 |
29 // Start removing data. The extension should not be running when this is | 29 // Start removing data. The extension should not be running when this is |
30 // called. Cookies are deleted on the current thread, local storage and | 30 // called. Cookies are deleted on the current thread, local storage and |
31 // databases are deleted asynchronously on the webkit and file threads, | 31 // databases are deleted asynchronously on the webkit and file threads, |
32 // respectively. This function must be called from the UI thread. | 32 // respectively. This function must be called from the UI thread. |
33 void StartDeleting(); | 33 void StartDeleting(); |
34 | 34 |
35 private: | 35 private: |
36 // Deletes the cookies for the extension. May only be called on the io | |
37 // thread. | |
38 void DeleteCookiesOnIOThread(); | |
39 | |
40 // Deletes the database for the extension. May only be called on the file | 36 // Deletes the database for the extension. May only be called on the file |
41 // thread. | 37 // thread. |
42 void DeleteDatabaseOnFileThread(); | 38 void DeleteDatabaseOnFileThread(); |
43 | 39 |
44 // Deletes local storage for the extension. May only be called on the webkit | 40 // Deletes local storage for the extension. May only be called on the webkit |
45 // thread. | 41 // thread. |
46 void DeleteLocalStorageOnWebkitThread(); | 42 void DeleteLocalStorageOnWebkitThread(); |
47 | 43 |
48 // The database context for deleting the database. | 44 // The database context for deleting the database. |
49 scoped_refptr<webkit_database::DatabaseTracker> database_tracker_; | 45 scoped_refptr<webkit_database::DatabaseTracker> database_tracker_; |
50 | 46 |
51 // Provides access to the extension request context. | 47 // Provides access to the extension request context. |
52 scoped_refptr<URLRequestContextGetter> extension_request_context_; | 48 scoped_refptr<URLRequestContextGetter> extension_request_context_; |
53 | 49 |
54 // The URL of the extension we're removing data for. | 50 // The URL of the extension we're removing data for. |
55 GURL extension_url_; | 51 GURL extension_url_; |
56 | 52 |
57 // The security origin identifier for which we're deleting stuff. | 53 // The security origin identifier for which we're deleting stuff. |
58 string16 origin_id_; | 54 string16 origin_id_; |
59 | 55 |
60 // Webkit context for accessing the DOM storage helper. | 56 // Webkit context for accessing the DOM storage helper. |
61 scoped_refptr<WebKitContext> webkit_context_; | 57 scoped_refptr<WebKitContext> webkit_context_; |
62 | 58 |
63 DISALLOW_COPY_AND_ASSIGN(ExtensionDataDeleter); | 59 DISALLOW_COPY_AND_ASSIGN(ExtensionDataDeleter); |
64 }; | 60 }; |
65 | 61 |
66 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_DATA_DELETER_H_ | 62 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_DATA_DELETER_H_ |
OLD | NEW |