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

Unified Diff: content/browser/indexed_db/indexed_db_factory_impl.h

Issue 15564008: Migrate the IndexedDB backend from Blink to Chromium (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update to ToT again Created 7 years, 7 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: content/browser/indexed_db/indexed_db_factory_impl.h
diff --git a/content/browser/indexed_db/indexed_db_factory_impl.h b/content/browser/indexed_db/indexed_db_factory_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..c0495852bb3b1d269037a5b793101b6f2d3c8405
--- /dev/null
+++ b/content/browser/indexed_db/indexed_db_factory_impl.h
@@ -0,0 +1,77 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_FACTORY_IMPL_H_
+#define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_FACTORY_IMPL_H_
+
+#include <map>
+#include <set>
+
+#include "base/basictypes.h"
+#include "base/memory/ref_counted.h"
+#include "base/memory/weak_ptr.h"
+#include "content/browser/indexed_db/indexed_db_callbacks_wrapper.h"
+#include "content/browser/indexed_db/indexed_db_database_callbacks_wrapper.h"
+#include "content/browser/indexed_db/indexed_db_factory.h"
+#include "content/common/content_export.h"
+
+namespace content {
+
+class IndexedDBBackingStore;
+class IndexedDBDatabaseImpl;
+
+class CONTENT_EXPORT IndexedDBFactoryImpl
+ : NON_EXPORTED_BASE(public IndexedDBFactory) {
+ public:
+ static scoped_refptr<IndexedDBFactoryImpl> Create() {
+ return make_scoped_refptr(new IndexedDBFactoryImpl());
+ }
+
+ // Notifications from weak pointers.
+ virtual void RemoveIDBDatabaseBackend(const string16& unique_identifier);
+
+ virtual void GetDatabaseNames(
+ scoped_refptr<IndexedDBCallbacksWrapper> callbacks,
+ const string16& database_identifier,
+ const string16& data_dir) OVERRIDE;
+ virtual void Open(
+ const string16& name,
+ int64 version,
+ int64 transaction_id,
+ scoped_refptr<IndexedDBCallbacksWrapper> callbacks,
+ scoped_refptr<IndexedDBDatabaseCallbacksWrapper> database_callbacks,
+ const string16& database_identifier,
+ const string16& data_dir) OVERRIDE;
+
+ virtual void DeleteDatabase(
+ const string16& name,
+ scoped_refptr<IndexedDBCallbacksWrapper> callbacks,
+ const string16& database_identifier,
+ const string16& data_dir) OVERRIDE;
+
+ protected:
+ IndexedDBFactoryImpl();
+ virtual ~IndexedDBFactoryImpl();
+ virtual scoped_refptr<IndexedDBBackingStore> OpenBackingStore(
+ const string16& database_identifier,
+ const string16& data_dir);
+
+ private:
+ typedef std::map<string16, scoped_refptr<IndexedDBDatabaseImpl> >
+ IndexedDBDatabaseMap;
+ IndexedDBDatabaseMap database_backend_map_;
+
+ typedef std::map<string16, base::WeakPtr<IndexedDBBackingStore> >
+ IndexedDBBackingStoreMap;
+ IndexedDBBackingStoreMap backing_store_map_;
+
+ std::set<scoped_refptr<IndexedDBBackingStore> > session_only_backing_stores_;
+
+ // Only one instance of the factory should exist at any given time.
+ static IndexedDBFactoryImpl* idb_factory_backend_impl;
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_FACTORY_IMPL_H_
« no previous file with comments | « content/browser/indexed_db/indexed_db_factory.h ('k') | content/browser/indexed_db/indexed_db_factory_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698