Index: content/browser/indexed_db/indexed_db_transaction.h |
diff --git a/content/browser/indexed_db/indexed_db_transaction.h b/content/browser/indexed_db/indexed_db_transaction.h |
index 111101fe09f0818bfbbdc2311dc69b3f63da8801..cd297d752e14cb74947a779b4b24aef8424be736 100644 |
--- a/content/browser/indexed_db/indexed_db_transaction.h |
+++ b/content/browser/indexed_db/indexed_db_transaction.h |
@@ -19,6 +19,7 @@ |
namespace content { |
+class BlobWriteCallbackImpl; |
class IndexedDBCursor; |
class IndexedDBDatabaseCallbacks; |
@@ -63,9 +64,11 @@ class IndexedDBTransaction : public base::RefCounted<IndexedDBTransaction> { |
IndexedDBDatabaseCallbacks* connection() const { return callbacks_; } |
enum State { |
- CREATED, // Created, but not yet started by coordinator. |
- STARTED, // Started by the coordinator. |
- FINISHED, // Either aborted or committed. |
+ CREATED, // Created, but not yet started by coordinator. |
+ STARTED, // Started by the coordinator. |
+ COMMITTING, // In the process of committing, possibly waiting for blobs |
+ // to be written. |
+ FINISHED, // Either aborted or committed. |
}; |
State state() const { return state_; } |
@@ -80,6 +83,12 @@ class IndexedDBTransaction : public base::RefCounted<IndexedDBTransaction> { |
const Diagnostics& diagnostics() const { return diagnostics_; } |
private: |
+ friend class BlobWriteCallbackImpl; |
+ |
+ // TODO(ericu): Report this on the internals page. |
+ bool IsStatePastRunning() const { |
+ return state_ == COMMITTING || state_ == FINISHED; |
+ } |
friend class base::RefCounted<IndexedDBTransaction>; |
virtual ~IndexedDBTransaction(); |
@@ -88,8 +97,10 @@ class IndexedDBTransaction : public base::RefCounted<IndexedDBTransaction> { |
bool IsTaskQueueEmpty() const; |
bool HasPendingTasks() const; |
+ void BlobWriteComplete(bool success); |
void ProcessTaskQueue(); |
void CloseOpenCursors(); |
+ void CommitPhaseTwo(); |
const int64 id_; |
const std::set<int64> object_store_ids_; |
@@ -98,6 +109,7 @@ class IndexedDBTransaction : public base::RefCounted<IndexedDBTransaction> { |
bool used_; |
State state_; |
bool commit_pending_; |
+ bool blob_write_success_; |
scoped_refptr<IndexedDBDatabaseCallbacks> callbacks_; |
scoped_refptr<IndexedDBDatabase> database_; |