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

Unified Diff: content/renderer/presentation/renderer_presentation_connection.h

Issue 2379703002: [Presentation API] (alternative) 1-UA: send message between controller and receiver page (Closed)
Patch Set: resolve code review comments from Mark 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/renderer/presentation/renderer_presentation_connection.h
diff --git a/content/renderer/presentation/renderer_presentation_connection.h b/content/renderer/presentation/renderer_presentation_connection.h
new file mode 100644
index 0000000000000000000000000000000000000000..aafeb73415eb7fdf419246e72db2402e9eb77fb2
--- /dev/null
+++ b/content/renderer/presentation/renderer_presentation_connection.h
@@ -0,0 +1,44 @@
+// 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_RENDERER_PRESENTATION_RENDERER_PRESENTATION_CONNECTION_H_
+#define CONTENT_RENDERER_PRESENTATION_RENDERER_PRESENTATION_CONNECTION_H_
+
+#include "base/callback.h"
+#include "mojo/public/cpp/bindings/binding.h"
+#include "third_party/WebKit/public/platform/modules/presentation/WebPresentationConnection.h"
+#include "third_party/WebKit/public/platform/modules/presentation/WebPresentationConnectionProxy.h"
+#include "third_party/WebKit/public/platform/modules/presentation/presentation.mojom.h"
+
+namespace content {
+
mark a. foltz 2016/10/10 18:28:52 Can you add a class-level comment describing what
zhaobin 2016/10/12 02:27:34 Done.
+class RendererPresentationConnection
mark a. foltz 2016/10/10 18:28:52 There is already a PresentationConnection object i
zhaobin 2016/10/12 02:27:34 Done.
+ : public blink::WebPresentationConnectionProxy,
+ public NON_EXPORTED_BASE(blink::mojom::PresentationConnection) {
+ public:
+ RendererPresentationConnection();
+ ~RendererPresentationConnection() override;
+
+ blink::mojom::PresentationConnectionPtr Bind();
+
+ // WebPresentationConnectionProxy Implementation
+ void SetConnection(blink::WebPresentationConnection* connection) override;
mark a. foltz 2016/10/10 18:28:52 Maybe SetSourceConnection?
zhaobin 2016/10/12 02:27:34 Done.
+ void SendString(const blink::WebString& message) override;
+ void SendArrayBuffer(const uint8_t* data, size_t length) override;
+
+ // blink::mojom::PresentationConnection implementation
+ void SetTargetConnection(
+ blink::mojom::PresentationConnectionPtr connection) override;
+ void OnSessionMessageReceived(
mark a. foltz 2016/10/10 18:28:52 OnConnectionMessageReceived
zhaobin 2016/10/12 02:27:34 Done.
+ blink::mojom::SessionMessagePtr message) override;
+
+ private:
+ mojo::Binding<blink::mojom::PresentationConnection> binding_;
+ blink::mojom::PresentationConnectionPtr target_connection_;
+ blink::WebPresentationConnection* connection_;
mark a. foltz 2016/10/10 18:28:52 source_connection_
zhaobin 2016/10/12 02:27:34 Done.
+};
+
+} // namespace content
+
+#endif // CONTENT_RENDERER_PRESENTATION_RENDERER_PRESENTATION_CONNECTION_H_

Powered by Google App Engine
This is Rietveld 408576698