Chromium Code Reviews| OLD | NEW |
|---|---|
| (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_ | |
| OLD | NEW |