1 // Copyright 2013 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.
5 #include "content/browser/indexed_db/indexed_db_connection.h"
9 IndexedDBConnection::IndexedDBConnection(
10 scoped_refptr
<IndexedDBDatabase
> database
,
11 scoped_refptr
<IndexedDBDatabaseCallbacks
> callbacks
)
12 : database_(database
), callbacks_(callbacks
) {}
14 IndexedDBConnection::~IndexedDBConnection() {}
16 void IndexedDBConnection::Close() {
17 if (!callbacks_
.get())
19 database_
->Close(this, false /* forced */);
24 void IndexedDBConnection::ForceClose() {
25 if (!callbacks_
.get())
27 database_
->Close(this, true /* forced */);
29 callbacks_
->OnForcedClose();
33 void IndexedDBConnection::VersionChangeIgnored() {
36 database_
->VersionChangeIgnored();
39 bool IndexedDBConnection::IsConnected() {
40 return database_
.get() != NULL
;
43 } // namespace content