| 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_TRANSACTION_H_ | 5 #ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_TRANSACTION_H_ |
| 6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_TRANSACTION_H_ | 6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_TRANSACTION_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 #include <queue> | 11 #include <queue> |
| 12 #include <set> | 12 #include <set> |
| 13 #include <stack> | 13 #include <stack> |
| 14 | 14 |
| 15 #include "base/gtest_prod_util.h" | 15 #include "base/gtest_prod_util.h" |
| 16 #include "base/macros.h" | 16 #include "base/macros.h" |
| 17 #include "base/memory/ref_counted.h" | 17 #include "base/memory/ref_counted.h" |
| 18 #include "base/memory/weak_ptr.h" | 18 #include "base/memory/weak_ptr.h" |
| 19 #include "base/time/time.h" | 19 #include "base/time/time.h" |
| 20 #include "base/timer/timer.h" | 20 #include "base/timer/timer.h" |
| 21 #include "content/browser/indexed_db/indexed_db_backing_store.h" | 21 #include "content/browser/indexed_db/indexed_db_backing_store.h" |
| 22 #include "content/browser/indexed_db/indexed_db_connection.h" | 22 #include "content/browser/indexed_db/indexed_db_connection.h" |
| 23 #include "content/browser/indexed_db/indexed_db_database.h" | 23 #include "content/browser/indexed_db/indexed_db_database.h" |
| 24 #include "content/browser/indexed_db/indexed_db_database_error.h" | 24 #include "content/browser/indexed_db/indexed_db_database_error.h" |
| 25 #include "content/browser/indexed_db/indexed_db_observer.h" | 25 #include "content/browser/indexed_db/indexed_db_observer.h" |
| 26 #include "content/common/indexed_db/indexed_db.mojom.h" |
| 26 #include "third_party/WebKit/public/platform/modules/indexeddb/WebIDBTypes.h" | 27 #include "third_party/WebKit/public/platform/modules/indexeddb/WebIDBTypes.h" |
| 27 | 28 |
| 28 namespace content { | 29 namespace content { |
| 29 | 30 |
| 30 class BlobWriteCallbackImpl; | 31 class BlobWriteCallbackImpl; |
| 31 class IndexedDBCursor; | 32 class IndexedDBCursor; |
| 32 class IndexedDBDatabaseCallbacks; | 33 class IndexedDBDatabaseCallbacks; |
| 33 | 34 |
| 34 class CONTENT_EXPORT IndexedDBTransaction { | 35 class CONTENT_EXPORT IndexedDBTransaction { |
| 35 public: | 36 public: |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 DCHECK_GE(pending_preemptive_events_, 0); | 73 DCHECK_GE(pending_preemptive_events_, 0); |
| 73 } | 74 } |
| 74 void AddPendingObserver(int32_t observer_id, | 75 void AddPendingObserver(int32_t observer_id, |
| 75 const IndexedDBObserver::Options& options); | 76 const IndexedDBObserver::Options& options); |
| 76 // Delete pending observers with ID's listed in |pending_observer_ids|. | 77 // Delete pending observers with ID's listed in |pending_observer_ids|. |
| 77 void RemovePendingObservers(const std::vector<int32_t>& pending_observer_ids); | 78 void RemovePendingObservers(const std::vector<int32_t>& pending_observer_ids); |
| 78 | 79 |
| 79 // Adds observation for the connection. | 80 // Adds observation for the connection. |
| 80 void AddObservation(int32_t connection_id, | 81 void AddObservation(int32_t connection_id, |
| 81 ::indexed_db::mojom::ObservationPtr observation); | 82 ::indexed_db::mojom::ObservationPtr observation); |
| 82 // Adds the last observation index to observer_id's list of recorded | 83 |
| 83 // observation indices. | 84 ::indexed_db::mojom::ObserverChangesPtr* GetPendingChangesForConnection( |
| 84 void RecordObserverForLastObservation(int32_t connection_id, | 85 int32_t connection_id); |
| 85 int32_t observer_id); | |
| 86 | 86 |
| 87 IndexedDBBackingStore::Transaction* BackingStoreTransaction() { | 87 IndexedDBBackingStore::Transaction* BackingStoreTransaction() { |
| 88 return transaction_.get(); | 88 return transaction_.get(); |
| 89 } | 89 } |
| 90 int64_t id() const { return id_; } | 90 int64_t id() const { return id_; } |
| 91 | 91 |
| 92 IndexedDBDatabase* database() const { return database_.get(); } | 92 IndexedDBDatabase* database() const { return database_.get(); } |
| 93 IndexedDBDatabaseCallbacks* callbacks() const { return callbacks_.get(); } | 93 IndexedDBDatabaseCallbacks* callbacks() const { return callbacks_.get(); } |
| 94 IndexedDBConnection* connection() const { return connection_; } | 94 IndexedDBConnection* connection() const { return connection_; } |
| 95 | 95 |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 base::OneShotTimer timeout_timer_; | 219 base::OneShotTimer timeout_timer_; |
| 220 | 220 |
| 221 Diagnostics diagnostics_; | 221 Diagnostics diagnostics_; |
| 222 | 222 |
| 223 base::WeakPtrFactory<IndexedDBTransaction> ptr_factory_; | 223 base::WeakPtrFactory<IndexedDBTransaction> ptr_factory_; |
| 224 }; | 224 }; |
| 225 | 225 |
| 226 } // namespace content | 226 } // namespace content |
| 227 | 227 |
| 228 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_TRANSACTION_H_ | 228 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_TRANSACTION_H_ |
| OLD | NEW |