OLD | NEW |
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 <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 const IndexedDBKey* primary_key, | 351 const IndexedDBKey* primary_key, |
352 IteratorState state, | 352 IteratorState state, |
353 leveldb::Status*); | 353 leveldb::Status*); |
354 | 354 |
355 DISALLOW_COPY_AND_ASSIGN(Cursor); | 355 DISALLOW_COPY_AND_ASSIGN(Cursor); |
356 }; | 356 }; |
357 | 357 |
358 const GURL& origin_url() const { return origin_url_; } | 358 const GURL& origin_url() const { return origin_url_; } |
359 IndexedDBFactory* factory() const { return indexed_db_factory_; } | 359 IndexedDBFactory* factory() const { return indexed_db_factory_; } |
360 base::SequencedTaskRunner* task_runner() const { return task_runner_.get(); } | 360 base::SequencedTaskRunner* task_runner() const { return task_runner_.get(); } |
361 base::OneShotTimer<IndexedDBBackingStore>* close_timer() { | 361 base::OneShotTimer* close_timer() { return &close_timer_; } |
362 return &close_timer_; | |
363 } | |
364 IndexedDBActiveBlobRegistry* active_blob_registry() { | 362 IndexedDBActiveBlobRegistry* active_blob_registry() { |
365 return &active_blob_registry_; | 363 return &active_blob_registry_; |
366 } | 364 } |
367 | 365 |
368 static scoped_refptr<IndexedDBBackingStore> Open( | 366 static scoped_refptr<IndexedDBBackingStore> Open( |
369 IndexedDBFactory* indexed_db_factory, | 367 IndexedDBFactory* indexed_db_factory, |
370 const GURL& origin_url, | 368 const GURL& origin_url, |
371 const base::FilePath& path_base, | 369 const base::FilePath& path_base, |
372 net::URLRequestContext* request_context, | 370 net::URLRequestContext* request_context, |
373 blink::WebIDBDataLoss* data_loss, | 371 blink::WebIDBDataLoss* data_loss, |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
646 // version of the origin URL with a versioning suffix appended, e.g. | 644 // version of the origin URL with a versioning suffix appended, e.g. |
647 // "http_localhost_81@1" Since only one origin is stored per backing store | 645 // "http_localhost_81@1" Since only one origin is stored per backing store |
648 // this is redundant but necessary for backwards compatibility; the suffix | 646 // this is redundant but necessary for backwards compatibility; the suffix |
649 // provides for future flexibility. | 647 // provides for future flexibility. |
650 const std::string origin_identifier_; | 648 const std::string origin_identifier_; |
651 | 649 |
652 net::URLRequestContext* request_context_; | 650 net::URLRequestContext* request_context_; |
653 scoped_refptr<base::SequencedTaskRunner> task_runner_; | 651 scoped_refptr<base::SequencedTaskRunner> task_runner_; |
654 std::set<int> child_process_ids_granted_; | 652 std::set<int> child_process_ids_granted_; |
655 BlobChangeMap incognito_blob_map_; | 653 BlobChangeMap incognito_blob_map_; |
656 base::OneShotTimer<IndexedDBBackingStore> journal_cleaning_timer_; | 654 base::OneShotTimer journal_cleaning_timer_; |
657 | 655 |
658 scoped_ptr<LevelDBDatabase> db_; | 656 scoped_ptr<LevelDBDatabase> db_; |
659 scoped_ptr<LevelDBComparator> comparator_; | 657 scoped_ptr<LevelDBComparator> comparator_; |
660 // Whenever blobs are registered in active_blob_registry_, indexed_db_factory_ | 658 // Whenever blobs are registered in active_blob_registry_, indexed_db_factory_ |
661 // will hold a reference to this backing store. | 659 // will hold a reference to this backing store. |
662 IndexedDBActiveBlobRegistry active_blob_registry_; | 660 IndexedDBActiveBlobRegistry active_blob_registry_; |
663 base::OneShotTimer<IndexedDBBackingStore> close_timer_; | 661 base::OneShotTimer close_timer_; |
664 | 662 |
665 // Incremented whenever a transaction starts committing, decremented when | 663 // Incremented whenever a transaction starts committing, decremented when |
666 // complete. While > 0, temporary journal entries may exist so out-of-band | 664 // complete. While > 0, temporary journal entries may exist so out-of-band |
667 // journal cleaning must be deferred. | 665 // journal cleaning must be deferred. |
668 size_t committing_transaction_count_; | 666 size_t committing_transaction_count_; |
669 | 667 |
670 DISALLOW_COPY_AND_ASSIGN(IndexedDBBackingStore); | 668 DISALLOW_COPY_AND_ASSIGN(IndexedDBBackingStore); |
671 }; | 669 }; |
672 | 670 |
673 } // namespace content | 671 } // namespace content |
674 | 672 |
675 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_BACKING_STORE_H_ | 673 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_BACKING_STORE_H_ |
OLD | NEW |