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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "content/browser/indexed_db/indexed_db_open_request_observer.h"
6
7 #include "content/browser/indexed_db/indexed_db_connection.h"
8
9 namespace content {
10
11 IndexedDBOpenRequestObserver::IndexedDBOpenRequestObserver(
12 ::indexed_db::mojom::OpenRequestObserverPtr observer)
13 : observer_(std::move(observer)) {}
14
15 IndexedDBOpenRequestObserver::~IndexedDBOpenRequestObserver() = default;
16
17 void IndexedDBOpenRequestObserver::OnBlocked(int64_t old_version) {
18 observer_->OnBlocked(old_version);
19 }
20
21 void IndexedDBOpenRequestObserver::OnUpgradeNeeded(
22 int64_t old_version,
23 IndexedDBConnection* connection,
24 const IndexedDBDatabaseMetadata& index_metadata) {
25 NOTREACHED() << "Pass in DataLossInfo";
26 ::indexed_db::mojom::DataLossInfoPtr data_loss_info =
27 ::indexed_db::mojom::DataLossInfo::New();
28 ::indexed_db::mojom::DatabasePtr database = connection->CreateInterface();
29 ::indexed_db::mojom::DatabaseMetadataPtr metadata;
30 observer_->OnUpgradeNeeded(old_version, std::move(database),
31 index_metadata, std::move(data_loss_info));
32 }
33
34 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698