| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 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. | |
| 4 | |
| 5 #include "content/browser/indexed_db/indexed_db_database_callbacks_wrapper.h" | |
| 6 | |
| 7 namespace content { | |
| 8 | |
| 9 IndexedDBDatabaseCallbacksWrapper::IndexedDBDatabaseCallbacksWrapper( | |
| 10 WebKit::WebIDBDatabaseCallbacks* callbacks) | |
| 11 : callbacks_(callbacks) {} | |
| 12 IndexedDBDatabaseCallbacksWrapper::~IndexedDBDatabaseCallbacksWrapper() {} | |
| 13 | |
| 14 void IndexedDBDatabaseCallbacksWrapper::OnForcedClose() { | |
| 15 if (!callbacks_) | |
| 16 return; | |
| 17 callbacks_->onForcedClose(); | |
| 18 callbacks_.reset(); | |
| 19 } | |
| 20 void IndexedDBDatabaseCallbacksWrapper::OnVersionChange(int64 old_version, | |
| 21 int64 new_version) { | |
| 22 if (!callbacks_) | |
| 23 return; | |
| 24 callbacks_->onVersionChange(old_version, new_version); | |
| 25 } | |
| 26 | |
| 27 void IndexedDBDatabaseCallbacksWrapper::OnAbort( | |
| 28 int64 transaction_id, | |
| 29 scoped_refptr<IndexedDBDatabaseError> error) { | |
| 30 if (!callbacks_) | |
| 31 return; | |
| 32 callbacks_->onAbort( | |
| 33 transaction_id, | |
| 34 WebKit::WebIDBDatabaseError(error->code(), error->message())); | |
| 35 } | |
| 36 void IndexedDBDatabaseCallbacksWrapper::OnComplete(int64 transaction_id) { | |
| 37 if (!callbacks_) | |
| 38 return; | |
| 39 callbacks_->onComplete(transaction_id); | |
| 40 } | |
| 41 | |
| 42 } // namespace content | |
| OLD | NEW |