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

Side by Side Diff: content/browser/indexed_db/indexed_db_backing_store.h

Issue 18147009: IndexedDB: Remove unnecessary scoped_refptr<T>::get() calls (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: clang-format Created 7 years, 5 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 | content/browser/indexed_db/indexed_db_backing_store_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 (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 #ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_BACKING_STORE_H_ 5 #ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_BACKING_STORE_H_
6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_BACKING_STORE_H_ 6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_BACKING_STORE_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 ~RecordIdentifier(); 102 ~RecordIdentifier();
103 103
104 const std::vector<char>& primary_key() const { return primary_key_; } 104 const std::vector<char>& primary_key() const { return primary_key_; }
105 int64 version() const { return version_; } 105 int64 version() const { return version_; }
106 void Reset(const std::vector<char>& primary_key, int64 version) { 106 void Reset(const std::vector<char>& primary_key, int64 version) {
107 primary_key_ = primary_key; 107 primary_key_ = primary_key;
108 version_ = version; 108 version_ = version;
109 } 109 }
110 110
111 private: 111 private:
112 std::vector<char> 112 // TODO(jsbell): Make it more clear that this is the *encoded* version of
113 primary_key_; // TODO(jsbell): Make it more clear that this is 113 // the key.
114 // the *encoded* version of the key. 114 std::vector<char> primary_key_;
115 int64 version_; 115 int64 version_;
116 DISALLOW_COPY_AND_ASSIGN(RecordIdentifier); 116 DISALLOW_COPY_AND_ASSIGN(RecordIdentifier);
117 }; 117 };
118 118
119 virtual bool GetRecord(IndexedDBBackingStore::Transaction* transaction, 119 virtual bool GetRecord(IndexedDBBackingStore::Transaction* transaction,
120 int64 database_id, 120 int64 database_id,
121 int64 object_store_id, 121 int64 object_store_id,
122 const IndexedDBKey& key, 122 const IndexedDBKey& key,
123 std::vector<char>* record) WARN_UNUSED_RESULT; 123 std::vector<char>* record) WARN_UNUSED_RESULT;
124 virtual bool PutRecord(IndexedDBBackingStore::Transaction* transaction, 124 virtual bool PutRecord(IndexedDBBackingStore::Transaction* transaction,
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 void Begin(); 273 void Begin();
274 bool Commit(); 274 bool Commit();
275 void Rollback(); 275 void Rollback();
276 void Reset() { 276 void Reset() {
277 backing_store_ = NULL; 277 backing_store_ = NULL;
278 transaction_ = NULL; 278 transaction_ = NULL;
279 } 279 }
280 280
281 static LevelDBTransaction* LevelDBTransactionFrom( 281 static LevelDBTransaction* LevelDBTransactionFrom(
282 Transaction* transaction) { 282 Transaction* transaction) {
283 return transaction->transaction_.get(); 283 return transaction->transaction_;
284 } 284 }
285 285
286 private: 286 private:
287 IndexedDBBackingStore* backing_store_; 287 IndexedDBBackingStore* backing_store_;
288 scoped_refptr<LevelDBTransaction> transaction_; 288 scoped_refptr<LevelDBTransaction> transaction_;
289 }; 289 };
290 290
291 protected: 291 protected:
292 IndexedDBBackingStore(const string16& identifier, 292 IndexedDBBackingStore(const string16& identifier,
293 scoped_ptr<LevelDBDatabase> db, 293 scoped_ptr<LevelDBDatabase> db,
(...skipping 22 matching lines...) Expand all
316 string16 identifier_; 316 string16 identifier_;
317 317
318 scoped_ptr<LevelDBDatabase> db_; 318 scoped_ptr<LevelDBDatabase> db_;
319 scoped_ptr<LevelDBComparator> comparator_; 319 scoped_ptr<LevelDBComparator> comparator_;
320 base::WeakPtrFactory<IndexedDBBackingStore> weak_factory_; 320 base::WeakPtrFactory<IndexedDBBackingStore> weak_factory_;
321 }; 321 };
322 322
323 } // namespace content 323 } // namespace content
324 324
325 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_BACKING_STORE_H_ 325 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_BACKING_STORE_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/indexed_db/indexed_db_backing_store_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698