Index: content/browser/indexed_db/indexed_db_database_callbacks_wrapper.cc |
diff --git a/content/browser/indexed_db/indexed_db_database_callbacks_wrapper.cc b/content/browser/indexed_db/indexed_db_database_callbacks_wrapper.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..6e99f0cd38442d3172539b0289e3fbd490a12e0a |
--- /dev/null |
+++ b/content/browser/indexed_db/indexed_db_database_callbacks_wrapper.cc |
@@ -0,0 +1,42 @@ |
+// Copyright (c) 2013 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_database_callbacks_wrapper.h" |
+ |
+namespace content { |
+ |
+IndexedDBDatabaseCallbacksWrapper::IndexedDBDatabaseCallbacksWrapper( |
+ WebKit::WebIDBDatabaseCallbacks* callbacks) |
+ : callbacks_(callbacks) {} |
+IndexedDBDatabaseCallbacksWrapper::~IndexedDBDatabaseCallbacksWrapper() {} |
+ |
+void IndexedDBDatabaseCallbacksWrapper::OnForcedClose() { |
+ if (!callbacks_) |
+ return; |
+ callbacks_->onForcedClose(); |
+ callbacks_.reset(); |
+} |
+void IndexedDBDatabaseCallbacksWrapper::OnVersionChange(int64 old_version, |
+ int64 new_version) { |
+ if (!callbacks_) |
+ return; |
+ callbacks_->onVersionChange(old_version, new_version); |
+} |
+ |
+void IndexedDBDatabaseCallbacksWrapper::OnAbort( |
+ int64 transaction_id, |
+ scoped_refptr<IndexedDBDatabaseError> error) { |
+ if (!callbacks_) |
+ return; |
+ callbacks_->onAbort( |
+ transaction_id, |
+ WebKit::WebIDBDatabaseError(error->code(), error->message())); |
+} |
+void IndexedDBDatabaseCallbacksWrapper::OnComplete(int64 transaction_id) { |
+ if (!callbacks_) |
+ return; |
+ callbacks_->onComplete(transaction_id); |
+} |
+ |
+} // namespace content |