summaryrefslogtreecommitdiffstats
path: root/content/browser/indexed_db/leveldb/leveldb_slice.h
diff options
context:
space:
mode:
authorjsbell@chromium.org <jsbell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-28 18:22:58 +0000
committerjsbell@chromium.org <jsbell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-28 18:22:58 +0000
commit4d9d3bc75c7e6598f8c3b3341f8b9d05afcb821d (patch)
treed1cfc4b93f7716d60db658369a0c6a0309f26c96 /content/browser/indexed_db/leveldb/leveldb_slice.h
parent5772630103e70aba61dbb547cc23d2c8ad0aa793 (diff)
downloadchromium_src-4d9d3bc75c7e6598f8c3b3341f8b9d05afcb821d.zip
chromium_src-4d9d3bc75c7e6598f8c3b3341f8b9d05afcb821d.tar.gz
chromium_src-4d9d3bc75c7e6598f8c3b3341f8b9d05afcb821d.tar.bz2
Migrate the IndexedDB backend from Blink to Chromium
To get the IDB backend off the (deprecated) WebKit thread, remove intermediate proxying, and let us take advantage of base utilities, we're moving the code from Blink to Chromium. This patch is basically a glorified copy/paste of the Blink IDB backend code, with Chromium coding style applied, WTF dependencies replaced with STL and base/, redundant classes removed, etc. It introduces some new temporary proxy classes (content/browser/webidb*_impl.*) to allow us build both the old and new backends. The new backend is currently disabled by default. It can be enabled using a new (and temporary) command line switch: --new-indexeddb Once we've done some further cleanup and are confident that the new backend is stable, and the bots have moved from DumpRenderTree to content_shell, we'll switch to the new backend by default. Once that has survived through a dev channel release, we'll delete the Blink code and eliminate unnecessary proxy classes. BUG=234278 R=alecflett@chromium.org, dgrogan@chromium.org, piman@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=202215 Review URL: https://codereview.chromium.org/15564008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@202604 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/indexed_db/leveldb/leveldb_slice.h')
-rw-r--r--content/browser/indexed_db/leveldb/leveldb_slice.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/content/browser/indexed_db/leveldb/leveldb_slice.h b/content/browser/indexed_db/leveldb/leveldb_slice.h
new file mode 100644
index 0000000..3419c93
--- /dev/null
+++ b/content/browser/indexed_db/leveldb/leveldb_slice.h
@@ -0,0 +1,37 @@
+// 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_LEVELDB_LEVELDB_SLICE_H_
+#define CONTENT_BROWSER_INDEXED_DB_LEVELDB_LEVELDB_SLICE_H_
+
+#include <vector>
+
+#include "base/logging.h"
+
+namespace content {
+
+class LevelDBSlice {
+ public:
+ LevelDBSlice(const char* begin, const char* end) : begin_(begin), end_(end) {
+ DCHECK_GE(end_, begin_);
+ }
+
+ explicit LevelDBSlice(const std::vector<char>& v)
+ : begin_(&*v.begin()), end_(&*v.rbegin() + 1) {
+ DCHECK_GE(end_, begin_);
+ }
+
+ ~LevelDBSlice() {}
+
+ const char* begin() const { return begin_; }
+ const char* end() const { return end_; }
+
+ private:
+ const char* begin_;
+ const char* end_;
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_INDEXED_DB_LEVELDB_LEVELDB_SLICE_H_