Index: content/browser/dom_storage/dom_storage_context_wrapper.h |
diff --git a/content/browser/dom_storage/dom_storage_context_wrapper.h b/content/browser/dom_storage/dom_storage_context_wrapper.h |
index b1aaa8b4bfe0dc484a94a2c662c6ad1f22be1ac4..db0794d8b42402e8945706364aa4bfba377332ed 100644 |
--- a/content/browser/dom_storage/dom_storage_context_wrapper.h |
+++ b/content/browser/dom_storage/dom_storage_context_wrapper.h |
@@ -10,6 +10,10 @@ |
#include "base/macros.h" |
#include "base/memory/ref_counted.h" |
+#include "base/memory/weak_ptr.h" |
+#include "components/filesystem/public/interfaces/directory.mojom.h" |
+#include "components/filesystem/public/interfaces/file_system.mojom.h" |
+#include "components/leveldb/public/interfaces/leveldb.mojom.h" |
#include "content/common/content_export.h" |
#include "content/common/storage_partition_service.mojom.h" |
#include "content/public/browser/dom_storage_context.h" |
@@ -26,6 +30,7 @@ namespace content { |
class DOMStorageContextImpl; |
class LevelDBWrapperImpl; |
+class MojoAppConnection; |
// This is owned by Storage Partition and encapsulates all its dom storage |
// state. |
@@ -77,6 +82,17 @@ class CONTENT_EXPORT DOMStorageContextWrapper : |
void LevelDBWrapperImplHasNoBindings(const std::string& origin); |
michaeln
2016/02/26 21:59:25
+1 the OnFooHappened naming, i'd vote to rename th
|
+ // Part of our asynchronous directory opening called from OpenLocalStorage(). |
+ void OnDirectoryOpened(filesystem::FileError err); |
+ void OnDatabaseOpened(leveldb::DatabaseError status); |
+ |
+ // The (possibly delayed) implementation of OpenLocalStorage(). Can be called |
+ // directly from that function, or through |on_database_open_callbacks_|. |
+ void BindLocalStorage( |
+ const mojo::String& origin, |
+ LevelDBObserverPtr observer, |
+ mojo::InterfaceRequest<LevelDBWrapper> request); |
+ |
// Used for mojo-based LocalStorage implementation (behind |
// --mojo-local-storage for now). Maps between an origin and its prefixed |
// LevelDB view. |
@@ -84,6 +100,24 @@ class CONTENT_EXPORT DOMStorageContextWrapper : |
scoped_refptr<DOMStorageContextImpl> context_; |
+ enum ConnectionState { |
+ NO_CONNECTION, |
+ CONNECITON_IN_PROGRESS, |
+ CONNECTED |
+ } connection_state_; |
+ |
+ scoped_ptr<MojoAppConnection> file_system_connection_; |
+ filesystem::FileSystemPtr file_system_; |
+ filesystem::DirectoryPtr directory_; |
michaeln
2016/02/26 21:59:25
Do we need to retain all of these things for the l
Elliot Glaysher
2016/03/02 23:06:20
So we want to keep |file_system_| (now profile_sys
|
+ |
+ scoped_ptr<MojoAppConnection> leveldb_connection_; |
+ leveldb::LevelDBServicePtr leveldb_; |
+ leveldb::LevelDBDatabasePtr database_; |
michaeln
2016/02/26 21:59:25
Do mojo things have thread affinity with regard to
Elliot Glaysher
2016/03/02 23:06:20
They have strong affinity for the thread they were
|
+ |
+ std::vector<base::Closure> on_database_opened_callbacks_; |
+ |
+ base::WeakPtrFactory<DOMStorageContextWrapper> weak_ptr_factory_; |
+ |
DISALLOW_IMPLICIT_CONSTRUCTORS(DOMStorageContextWrapper); |
}; |