Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(108)

Unified Diff: chrome/browser/chromeos/file_system_provider/service.h

Issue 213123008: [fsp] Unmount file systems when the providing extension gets unloaded. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/file_system_provider/service.h
diff --git a/chrome/browser/chromeos/file_system_provider/service.h b/chrome/browser/chromeos/file_system_provider/service.h
index e1949b6977c5e8bade98f1b3c0c10d3ee98198bc..3ed9a73027e26cd0a312b42c591389734ca489b5 100644
--- a/chrome/browser/chromeos/file_system_provider/service.h
+++ b/chrome/browser/chromeos/file_system_provider/service.h
@@ -20,6 +20,12 @@
#include "chrome/common/extensions/api/file_system_provider.h"
#include "components/keyed_service/core/keyed_service.h"
#include "content/public/browser/browser_context.h"
+#include "extensions/browser/extension_registry_observer.h"
+
+namespace extensions {
+class Extension;
+class ExtensionRegistry;
+} // namespace extensions
namespace chromeos {
namespace file_system_provider {
@@ -29,9 +35,11 @@ class ProvidedFileSystemInterface;
class ServiceFactory;
// Manages and registers the fileSystemProvider service.
-class Service : public KeyedService {
+class Service : public KeyedService,
+ public extensions::ExtensionRegistryObserver {
public:
- explicit Service(Profile* profile);
+ explicit Service(Profile* profile,
+ extensions::ExtensionRegistry* extension_registry);
virtual ~Service();
// Mounts a file system provided by an extension with the |extension_id|.
@@ -69,6 +77,10 @@ class Service : public KeyedService {
// BrowserContextKeyedService overrides.
virtual void Shutdown() OVERRIDE;
+ // extensions::ExtensionRegistryObserver overrides.
+ virtual void OnExtensionUnloaded(const extensions::Extension* extension)
+ OVERRIDE;
+
// Getter for the request manager. Used by the extension API to forward
// replies. Valid as long as the service.
RequestManager* request_manager() { return &request_manager_; }
@@ -81,8 +93,12 @@ class Service : public KeyedService {
void OnRequestUnmountStatus(const ProvidedFileSystemInfo& file_system_info,
base::File::Error error);
- RequestManager request_manager_;
Profile* profile_;
+
+ // Owned by extensions::ExtensionRegistryFactory.
+ extensions::ExtensionRegistry* extension_registry_;
+
+ RequestManager request_manager_;
ObserverList<Observer> observers_;
ProvidedFileSystemMap file_system_map_; // Owns pointers.

Powered by Google App Engine
This is Rietveld 408576698