| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "content/common/child_thread.h" | 5 #include "content/common/child_thread.h" |
| 6 | 6 |
| 7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "content/common/child_process.h" | 10 #include "content/common/child_process.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 on_channel_error_called_ = false; | 38 on_channel_error_called_ = false; |
| 39 message_loop_ = MessageLoop::current(); | 39 message_loop_ = MessageLoop::current(); |
| 40 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kUserAgent)) { | 40 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kUserAgent)) { |
| 41 webkit_glue::SetUserAgent( | 41 webkit_glue::SetUserAgent( |
| 42 CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | 42 CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
| 43 switches::kUserAgent)); | 43 switches::kUserAgent)); |
| 44 } | 44 } |
| 45 | 45 |
| 46 channel_.reset(new IPC::SyncChannel(channel_name_, | 46 channel_.reset(new IPC::SyncChannel(channel_name_, |
| 47 IPC::Channel::MODE_CLIENT, this, | 47 IPC::Channel::MODE_CLIENT, this, |
| 48 ChildProcess::current()->io_message_loop(), true, | 48 ChildProcess::current()->io_message_loop_proxy(), true, |
| 49 ChildProcess::current()->GetShutDownEvent())); | 49 ChildProcess::current()->GetShutDownEvent())); |
| 50 #ifdef IPC_MESSAGE_LOG_ENABLED | 50 #ifdef IPC_MESSAGE_LOG_ENABLED |
| 51 IPC::Logging::GetInstance()->SetIPCSender(this); | 51 IPC::Logging::GetInstance()->SetIPCSender(this); |
| 52 #endif | 52 #endif |
| 53 | 53 |
| 54 resource_dispatcher_.reset(new ResourceDispatcher(this)); | 54 resource_dispatcher_.reset(new ResourceDispatcher(this)); |
| 55 socket_stream_dispatcher_.reset(new SocketStreamDispatcher()); | 55 socket_stream_dispatcher_.reset(new SocketStreamDispatcher()); |
| 56 file_system_dispatcher_.reset(new FileSystemDispatcher()); | 56 file_system_dispatcher_.reset(new FileSystemDispatcher()); |
| 57 quota_dispatcher_.reset(new QuotaDispatcher()); | 57 quota_dispatcher_.reset(new QuotaDispatcher()); |
| 58 | 58 |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 MessageLoop::current()->Quit(); | 205 MessageLoop::current()->Quit(); |
| 206 return; | 206 return; |
| 207 } | 207 } |
| 208 | 208 |
| 209 // The child process shutdown sequence is a request response based mechanism, | 209 // The child process shutdown sequence is a request response based mechanism, |
| 210 // where we send out an initial feeler request to the child process host | 210 // where we send out an initial feeler request to the child process host |
| 211 // instance in the browser to verify if it's ok to shutdown the child process. | 211 // instance in the browser to verify if it's ok to shutdown the child process. |
| 212 // The browser then sends back a response if it's ok to shutdown. | 212 // The browser then sends back a response if it's ok to shutdown. |
| 213 Send(new ChildProcessHostMsg_ShutdownRequest); | 213 Send(new ChildProcessHostMsg_ShutdownRequest); |
| 214 } | 214 } |
| OLD | NEW |