Index: content/browser/indexed_db/indexed_db_open_request_observer.cc |
diff --git a/content/browser/indexed_db/indexed_db_open_request_observer.cc b/content/browser/indexed_db/indexed_db_open_request_observer.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..038b16fda3195fb502adf9af304a032d5dce0530 |
--- /dev/null |
+++ b/content/browser/indexed_db/indexed_db_open_request_observer.cc |
@@ -0,0 +1,34 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "content/browser/indexed_db/indexed_db_open_request_observer.h" |
+ |
+#include "content/browser/indexed_db/indexed_db_connection.h" |
+ |
+namespace content { |
+ |
+IndexedDBOpenRequestObserver::IndexedDBOpenRequestObserver( |
+ ::indexed_db::mojom::OpenRequestObserverPtr observer) |
+ : observer_(std::move(observer)) {} |
+ |
+IndexedDBOpenRequestObserver::~IndexedDBOpenRequestObserver() = default; |
+ |
+void IndexedDBOpenRequestObserver::OnBlocked(int64_t old_version) { |
+ observer_->OnBlocked(old_version); |
+} |
+ |
+void IndexedDBOpenRequestObserver::OnUpgradeNeeded( |
+ int64_t old_version, |
+ IndexedDBConnection* connection, |
+ const IndexedDBDatabaseMetadata& index_metadata) { |
+ NOTREACHED() << "Pass in DataLossInfo"; |
+ ::indexed_db::mojom::DataLossInfoPtr data_loss_info = |
+ ::indexed_db::mojom::DataLossInfo::New(); |
+ ::indexed_db::mojom::DatabasePtr database = connection->CreateInterface(); |
+ ::indexed_db::mojom::DatabaseMetadataPtr metadata; |
+ observer_->OnUpgradeNeeded(old_version, std::move(database), |
+ index_metadata, std::move(data_loss_info)); |
+} |
+ |
+} // namespace content |