| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #include "chrome/common/child_process_host.h" | 5 #include "chrome/common/child_process_host.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "base/third_party/dynamic_annotations/dynamic_annotations.h" | 10 #include "base/third_party/dynamic_annotations/dynamic_annotations.h" |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 | 136 |
| 137 opening_channel_ = true; | 137 opening_channel_ = true; |
| 138 | 138 |
| 139 return true; | 139 return true; |
| 140 } | 140 } |
| 141 | 141 |
| 142 void ChildProcessHost::InstanceCreated() { | 142 void ChildProcessHost::InstanceCreated() { |
| 143 Notify(NotificationType::CHILD_INSTANCE_CREATED); | 143 Notify(NotificationType::CHILD_INSTANCE_CREATED); |
| 144 } | 144 } |
| 145 | 145 |
| 146 bool ChildProcessHost::OnMessageReceived(const IPC::Message& msg) { |
| 147 return false; |
| 148 } |
| 149 |
| 150 void ChildProcessHost::OnChannelConnected(int32 peer_pid) { |
| 151 } |
| 152 |
| 153 void ChildProcessHost::OnChannelError() { |
| 154 } |
| 155 |
| 146 bool ChildProcessHost::Send(IPC::Message* message) { | 156 bool ChildProcessHost::Send(IPC::Message* message) { |
| 147 if (!channel_.get()) { | 157 if (!channel_.get()) { |
| 148 delete message; | 158 delete message; |
| 149 return false; | 159 return false; |
| 150 } | 160 } |
| 151 return channel_->Send(message); | 161 return channel_->Send(message); |
| 152 } | 162 } |
| 153 | 163 |
| 154 void ChildProcessHost::OnChildDied() { | 164 void ChildProcessHost::OnChildDied() { |
| 155 delete this; | 165 delete this; |
| 156 } | 166 } |
| 157 | 167 |
| 168 void ChildProcessHost::ShutdownStarted() { |
| 169 } |
| 170 |
| 171 void ChildProcessHost::Notify(NotificationType type) { |
| 172 } |
| 173 |
| 158 ChildProcessHost::ListenerHook::ListenerHook(ChildProcessHost* host) | 174 ChildProcessHost::ListenerHook::ListenerHook(ChildProcessHost* host) |
| 159 : host_(host) { | 175 : host_(host) { |
| 160 } | 176 } |
| 161 | 177 |
| 162 bool ChildProcessHost::ListenerHook::OnMessageReceived( | 178 bool ChildProcessHost::ListenerHook::OnMessageReceived( |
| 163 const IPC::Message& msg) { | 179 const IPC::Message& msg) { |
| 164 #ifdef IPC_MESSAGE_LOG_ENABLED | 180 #ifdef IPC_MESSAGE_LOG_ENABLED |
| 165 IPC::Logging* logger = IPC::Logging::GetInstance(); | 181 IPC::Logging* logger = IPC::Logging::GetInstance(); |
| 166 if (msg.type() == IPC_LOGGING_ID) { | 182 if (msg.type() == IPC_LOGGING_ID) { |
| 167 logger->OnReceivedLoggingMessage(msg); | 183 logger->OnReceivedLoggingMessage(msg); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 for (size_t i = 0; i < host_->filters_.size(); ++i) | 229 for (size_t i = 0; i < host_->filters_.size(); ++i) |
| 214 host_->filters_[i]->OnChannelError(); | 230 host_->filters_[i]->OnChannelError(); |
| 215 | 231 |
| 216 // This will delete host_, which will also destroy this! | 232 // This will delete host_, which will also destroy this! |
| 217 host_->OnChildDied(); | 233 host_->OnChildDied(); |
| 218 } | 234 } |
| 219 | 235 |
| 220 void ChildProcessHost::ForceShutdown() { | 236 void ChildProcessHost::ForceShutdown() { |
| 221 Send(new PluginProcessMsg_Shutdown()); | 237 Send(new PluginProcessMsg_Shutdown()); |
| 222 } | 238 } |
| OLD | NEW |