OLD | NEW |
(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 |
OLD | NEW |