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

Unified Diff: content/child/indexed_db/indexed_db_callbacks_impl.h

Issue 2370643004: Port messages sent by WebIDBFactoryImpl to Mojo. (Closed)
Patch Set: Addressed most of dcheng@'s feedback. Created 4 years, 2 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/child/indexed_db/indexed_db_callbacks_impl.h
diff --git a/content/child/indexed_db/indexed_db_callbacks_impl.h b/content/child/indexed_db/indexed_db_callbacks_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..2284f517cfeda9f24564fa687e97d584e61d565b
--- /dev/null
+++ b/content/child/indexed_db/indexed_db_callbacks_impl.h
@@ -0,0 +1,53 @@
+// 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.
+
+#ifndef CONTENT_CHILD_INDEXED_DB_INDEXED_DB_CALLBACKS_IMPL_H_
+#define CONTENT_CHILD_INDEXED_DB_INDEXED_DB_CALLBACKS_IMPL_H_
+
+#include "content/common/indexed_db/indexed_db.mojom.h"
+#include "mojo/public/cpp/bindings/associated_binding.h"
+
+namespace blink {
+class WebIDBCallbacks;
+}
+
+namespace content {
+
+class ThreadSafeSender;
+
+// Implements the child-process end of the pipe used to deliver callbacks. It
+// is owned by the IO thread. |callback_runner_| is used to post tasks back to
+// the thread which owns the blink::WebIDBCallbacks.
+class IndexedDBCallbacksImpl : public indexed_db::mojom::Callbacks {
+ public:
+ IndexedDBCallbacksImpl(blink::WebIDBCallbacks* callbacks,
+ scoped_refptr<ThreadSafeSender> thread_safe_sender);
+ ~IndexedDBCallbacksImpl() override;
+
+ // indexed_db::mojom::Callbacks implementation
cmumford 2016/10/11 18:30:54 nit: end comment with ':'
Reilly Grant (use Gerrit) 2016/10/11 23:46:13 Done.
+ void Blocked(int64_t existing_version) override;
+ void Error(int32_t code, const base::string16& message) override;
+ void SuccessDatabase(
+ int32_t database_id,
+ indexed_db::mojom::DatabaseMetadataPtr metadata) override;
+ void SuccessInteger(int64_t value) override;
+ void SuccessStringList(const std::vector<base::string16>& value) override;
+ void UpgradeNeeded(int32_t database_id,
+ int64_t old_version,
+ blink::WebIDBDataLoss data_loss,
+ const std::string& data_loss_message,
+ indexed_db::mojom::DatabaseMetadataPtr metadata) override;
+
+ private:
+ class InternalState;
+
+ // |internal_state_| is owned by the thread on which |callback_runner_|
+ // executes tasks and must be destroyed there.
+ InternalState* internal_state_;
+ scoped_refptr<base::SingleThreadTaskRunner> callback_runner_;
cmumford 2016/10/11 18:30:54 DISALLOW_COPY_AND_ASSIGN(IndexedDBCallbacksImpl);
Reilly Grant (use Gerrit) 2016/10/11 23:46:13 Done.
+};
+
+} // namespace content
+
+#endif // CONTENT_CHILD_INDEXED_DB_INDEXED_DB_CALLBACKS_IMPL_H_

Powered by Google App Engine
This is Rietveld 408576698