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

Unified Diff: components/filesystem/file_system_app.h

Issue 1720603002: Revert of mojo: Get mojo:leveldb and mojo:filesystem compiled into content. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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
« no previous file with comments | « components/filesystem/BUILD.gn ('k') | components/filesystem/file_system_app.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/filesystem/file_system_app.h
diff --git a/components/filesystem/file_system_app.h b/components/filesystem/file_system_app.h
index ae624691e7d70c86f1de7d869fe53d4d7c95ded6..402c3599eaeb8ccce13b3159d216ccbf9c05a3d3 100644
--- a/components/filesystem/file_system_app.h
+++ b/components/filesystem/file_system_app.h
@@ -26,20 +26,49 @@
FileSystemApp();
~FileSystemApp() override;
+ // Called by individual FileSystem objects to register lifetime events.
+ void RegisterDirectoryToClient(DirectoryImpl* directory,
+ FileSystemClientPtr client);
+
private:
+ // We set the DirectoryImpl's error handler to this function. We do this so
+ // that we can QuitNow() once the last DirectoryImpl has closed itself.
+ void OnDirectoryConnectionError(DirectoryImpl* directory);
+
// |mojo::ShellClient| override:
void Initialize(mojo::Shell* shell, const std::string& url,
uint32_t id) override;
bool AcceptConnection(mojo::Connection* connection) override;
+ bool ShellConnectionLost() override;
// |InterfaceFactory<Files>| implementation:
void Create(mojo::Connection* connection,
mojo::InterfaceRequest<FileSystem> request) override;
+ // Use a vector to work around map not letting us use FileSystemClientPtr as
+ // a value in a std::map. The move constructors are to allow us to deal with
+ // FileSystemClientPtr inside a vector.
+ struct Client {
+ Client(DirectoryImpl* directory, FileSystemClientPtr fs_client);
+ Client(Client&& rhs);
+ ~Client();
+
+ Client& operator=(Client&& rhs);
+
+ DirectoryImpl* directory_;
+ FileSystemClientPtr fs_client_;
+ };
+ std::vector<Client> client_mapping_;
+
mojo::Shell* shell_;
mojo::TracingImpl tracing_;
scoped_ptr<LockTable> lock_table_;
+
+ // Set to true when our shell connection is closed. On connection error, we
+ // then broadcast a notification to all FileSystemClients that they should
+ // shut down. Once the final one does, then we QuitNow().
+ bool in_shutdown_;
DISALLOW_COPY_AND_ASSIGN(FileSystemApp);
};
« no previous file with comments | « components/filesystem/BUILD.gn ('k') | components/filesystem/file_system_app.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698