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

Side by Side Diff: chrome/browser/sync_file_system/drive_backend/leveldb_wrapper.cc

Issue 426063008: [SyncFS] Fix a bug in LevelDBWrapper::Iterator::Next (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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
« no previous file with comments | « no previous file | chrome/browser/sync_file_system/drive_backend/leveldb_wrapper_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/sync_file_system/drive_backend/leveldb_wrapper.h" 5 #include "chrome/browser/sync_file_system/drive_backend/leveldb_wrapper.h"
6 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 10
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 db_iterator_->Next(); 53 db_iterator_->Next();
54 return; 54 return;
55 } 55 }
56 56
57 if (db_iterator_->Valid()) { 57 if (db_iterator_->Valid()) {
58 int comp = db_iterator_->key().compare(map_iterator_->first); 58 int comp = db_iterator_->key().compare(map_iterator_->first);
59 if (comp <= 0) 59 if (comp <= 0)
60 db_iterator_->Next(); 60 db_iterator_->Next();
61 if (comp >= 0) 61 if (comp >= 0)
62 ++map_iterator_; 62 ++map_iterator_;
63 } else {
64 ++map_iterator_;
63 } 65 }
64 66
65 AdvanceIterators(); 67 AdvanceIterators();
66 } 68 }
67 69
68 leveldb::Slice LevelDBWrapper::Iterator::key() { 70 leveldb::Slice LevelDBWrapper::Iterator::key() {
69 DCHECK(Valid()); 71 DCHECK(Valid());
70 72
71 if (!db_iterator_->Valid()) 73 if (!db_iterator_->Valid())
72 return map_iterator_->first; 74 return map_iterator_->first;
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 void LevelDBWrapper::Clear() { 192 void LevelDBWrapper::Clear() {
191 pending_.clear(); 193 pending_.clear();
192 } 194 }
193 195
194 leveldb::DB* LevelDBWrapper::GetLevelDBForTesting() { 196 leveldb::DB* LevelDBWrapper::GetLevelDBForTesting() {
195 return db_.get(); 197 return db_.get();
196 } 198 }
197 199
198 } // namespace drive_backend 200 } // namespace drive_backend
199 } // namespace sync_file_system 201 } // namespace sync_file_system
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/sync_file_system/drive_backend/leveldb_wrapper_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698