| 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_DATA_DELETER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_DATA_DELETER_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_DATA_DELETER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_DATA_DELETER_H_ |
| 7 | 7 |
| 8 #include "url/gurl.h" | 8 #include <string> |
| 9 #include "base/basictypes.h" |
| 9 | 10 |
| 10 class Profile; | 11 class Profile; |
| 12 class GURL; |
| 11 | 13 |
| 12 namespace extensions { | 14 namespace extensions { |
| 13 | 15 |
| 16 class Extension; |
| 17 |
| 14 class DataDeleter { | 18 class DataDeleter { |
| 15 public: | 19 public: |
| 16 // Starts removing data. The extension should not be running when this is | 20 // Starts removing data. The extension should not be running when this is |
| 17 // called. Cookies are deleted on the current thread, local storage and | 21 // called. Cookies are deleted on the current thread, local storage and |
| 18 // databases/settings are deleted asynchronously on the webkit and file | 22 // databases/settings are deleted asynchronously on the webkit and file |
| 19 // threads, respectively. This function must be called from the UI thread. | 23 // threads, respectively. This function must be called from the UI thread. |
| 20 static void StartDeleting( | 24 static void StartDeleting(Profile* profile, const Extension* extenion); |
| 21 Profile* profile, | 25 |
| 22 const std::string& extension_id, | 26 private: |
| 23 const GURL& storage_origin); | 27 // Helper function that deletes non isolated storage for a given extension and |
| 28 // origin. |
| 29 static void DeleteNonIsolatedStorage( |
| 30 Profile* profile, |
| 31 const std::string& extension_id, |
| 32 const GURL& storage_origin); |
| 24 | 33 |
| 25 DISALLOW_COPY_AND_ASSIGN(DataDeleter); | 34 DISALLOW_COPY_AND_ASSIGN(DataDeleter); |
| 26 }; | 35 }; |
| 27 | 36 |
| 28 } // namespace extensions | 37 } // namespace extensions |
| 29 | 38 |
| 30 #endif // CHROME_BROWSER_EXTENSIONS_DATA_DELETER_H_ | 39 #endif // CHROME_BROWSER_EXTENSIONS_DATA_DELETER_H_ |
| OLD | NEW |