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

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

Issue 15564008: Migrate the IndexedDB backend from Blink to Chromium (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Accessor naming, use LevelDBSlice ctor explicitly 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_index_writer.h
diff --git a/content/browser/indexed_db/indexed_db_index_writer.h b/content/browser/indexed_db/indexed_db_index_writer.h
new file mode 100644
index 0000000000000000000000000000000000000000..4a3d0593b62b5d24f8ba81836946559f542ba88d
--- /dev/null
+++ b/content/browser/indexed_db/indexed_db_index_writer.h
@@ -0,0 +1,81 @@
+// 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_INDEX_WRITER_H_
+#define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_INDEX_WRITER_H_
+
+#include <map>
+#include <vector>
+
+#include "base/memory/scoped_vector.h"
+#include "content/browser/indexed_db/indexed_db_backing_store.h"
+#include "content/browser/indexed_db/indexed_db_database_impl.h"
+#include "content/browser/indexed_db/indexed_db_metadata.h"
+#include "content/common/indexed_db/indexed_db_key_path.h"
+
+namespace content {
+
+class IndexedDBDatabaseImpl;
+class IndexedDBTransaction;
+struct IndexedDBObjectStoreMetadata;
+
+// TODO: this namespace is temporary until we move its contents out to their
jamesr 2013/05/21 23:56:06 TODO(who):
jsbell 2013/05/22 17:54:44 Done.
+// own home.
+namespace IndexedDBObjectStoreImpl {
+
+class IndexWriter {
+ public:
+ explicit IndexWriter(const IndexedDBIndexMetadata& index_metadata);
+
+ IndexWriter(const IndexedDBIndexMetadata& index_metadata,
+ const IndexedDBDatabase::IndexKeys& index_keys);
+
+ bool VerifyIndexKeys(IndexedDBBackingStore*,
+ IndexedDBBackingStore::Transaction*,
+ int64_t database_id,
+ int64_t object_store_id,
+ int64_t index_id,
+ bool* can_add_keys,
+ const IndexedDBKey& primary_key,
+ string16* error_message = 0) const WARN_UNUSED_RESULT;
+
+ void WriteIndexKeys(const IndexedDBBackingStore::RecordIdentifier&,
+ IndexedDBBackingStore*,
+ IndexedDBBackingStore::Transaction*,
+ int64_t database_id,
+ int64_t object_store_id) const;
+
+ ~IndexWriter();
+
+ private:
+ bool AddingKeyAllowed(IndexedDBBackingStore*,
+ IndexedDBBackingStore::Transaction*,
+ int64_t database_id,
+ int64_t object_store_id,
+ int64_t index_id,
+ const IndexedDBKey& index_key,
+ const IndexedDBKey& primary_key,
+ bool* allowed) const WARN_UNUSED_RESULT;
+
+ const IndexedDBIndexMetadata index_metadata_;
+ IndexedDBDatabase::IndexKeys index_keys_;
+};
+
+bool MakeIndexWriters(scoped_refptr<IndexedDBTransaction>,
+ IndexedDBBackingStore*,
+ int64_t database_id,
+ const IndexedDBObjectStoreMetadata&,
+ const IndexedDBKey& primary_key,
+ bool key_was_generated,
+ const std::vector<int64_t>& index_ids,
+ const std::vector<IndexedDBDatabase::IndexKeys>&,
+ ScopedVector<IndexWriter>* index_writers,
+ string16* error_message,
+ bool* completed) WARN_UNUSED_RESULT;
+
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_INDEX_WRITER_H_

Powered by Google App Engine
This is Rietveld 408576698