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

Unified Diff: content/browser/render_widget_view_service_listener.h

Issue 1461243002: [OLD ATTEMPT, DO NOT REVIEW] mustash: Enable connections to mus from the Chrome renderer Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Invert connection creation flow. Needs lots of work. Created 5 years, 1 month 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/render_widget_view_service_listener.h
diff --git a/content/browser/render_widget_view_service_listener.h b/content/browser/render_widget_view_service_listener.h
new file mode 100644
index 0000000000000000000000000000000000000000..4aefaeadbf5bd3a04b0baf5f5b20aa8ac6f05cef
--- /dev/null
+++ b/content/browser/render_widget_view_service_listener.h
@@ -0,0 +1,61 @@
+// Copyright 2015 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_BROWSER_MOJO_CONNECTION_LISTENER_H_
+#define CONTENT_BROWSER_MOJO_CONNECTION_LISTENER_H_
+
+#include "content/public/common/mojo_shell_connection.h"
+
+#include "base/macros.h"
+#include "content/browser/render_widget_view.mojom.h"
+#include "mojo/application/public/cpp/interface_factory.h"
+#include "mojo/common/weak_binding_set.h"
+#include "mojo/public/cpp/bindings/strong_binding.h"
+
+namespace content {
+
+class RenderWidgetViewFactoryImpl : public mojom::RenderWidgetViewFactory {
+ public:
+ RenderWidgetViewFactoryImpl(
+ int render_process_id,
+ mojo::InterfaceRequest<mojom::RenderWidgetViewFactory> request);
+ ~RenderWidgetViewFactoryImpl() override;
+
+ private:
+ // mojom::RenderWidgetViewFactory implementation.
+ void CreateRenderWidgetView(
+ uint32_t routing_id,
+ mus::mojom::WindowTreeClientPtr tree_client) override;
+
+ const int render_process_id_;
+ mojo::StrongBinding<RenderWidgetViewFactory> binding_;
+ DISALLOW_COPY_AND_ASSIGN(RenderWidgetViewFactoryImpl);
+};
+
+class RenderWidgetViewServiceListener :
+ public MojoShellConnection::Listener,
+ public mojo::InterfaceFactory<mojom::RenderWidgetViewFactory> {
+ public:
+ static void Create();
+
+ private:
+ RenderWidgetViewServiceListener();
+ ~RenderWidgetViewServiceListener() override;
+
+ // MojoShellConnection::Listener implementation:
+ bool ConfigureIncomingConnection(
+ mojo::ApplicationConnection* connection) override;
+ void OnDestroy() override;
+
+ // mojo::InterfaceFactory<mojom::RenderWidgetViewFactory>:
+ void Create(
+ mojo::ApplicationConnection* connection,
+ mojo::InterfaceRequest<mojom::RenderWidgetViewFactory> request) override;
+
+ DISALLOW_COPY_AND_ASSIGN(RenderWidgetViewServiceListener);
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_MOJO_CONNECTION_LISTENER_H_

Powered by Google App Engine
This is Rietveld 408576698