| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_GARBAGE_COLLECTOR_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_GARBAGE_COLLECTOR_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_GARBAGE_COLLECTOR_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_GARBAGE_COLLECTOR_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
| 12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
| 13 #include "chrome/browser/extensions/install_observer.h" | 13 #include "chrome/browser/extensions/install_observer.h" |
| 14 #include "components/keyed_service/core/keyed_service.h" | 14 #include "components/keyed_service/core/keyed_service.h" |
| 15 | 15 |
| 16 namespace content { | 16 namespace content { |
| 17 class BrowserContext; | 17 class BrowserContext; |
| 18 } | 18 } |
| 19 | 19 |
| 20 class ExtensionService; | |
| 21 | |
| 22 namespace extensions { | 20 namespace extensions { |
| 23 | 21 |
| 24 // The class responsible for cleaning up the cruft left behind on the file | 22 // The class responsible for cleaning up the cruft left behind on the file |
| 25 // system by uninstalled (or failed install) extensions. | 23 // system by uninstalled (or failed install) extensions. |
| 26 // The class is owned by ExtensionService, but is mostly independent. Tasks to | 24 // The class is owned by ExtensionService, but is mostly independent. Tasks to |
| 27 // garbage collect extensions and isolated storage are posted once the | 25 // garbage collect extensions and isolated storage are posted once the |
| 28 // ExtensionSystem signals ready. | 26 // ExtensionSystem signals ready. |
| 29 class ExtensionGarbageCollector : public KeyedService, public InstallObserver { | 27 class ExtensionGarbageCollector : public KeyedService, public InstallObserver { |
| 30 public: | 28 public: |
| 31 explicit ExtensionGarbageCollector(content::BrowserContext* context); | 29 explicit ExtensionGarbageCollector(content::BrowserContext* context); |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 // Generate weak pointers for safely posting to the file thread for garbage | 81 // Generate weak pointers for safely posting to the file thread for garbage |
| 84 // collection. | 82 // collection. |
| 85 base::WeakPtrFactory<ExtensionGarbageCollector> weak_factory_; | 83 base::WeakPtrFactory<ExtensionGarbageCollector> weak_factory_; |
| 86 | 84 |
| 87 DISALLOW_COPY_AND_ASSIGN(ExtensionGarbageCollector); | 85 DISALLOW_COPY_AND_ASSIGN(ExtensionGarbageCollector); |
| 88 }; | 86 }; |
| 89 | 87 |
| 90 } // namespace extensions | 88 } // namespace extensions |
| 91 | 89 |
| 92 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_GARBAGE_COLLECTOR_H_ | 90 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_GARBAGE_COLLECTOR_H_ |
| OLD | NEW |