Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1068)

Unified Diff: content/browser/indexed_db/indexed_db_open_request_observer.cc

Issue 1963293002: Replacing Indexed DB Chromium IPC with Mojo Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Some (incomplete) work on struct traits. Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698