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

Unified Diff: ipc/mojo/ipc_channel_mojo_host.h

Issue 553283002: IPC::ChannelMojo: Introduce IPC::MojoBootstrap for Windows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed build error Created 6 years, 3 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 | « ipc/mojo/ipc_channel_mojo.cc ('k') | ipc/mojo/ipc_channel_mojo_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/mojo/ipc_channel_mojo_host.h
diff --git a/ipc/mojo/ipc_channel_mojo_host.h b/ipc/mojo/ipc_channel_mojo_host.h
new file mode 100644
index 0000000000000000000000000000000000000000..e0d94beddc119903cac771a1e04bbf08f00f943f
--- /dev/null
+++ b/ipc/mojo/ipc_channel_mojo_host.h
@@ -0,0 +1,49 @@
+// 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 IPC_IPC_CHANNEL_MOJO_HOST_H_
+#define IPC_IPC_CHANNEL_MOJO_HOST_H_
+
+#include "base/memory/ref_counted.h"
+#include "base/memory/weak_ptr.h"
+#include "base/process/process_handle.h"
+#include "ipc/ipc_export.h"
+
+namespace base {
+class TaskRunner;
+}
+
+namespace IPC {
+
+class ChannelMojo;
+
+// Through ChannelMojoHost, ChannelMojo gets extra information that
+// its client provides, including the child process's process handle. Every
+// server process that uses ChannelMojo must have a ChannelMojoHost
+// instance and call OnClientLaunched().
+class IPC_MOJO_EXPORT ChannelMojoHost {
+ public:
+ explicit ChannelMojoHost(scoped_refptr<base::TaskRunner> task_runner);
+ ~ChannelMojoHost();
+
+ void OnClientLaunched(base::ProcessHandle process);
+
+ private:
+ friend class ChannelMojo;
+
+ void OnChannelCreated(ChannelMojo* channel);
+ void OnChannelDestroyed();
+
+ void InvokeOnClientLaunched(base::ProcessHandle process);
+
+ base::WeakPtrFactory<ChannelMojoHost> weak_factory_;
+ scoped_refptr<base::TaskRunner> task_runner_;
+ ChannelMojo* channel_;
+
+ DISALLOW_COPY_AND_ASSIGN(ChannelMojoHost);
+};
+
+} // namespace IPC
+
+#endif // IPC_IPC_CHANNEL_MOJO_HOST_H_
« no previous file with comments | « ipc/mojo/ipc_channel_mojo.cc ('k') | ipc/mojo/ipc_channel_mojo_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698