Index: content/browser/indexed_db/indexed_db_open_request_observer_impl.cc |
diff --git a/content/browser/indexed_db/indexed_db_open_request_observer_impl.cc b/content/browser/indexed_db/indexed_db_open_request_observer_impl.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..d60f263f128cbba5762d08e57e9896cf0afcebb2 |
--- /dev/null |
+++ b/content/browser/indexed_db/indexed_db_open_request_observer_impl.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_impl.h" |
+ |
+#include <utility> |
+ |
+#include "content/browser/indexed_db/indexed_db_connection.h" |
+ |
+namespace content { |
+ |
+IndexedDBOpenRequestObserverImpl::IndexedDBOpenRequestObserverImpl( |
+ ::indexed_db::mojom::OpenRequestObserverPtr observer) |
+ : observer_(std::move(observer)) {} |
+ |
+IndexedDBOpenRequestObserverImpl::~IndexedDBOpenRequestObserverImpl() = default; |
+ |
+void IndexedDBOpenRequestObserverImpl::OnBlocked(int64_t old_version) { |
+ observer_->OnBlocked(old_version); |
+} |
+ |
+void IndexedDBOpenRequestObserverImpl::OnUpgradeNeeded( |
+ int64_t old_version, |
+ IndexedDBConnection* connection, |
+ const content::IndexedDBDataLossInfo& data_loss_info, |
+ const IndexedDBDatabaseMetadata& index_metadata) { |
+ ::indexed_db::mojom::DatabasePtr interface; |
+ connection->Bind(GetProxy(&interface)); |
+ observer_->OnUpgradeNeeded(old_version, std::move(interface), index_metadata, |
+ data_loss_info); |
+} |
+ |
+} // namespace content |