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

Side by Side 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: Added ChannelMojoHost 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef IPC_IPC_CHANNEL_MOJO_HOST_H_
6 #define IPC_IPC_CHANNEL_MOJO_HOST_H_
7
8 #include "base/memory/ref_counted.h"
9 #include "base/memory/weak_ptr.h"
10 #include "base/process/process_handle.h"
11 #include "ipc/ipc_export.h"
12
13 namespace base {
14 class TaskRunner;
15 }
16
17 namespace IPC {
18
19 class ChannelMojo;
20
21 // Through ChannelMojoHost, ChannelMojo gets extra information that
22 // its client provides, including child preocess' process handle. Every
viettrungluu 2014/09/17 17:33:15 "including the child process's process handle"
Hajime Morrita 2014/09/17 19:33:48 Done.
23 // server process that uses ChannelMojo has to have ChannelMojoHost
24 // instance and call OnClientLaunched().
25 class IPC_MOJO_EXPORT ChannelMojoHost {
26 public:
27 explicit ChannelMojoHost(scoped_refptr<base::TaskRunner> task_runner);
28 ~ChannelMojoHost();
29
30 void OnClientLaunched(base::ProcessHandle process);
31
32 private:
33 friend class ChannelMojo;
34
35 void OnChannelCreated(ChannelMojo* channel);
36 void OnChannelDeleted();
viettrungluu 2014/09/17 17:33:15 "destroyed" would be more idiomatic?
Hajime Morrita 2014/09/17 19:33:48 Done.
37
38 void InvokeOnClientLaunched(base::ProcessHandle process);
39
40 base::WeakPtrFactory<ChannelMojoHost> weak_factory_;
41 scoped_refptr<base::TaskRunner> task_runner_;
42 ChannelMojo* channel_;
43 };
viettrungluu 2014/09/17 17:33:15 nits: - should have a DISALLOW_COPY_AND_ASSIGN (an
Hajime Morrita 2014/09/17 19:33:48 Done.
44 }
45
46 #endif // IPC_IPC_CHANNEL_MOJO_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698