| 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 <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 13 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
| 14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
| 15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
| 16 #include "base/strings/string_piece.h" | 16 #include "base/strings/string_piece.h" |
| 17 #include "base/timer/timer.h" | 17 #include "base/timer/timer.h" |
| 18 #include "content/browser/indexed_db/indexed_db.h" | 18 #include "content/browser/indexed_db/indexed_db.h" |
| 19 #include "content/browser/indexed_db/indexed_db_active_blob_registry.h" | 19 #include "content/browser/indexed_db/indexed_db_active_blob_registry.h" |
| 20 #include "content/browser/indexed_db/indexed_db_blob_info.h" | 20 #include "content/browser/indexed_db/indexed_db_blob_info.h" |
| 21 #include "content/browser/indexed_db/indexed_db_leveldb_coding.h" | 21 #include "content/browser/indexed_db/indexed_db_leveldb_coding.h" |
| 22 #include "content/browser/indexed_db/indexed_db_metadata.h" | 22 #include "content/browser/indexed_db/indexed_db_metadata.h" |
| 23 #include "content/browser/indexed_db/leveldb/leveldb_iterator.h" | 23 #include "content/browser/indexed_db/leveldb/leveldb_iterator.h" |
| 24 #include "content/browser/indexed_db/leveldb/leveldb_transaction.h" | 24 #include "content/browser/indexed_db/leveldb/leveldb_transaction.h" |
| 25 #include "content/common/content_export.h" | 25 #include "content/common/content_export.h" |
| 26 #include "content/common/indexed_db/indexed_db_key.h" | 26 #include "content/common/indexed_db/indexed_db_key.h" |
| 27 #include "content/common/indexed_db/indexed_db_key_path.h" | 27 #include "content/common/indexed_db/indexed_db_key_path.h" |
| 28 #include "content/common/indexed_db/indexed_db_key_range.h" | 28 #include "content/common/indexed_db/indexed_db_key_range.h" |
| 29 #include "third_party/leveldatabase/src/include/leveldb/status.h" | 29 #include "third_party/leveldatabase/src/include/leveldb/status.h" |
| 30 #include "third_party/WebKit/public/platform/WebIDBTypes.h" |
| 30 #include "url/gurl.h" | 31 #include "url/gurl.h" |
| 31 #include "webkit/browser/blob/blob_data_handle.h" | 32 #include "webkit/browser/blob/blob_data_handle.h" |
| 32 | 33 |
| 33 namespace base { | 34 namespace base { |
| 34 class TaskRunner; | 35 class TaskRunner; |
| 35 } | 36 } |
| 36 | 37 |
| 37 namespace fileapi { | 38 namespace fileapi { |
| 38 class FileWriterDelegate; | 39 class FileWriterDelegate; |
| 39 } | 40 } |
| (...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 | 338 |
| 338 private: | 339 private: |
| 339 DISALLOW_COPY_AND_ASSIGN(Cursor); | 340 DISALLOW_COPY_AND_ASSIGN(Cursor); |
| 340 }; | 341 }; |
| 341 | 342 |
| 342 virtual scoped_ptr<Cursor> OpenObjectStoreKeyCursor( | 343 virtual scoped_ptr<Cursor> OpenObjectStoreKeyCursor( |
| 343 IndexedDBBackingStore::Transaction* transaction, | 344 IndexedDBBackingStore::Transaction* transaction, |
| 344 int64 database_id, | 345 int64 database_id, |
| 345 int64 object_store_id, | 346 int64 object_store_id, |
| 346 const IndexedDBKeyRange& key_range, | 347 const IndexedDBKeyRange& key_range, |
| 347 indexed_db::CursorDirection, | 348 blink::WebIDBCursorDirection, |
| 348 leveldb::Status*); | 349 leveldb::Status*); |
| 349 virtual scoped_ptr<Cursor> OpenObjectStoreCursor( | 350 virtual scoped_ptr<Cursor> OpenObjectStoreCursor( |
| 350 IndexedDBBackingStore::Transaction* transaction, | 351 IndexedDBBackingStore::Transaction* transaction, |
| 351 int64 database_id, | 352 int64 database_id, |
| 352 int64 object_store_id, | 353 int64 object_store_id, |
| 353 const IndexedDBKeyRange& key_range, | 354 const IndexedDBKeyRange& key_range, |
| 354 indexed_db::CursorDirection, | 355 blink::WebIDBCursorDirection, |
| 355 leveldb::Status*); | 356 leveldb::Status*); |
| 356 virtual scoped_ptr<Cursor> OpenIndexKeyCursor( | 357 virtual scoped_ptr<Cursor> OpenIndexKeyCursor( |
| 357 IndexedDBBackingStore::Transaction* transaction, | 358 IndexedDBBackingStore::Transaction* transaction, |
| 358 int64 database_id, | 359 int64 database_id, |
| 359 int64 object_store_id, | 360 int64 object_store_id, |
| 360 int64 index_id, | 361 int64 index_id, |
| 361 const IndexedDBKeyRange& key_range, | 362 const IndexedDBKeyRange& key_range, |
| 362 indexed_db::CursorDirection, | 363 blink::WebIDBCursorDirection, |
| 363 leveldb::Status*); | 364 leveldb::Status*); |
| 364 virtual scoped_ptr<Cursor> OpenIndexCursor( | 365 virtual scoped_ptr<Cursor> OpenIndexCursor( |
| 365 IndexedDBBackingStore::Transaction* transaction, | 366 IndexedDBBackingStore::Transaction* transaction, |
| 366 int64 database_id, | 367 int64 database_id, |
| 367 int64 object_store_id, | 368 int64 object_store_id, |
| 368 int64 index_id, | 369 int64 index_id, |
| 369 const IndexedDBKeyRange& key_range, | 370 const IndexedDBKeyRange& key_range, |
| 370 indexed_db::CursorDirection, | 371 blink::WebIDBCursorDirection, |
| 371 leveldb::Status*); | 372 leveldb::Status*); |
| 372 | 373 |
| 373 class BlobChangeRecord { | 374 class BlobChangeRecord { |
| 374 public: | 375 public: |
| 375 BlobChangeRecord(const std::string& key, int64 object_store_id); | 376 BlobChangeRecord(const std::string& key, int64 object_store_id); |
| 376 ~BlobChangeRecord(); | 377 ~BlobChangeRecord(); |
| 377 const std::string& key() const { return key_; } | 378 const std::string& key() const { return key_; } |
| 378 int64 object_store_id() const { return object_store_id_; } | 379 int64 object_store_id() const { return object_store_id_; } |
| 379 void SetBlobInfo(std::vector<IndexedDBBlobInfo>* blob_info); | 380 void SetBlobInfo(std::vector<IndexedDBBlobInfo>* blob_info); |
| 380 std::vector<IndexedDBBlobInfo>& mutable_blob_info() { return blob_info_; } | 381 std::vector<IndexedDBBlobInfo>& mutable_blob_info() { return blob_info_; } |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 567 // will hold a reference to this backing store. | 568 // will hold a reference to this backing store. |
| 568 IndexedDBActiveBlobRegistry active_blob_registry_; | 569 IndexedDBActiveBlobRegistry active_blob_registry_; |
| 569 base::OneShotTimer<IndexedDBBackingStore> close_timer_; | 570 base::OneShotTimer<IndexedDBBackingStore> close_timer_; |
| 570 | 571 |
| 571 DISALLOW_COPY_AND_ASSIGN(IndexedDBBackingStore); | 572 DISALLOW_COPY_AND_ASSIGN(IndexedDBBackingStore); |
| 572 }; | 573 }; |
| 573 | 574 |
| 574 } // namespace content | 575 } // namespace content |
| 575 | 576 |
| 576 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_BACKING_STORE_H_ | 577 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_BACKING_STORE_H_ |
| OLD | NEW |