OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_COMMON_CHILD_PROCESS_HOST_H_ | 5 #ifndef CHROME_COMMON_CHILD_PROCESS_HOST_H_ |
6 #define CHROME_COMMON_CHILD_PROCESS_HOST_H_ | 6 #define CHROME_COMMON_CHILD_PROCESS_HOST_H_ |
7 | 7 |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 | 9 |
10 #include <list> | 10 #include <list> |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 void InstanceCreated(); | 67 void InstanceCreated(); |
68 | 68 |
69 // IPC::Channel::Listener implementation: | 69 // IPC::Channel::Listener implementation: |
70 virtual void OnMessageReceived(const IPC::Message& msg) { } | 70 virtual void OnMessageReceived(const IPC::Message& msg) { } |
71 virtual void OnChannelConnected(int32 peer_pid) { } | 71 virtual void OnChannelConnected(int32 peer_pid) { } |
72 virtual void OnChannelError() { } | 72 virtual void OnChannelError() { } |
73 | 73 |
74 bool opening_channel() { return opening_channel_; } | 74 bool opening_channel() { return opening_channel_; } |
75 const std::wstring& channel_id() { return channel_id_; } | 75 const std::wstring& channel_id() { return channel_id_; } |
76 | 76 |
| 77 const IPC::Channel& channel() const { return *channel_; } |
| 78 |
77 private: | 79 private: |
78 // Sends the given notification to the notification service on the UI thread. | 80 // Sends the given notification to the notification service on the UI thread. |
79 void Notify(NotificationType type); | 81 void Notify(NotificationType type); |
80 | 82 |
81 // WaitableEventWatcher::Delegate implementation: | 83 // WaitableEventWatcher::Delegate implementation: |
82 virtual void OnWaitableEventSignaled(base::WaitableEvent *event); | 84 virtual void OnWaitableEventSignaled(base::WaitableEvent *event); |
83 | 85 |
84 // By using an internal class as the IPC::Channel::Listener, we can intercept | 86 // By using an internal class as the IPC::Channel::Listener, we can intercept |
85 // OnMessageReceived/OnChannelConnected and do our own processing before | 87 // OnMessageReceived/OnChannelConnected and do our own processing before |
86 // calling the subclass' implementation. | 88 // calling the subclass' implementation. |
(...skipping 20 matching lines...) Expand all Loading... |
107 // IPC Channel's id. | 109 // IPC Channel's id. |
108 std::wstring channel_id_; | 110 std::wstring channel_id_; |
109 | 111 |
110 // Used to watch the child process handle. | 112 // Used to watch the child process handle. |
111 base::WaitableEventWatcher watcher_; | 113 base::WaitableEventWatcher watcher_; |
112 | 114 |
113 scoped_ptr<base::WaitableEvent> process_event_; | 115 scoped_ptr<base::WaitableEvent> process_event_; |
114 }; | 116 }; |
115 | 117 |
116 #endif // CHROME_COMMON_CHILD_PROCESS_HOST_H_ | 118 #endif // CHROME_COMMON_CHILD_PROCESS_HOST_H_ |
OLD | NEW |