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

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

Issue 213263004: Made IndexedDB's comparators public. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 8 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
« no previous file with comments | « no previous file | content/browser/indexed_db/indexed_db_backing_store.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 <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "base/files/file_path.h" 12 #include "base/files/file_path.h"
13 #include "base/memory/ref_counted.h" 13 #include "base/memory/ref_counted.h"
14 #include "base/memory/scoped_ptr.h" 14 #include "base/memory/scoped_ptr.h"
15 #include "base/strings/string_piece.h"
15 #include "base/timer/timer.h" 16 #include "base/timer/timer.h"
16 #include "content/browser/indexed_db/indexed_db.h" 17 #include "content/browser/indexed_db/indexed_db.h"
17 #include "content/browser/indexed_db/indexed_db_metadata.h" 18 #include "content/browser/indexed_db/indexed_db_metadata.h"
18 #include "content/browser/indexed_db/leveldb/leveldb_iterator.h" 19 #include "content/browser/indexed_db/leveldb/leveldb_iterator.h"
19 #include "content/browser/indexed_db/leveldb/leveldb_transaction.h" 20 #include "content/browser/indexed_db/leveldb/leveldb_transaction.h"
20 #include "content/common/content_export.h" 21 #include "content/common/content_export.h"
21 #include "content/common/indexed_db/indexed_db_key.h" 22 #include "content/common/indexed_db/indexed_db_key.h"
22 #include "content/common/indexed_db/indexed_db_key_path.h" 23 #include "content/common/indexed_db/indexed_db_key_path.h"
23 #include "content/common/indexed_db/indexed_db_key_range.h" 24 #include "content/common/indexed_db/indexed_db_key_range.h"
24 #include "third_party/leveldatabase/src/include/leveldb/status.h" 25 #include "third_party/leveldatabase/src/include/leveldb/status.h"
(...skipping 13 matching lines...) Expand all
38 scoped_ptr<LevelDBDatabase>* db, 39 scoped_ptr<LevelDBDatabase>* db,
39 bool* is_disk_full) = 0; 40 bool* is_disk_full) = 0;
40 virtual leveldb::Status DestroyLevelDB(const base::FilePath& file_name) = 0; 41 virtual leveldb::Status DestroyLevelDB(const base::FilePath& file_name) = 0;
41 }; 42 };
42 43
43 class CONTENT_EXPORT IndexedDBBackingStore 44 class CONTENT_EXPORT IndexedDBBackingStore
44 : public base::RefCounted<IndexedDBBackingStore> { 45 : public base::RefCounted<IndexedDBBackingStore> {
45 public: 46 public:
46 class CONTENT_EXPORT Transaction; 47 class CONTENT_EXPORT Transaction;
47 48
49 class Comparator : public LevelDBComparator {
50 public:
51 virtual int Compare(const base::StringPiece& a,
52 const base::StringPiece& b) const OVERRIDE;
53 virtual const char* Name() const OVERRIDE;
54 };
55
48 const GURL& origin_url() const { return origin_url_; } 56 const GURL& origin_url() const { return origin_url_; }
49 base::OneShotTimer<IndexedDBBackingStore>* close_timer() { 57 base::OneShotTimer<IndexedDBBackingStore>* close_timer() {
50 return &close_timer_; 58 return &close_timer_;
51 } 59 }
52 60
53 static scoped_refptr<IndexedDBBackingStore> Open( 61 static scoped_refptr<IndexedDBBackingStore> Open(
54 const GURL& origin_url, 62 const GURL& origin_url,
55 const base::FilePath& path_base, 63 const base::FilePath& path_base,
56 blink::WebIDBDataLoss* data_loss, 64 blink::WebIDBDataLoss* data_loss,
57 std::string* data_loss_message, 65 std::string* data_loss_message,
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 const std::string origin_identifier_; 350 const std::string origin_identifier_;
343 351
344 scoped_ptr<LevelDBDatabase> db_; 352 scoped_ptr<LevelDBDatabase> db_;
345 scoped_ptr<LevelDBComparator> comparator_; 353 scoped_ptr<LevelDBComparator> comparator_;
346 base::OneShotTimer<IndexedDBBackingStore> close_timer_; 354 base::OneShotTimer<IndexedDBBackingStore> close_timer_;
347 }; 355 };
348 356
349 } // namespace content 357 } // namespace content
350 358
351 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_BACKING_STORE_H_ 359 #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.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698