Index: content/browser/indexed_db/indexed_db_pending_connection.cc |
diff --git a/content/browser/indexed_db/indexed_db_pending_connection.cc b/content/browser/indexed_db/indexed_db_pending_connection.cc |
index 34f4924285ca8f5d18589fbb2303d6970c7820e2..df965e46c7d743d162cf6a55711b0647a644fbbc 100644 |
--- a/content/browser/indexed_db/indexed_db_pending_connection.cc |
+++ b/content/browser/indexed_db/indexed_db_pending_connection.cc |
@@ -4,23 +4,58 @@ |
#include "content/browser/indexed_db/indexed_db_pending_connection.h" |
+#include "content/browser/indexed_db/indexed_db_connection.h" |
+#include "content/browser/indexed_db/indexed_db_metadata.h" |
+#include "content/browser/indexed_db/indexed_db_open_request_observer.h" |
+ |
namespace content { |
IndexedDBPendingConnection::IndexedDBPendingConnection( |
- scoped_refptr<IndexedDBCallbacks> callbacks_in, |
- scoped_refptr<IndexedDBDatabaseCallbacks> database_callbacks_in, |
- int child_process_id_in, |
- int64_t transaction_id_in, |
- int64_t version_in) |
- : callbacks(callbacks_in), |
- database_callbacks(database_callbacks_in), |
- child_process_id(child_process_id_in), |
- transaction_id(transaction_id_in), |
- version(version_in) {} |
+ const OpenResultCallback& open_callback, |
+ scoped_refptr<IndexedDBDatabaseCallbacks> database_callbacks, |
+ scoped_refptr<IndexedDBOpenRequestObserver> open_observer, |
+ int child_process_id, |
+ int64_t transaction_id, |
+ int64_t version) |
+ : open_callback_(open_callback), |
+ database_callbacks_(database_callbacks), |
+ open_observer_(open_observer), |
+ child_process_id_(child_process_id), |
+ transaction_id_(transaction_id), |
+ version_(version) {} |
IndexedDBPendingConnection::IndexedDBPendingConnection( |
const IndexedDBPendingConnection& other) = default; |
IndexedDBPendingConnection::~IndexedDBPendingConnection() {} |
+void IndexedDBPendingConnection::OnError( |
+ const IndexedDBDatabaseError& error) const { |
+ IndexedDBDatabaseMetadata metadata; |
+ open_callback_.Run(nullptr, metadata, error); |
+} |
+ |
+void IndexedDBPendingConnection::OnDataLoss( |
+ blink::WebIDBDataLoss data_loss, |
+ std::string data_loss_message) const { |
+ // TODO(cmumford): Move this to the database callbacks. |
+ // database_callbacks_->OnDataLoss(); |
+} |
+ |
+blink::WebIDBDataLoss IndexedDBPendingConnection::data_loss() const { |
+ // TODO(cmumford): Get this from IndexedDBDatabaseCallbacks once moved. |
+ return blink::WebIDBDataLossNone; |
+} |
+ |
+void IndexedDBPendingConnection::OnSuccess( |
+ std::unique_ptr<IndexedDBConnection> connection, |
+ const IndexedDBDatabaseMetadata& metadata) const { |
+ IndexedDBDatabaseError error; |
+ open_callback_.Run(std::move(connection), metadata, error); |
+} |
+ |
+void IndexedDBPendingConnection::OnBlocked(int64_t old_version) { |
+ open_observer_->OnBlocked(old_version); |
+} |
+ |
} // namespace content |