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

Side by Side Diff: content/browser/indexed_db/leveldb/leveldb_write_batch.cc

Issue 15659013: Revert "Migrate the IndexedDB backend from Blink to Chromium" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "content/browser/indexed_db/leveldb/leveldb_write_batch.h"
6
7 #include "content/browser/indexed_db/leveldb/leveldb_slice.h"
8 #include "third_party/leveldatabase/src/include/leveldb/slice.h"
9 #include "third_party/leveldatabase/src/include/leveldb/write_batch.h"
10
11 namespace content {
12
13 scoped_ptr<LevelDBWriteBatch> LevelDBWriteBatch::Create() {
14 return make_scoped_ptr(new LevelDBWriteBatch);
15 }
16
17 LevelDBWriteBatch::LevelDBWriteBatch()
18 : write_batch_(new leveldb::WriteBatch) {}
19
20 LevelDBWriteBatch::~LevelDBWriteBatch() {}
21
22 static leveldb::Slice MakeSlice(const LevelDBSlice& s) {
23 return leveldb::Slice(s.begin(), s.end() - s.begin());
24 }
25
26 void LevelDBWriteBatch::Put(const LevelDBSlice& key,
27 const LevelDBSlice& value) {
28 write_batch_->Put(MakeSlice(key), MakeSlice(value));
29 }
30
31 void LevelDBWriteBatch::Remove(const LevelDBSlice& key) {
32 write_batch_->Delete(MakeSlice(key));
33 }
34
35 void LevelDBWriteBatch::Clear() { write_batch_->Clear(); }
36
37 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/indexed_db/leveldb/leveldb_write_batch.h ('k') | content/browser/indexed_db/list_set.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698