Chromium Code Reviews| 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 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 452 | 452 |
| 453 private: | 453 private: |
| 454 bool is_file_; | 454 bool is_file_; |
| 455 GURL url_; | 455 GURL url_; |
| 456 base::FilePath file_path_; | 456 base::FilePath file_path_; |
| 457 int64_t key_; | 457 int64_t key_; |
| 458 int64_t size_; | 458 int64_t size_; |
| 459 base::Time last_modified_; | 459 base::Time last_modified_; |
| 460 }; | 460 }; |
| 461 | 461 |
| 462 class ChainedBlobWriter : public base::RefCounted<ChainedBlobWriter> { | 462 class ChainedBlobWriter |
| 463 : public base::RefCountedThreadSafe<ChainedBlobWriter> { | |
| 463 public: | 464 public: |
| 464 virtual void set_delegate( | 465 virtual void set_delegate( |
| 465 scoped_ptr<fileapi::FileWriterDelegate> delegate) = 0; | 466 scoped_ptr<fileapi::FileWriterDelegate> delegate) = 0; |
| 466 | 467 |
| 467 // TODO(ericu): Add a reason in the event of failure. | 468 // TODO(ericu): Add a reason in the event of failure. |
| 468 virtual void ReportWriteCompletion(bool succeeded, | 469 virtual void ReportWriteCompletion(bool succeeded, |
| 469 int64 bytes_written) = 0; | 470 int64 bytes_written) = 0; |
| 470 | 471 |
| 471 virtual void Abort() = 0; | 472 virtual void Abort() = 0; |
| 472 | 473 |
| 473 protected: | 474 protected: |
| 474 virtual ~ChainedBlobWriter() {} | 475 virtual ~ChainedBlobWriter() {} |
| 475 friend class base::RefCounted<ChainedBlobWriter>; | 476 friend class base::RefCountedThreadSafe<ChainedBlobWriter>; |
|
michaeln1
2014/07/23 20:15:15
style nit: ditto
| |
| 476 }; | 477 }; |
| 477 | 478 |
| 478 class ChainedBlobWriterImpl; | 479 class ChainedBlobWriterImpl; |
| 479 | 480 |
| 480 typedef std::vector<WriteDescriptor> WriteDescriptorVec; | 481 typedef std::vector<WriteDescriptor> WriteDescriptorVec; |
| 481 | 482 |
| 482 private: | 483 private: |
| 483 class BlobWriteCallbackWrapper; | 484 class BlobWriteCallbackWrapper; |
| 484 | 485 |
| 485 leveldb::Status HandleBlobPreTransaction( | 486 leveldb::Status HandleBlobPreTransaction( |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 579 // will hold a reference to this backing store. | 580 // will hold a reference to this backing store. |
| 580 IndexedDBActiveBlobRegistry active_blob_registry_; | 581 IndexedDBActiveBlobRegistry active_blob_registry_; |
| 581 base::OneShotTimer<IndexedDBBackingStore> close_timer_; | 582 base::OneShotTimer<IndexedDBBackingStore> close_timer_; |
| 582 | 583 |
| 583 DISALLOW_COPY_AND_ASSIGN(IndexedDBBackingStore); | 584 DISALLOW_COPY_AND_ASSIGN(IndexedDBBackingStore); |
| 584 }; | 585 }; |
| 585 | 586 |
| 586 } // namespace content | 587 } // namespace content |
| 587 | 588 |
| 588 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_BACKING_STORE_H_ | 589 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_BACKING_STORE_H_ |
| OLD | NEW |