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

Unified Diff: content/browser/indexed_db/mock_callback_factory.cc

Issue 1963293002: Replacing Indexed DB Chromium IPC with Mojo Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Refactoring after Passing URLRequestContextGetter. Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/indexed_db/mock_callback_factory.cc
diff --git a/content/browser/indexed_db/mock_callback_factory.cc b/content/browser/indexed_db/mock_callback_factory.cc
new file mode 100644
index 0000000000000000000000000000000000000000..6c82e1f220e32d269a402b280296a8bc839eb387
--- /dev/null
+++ b/content/browser/indexed_db/mock_callback_factory.cc
@@ -0,0 +1,39 @@
+// Copyright 2016 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/mock_callback_factory.h"
+
+#include <utility>
+
+#include "base/bind.h"
+#include "content/browser/indexed_db/indexed_db_connection.h"
+
+namespace content {
+
+MockCallbackFactory::MockCallbackFactory() : weak_factory_(this) {}
+
+MockCallbackFactory::~MockCallbackFactory() = default;
+
+DeleteResultCallback MockCallbackFactory::CreateDeleteCallback() {
+ return base::Bind(&MockCallbackFactory::OnDeleteResult, AsWeakPtr());
+}
+
+OpenResultCallback MockCallbackFactory::CreateOpenCallback() {
+ return base::Bind(&MockCallbackFactory::OnOpenResult, AsWeakPtr());
+}
+
+void MockCallbackFactory::OnDeleteResult(int64_t version,
+ const IndexedDBDatabaseError& error) {
+ delete_result_called_ = true;
+}
+
+void MockCallbackFactory::OnOpenResult(
+ std::unique_ptr<IndexedDBConnection> connection,
+ const IndexedDBDatabaseMetadata& metadata,
+ const IndexedDBDatabaseError& error) {
+ connection_ = std::move(connection);
+ open_result_called_ = true;
+}
+
+} // namespace content
« no previous file with comments | « content/browser/indexed_db/mock_callback_factory.h ('k') | content/browser/indexed_db/mock_indexed_db_callbacks.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698