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

Unified Diff: content/renderer/mojo/mojo_render_process_observer.h

Issue 195993010: Adds the ability for the renderer to create the mojo channel (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use_mojo Created 6 years, 9 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
« no previous file with comments | « content/content_renderer.gypi ('k') | content/renderer/mojo/mojo_render_process_observer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/mojo/mojo_render_process_observer.h
diff --git a/content/renderer/mojo/mojo_render_process_observer.h b/content/renderer/mojo/mojo_render_process_observer.h
new file mode 100644
index 0000000000000000000000000000000000000000..95f1b7053d373f9c32509aa2974a8a06e9777d07
--- /dev/null
+++ b/content/renderer/mojo/mojo_render_process_observer.h
@@ -0,0 +1,48 @@
+// Copyright 2014 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_MOJO_MOJO_RENDER_PROCESS_OBSERVER_H_
+#define CONTENT_RENDERER_MOJO_MOJO_RENDER_PROCESS_OBSERVER_H_
+
+#include "base/memory/scoped_ptr.h"
+#include "content/public/renderer/render_process_observer.h"
+#include "ipc/ipc_platform_file.h"
+
+namespace mojo {
+namespace embedder{
+struct ChannelInfo;
+}
+}
+
+namespace content {
+
+class MojoChannelInit;
+class RenderThread;
+
+// RenderProcessObserver implementation that initializes the mojo channel when
+// the right IPC is seen.
+// MojoRenderProcessObserver deletes itself when the RenderProcess is shutdown.
+class MojoRenderProcessObserver : public content::RenderProcessObserver {
+ public:
+ MojoRenderProcessObserver(RenderThread* render_thread);
+
+ // RenderProcessObserver overrides:
+ virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE;
+ virtual void OnRenderProcessShutdown() OVERRIDE;
+
+ private:
+ virtual ~MojoRenderProcessObserver();
+
+ void OnChannelCreated(const IPC::PlatformFileForTransit& file);
+
+ content::RenderThread* render_thread_;
+
+ scoped_ptr<MojoChannelInit> channel_init_;
+
+ DISALLOW_COPY_AND_ASSIGN(MojoRenderProcessObserver);
+};
+
+} // namespace content
+
+#endif // CONTENT_RENDERER_MOJO_MOJO_RENDER_PROCESS_OBSERVER_H_
« no previous file with comments | « content/content_renderer.gypi ('k') | content/renderer/mojo/mojo_render_process_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698