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

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

Issue 663563002: Use scoped_ptr::Pass instead of scoped_ptr::PassAs<T>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 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 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 "content/browser/indexed_db/leveldb/leveldb_transaction.h" 5 #include "content/browser/indexed_db/leveldb/leveldb_transaction.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/time/time.h" 9 #include "base/time/time.h"
10 #include "content/browser/indexed_db/leveldb/leveldb_database.h" 10 #include "content/browser/indexed_db/leveldb/leveldb_database.h"
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 return s; 114 return s;
115 } 115 }
116 116
117 void LevelDBTransaction::Rollback() { 117 void LevelDBTransaction::Rollback() {
118 DCHECK(!finished_); 118 DCHECK(!finished_);
119 finished_ = true; 119 finished_ = true;
120 Clear(); 120 Clear();
121 } 121 }
122 122
123 scoped_ptr<LevelDBIterator> LevelDBTransaction::CreateIterator() { 123 scoped_ptr<LevelDBIterator> LevelDBTransaction::CreateIterator() {
124 return TransactionIterator::Create(this).PassAs<LevelDBIterator>(); 124 return TransactionIterator::Create(this);
125 } 125 }
126 126
127 scoped_ptr<LevelDBTransaction::DataIterator> 127 scoped_ptr<LevelDBTransaction::DataIterator>
128 LevelDBTransaction::DataIterator::Create(LevelDBTransaction* transaction) { 128 LevelDBTransaction::DataIterator::Create(LevelDBTransaction* transaction) {
129 return make_scoped_ptr(new DataIterator(transaction)); 129 return make_scoped_ptr(new DataIterator(transaction));
130 } 130 }
131 131
132 bool LevelDBTransaction::DataIterator::IsValid() const { 132 bool LevelDBTransaction::DataIterator::IsValid() const {
133 return iterator_ != data_->end(); 133 return iterator_ != data_->end();
134 } 134 }
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
485 485
486 leveldb::Status s = db_->Write(*write_batch_); 486 leveldb::Status s = db_->Write(*write_batch_);
487 if (s.ok()) { 487 if (s.ok()) {
488 finished_ = true; 488 finished_ = true;
489 write_batch_->Clear(); 489 write_batch_->Clear();
490 } 490 }
491 return s; 491 return s;
492 } 492 }
493 493
494 } // namespace content 494 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/indexed_db/indexed_db_browsertest.cc ('k') | content/browser/loader/resource_dispatcher_host_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698