| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/child/child_thread_impl.h" | 5 #include "content/child/child_thread_impl.h" |
| 6 | 6 |
| 7 #include <signal.h> | 7 #include <signal.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 #include "content/child/power_monitor_broadcast_source.h" | 44 #include "content/child/power_monitor_broadcast_source.h" |
| 45 #include "content/child/push_messaging/push_dispatcher.h" | 45 #include "content/child/push_messaging/push_dispatcher.h" |
| 46 #include "content/child/quota_dispatcher.h" | 46 #include "content/child/quota_dispatcher.h" |
| 47 #include "content/child/quota_message_filter.h" | 47 #include "content/child/quota_message_filter.h" |
| 48 #include "content/child/resource_dispatcher.h" | 48 #include "content/child/resource_dispatcher.h" |
| 49 #include "content/child/service_worker/service_worker_message_filter.h" | 49 #include "content/child/service_worker/service_worker_message_filter.h" |
| 50 #include "content/child/thread_safe_sender.h" | 50 #include "content/child/thread_safe_sender.h" |
| 51 #include "content/child/websocket_dispatcher.h" | 51 #include "content/child/websocket_dispatcher.h" |
| 52 #include "content/common/child_process_messages.h" | 52 #include "content/common/child_process_messages.h" |
| 53 #include "content/common/in_process_child_thread_params.h" | 53 #include "content/common/in_process_child_thread_params.h" |
| 54 #include "content/common/resource_messages.h" | |
| 55 #include "content/public/common/content_switches.h" | 54 #include "content/public/common/content_switches.h" |
| 56 #include "ipc/attachment_broker_unprivileged.h" | 55 #include "ipc/attachment_broker_unprivileged.h" |
| 57 #include "ipc/ipc_channel.h" | |
| 58 #include "ipc/ipc_logging.h" | 56 #include "ipc/ipc_logging.h" |
| 59 #include "ipc/ipc_switches.h" | 57 #include "ipc/ipc_switches.h" |
| 60 #include "ipc/ipc_sync_channel.h" | 58 #include "ipc/ipc_sync_channel.h" |
| 61 #include "ipc/ipc_sync_message_filter.h" | 59 #include "ipc/ipc_sync_message_filter.h" |
| 62 #include "ipc/mojo/ipc_channel_mojo.h" | 60 #include "ipc/mojo/ipc_channel_mojo.h" |
| 63 | 61 |
| 64 #if defined(TCMALLOC_TRACE_MEMORY_SUPPORTED) | 62 #if defined(TCMALLOC_TRACE_MEMORY_SUPPORTED) |
| 65 #include "third_party/tcmalloc/chromium/src/gperftools/heap-profiler.h" | 63 #include "third_party/tcmalloc/chromium/src/gperftools/heap-profiler.h" |
| 66 #endif | 64 #endif |
| 67 | 65 |
| (...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 } | 389 } |
| 392 #endif | 390 #endif |
| 393 | 391 |
| 394 channel_ = | 392 channel_ = |
| 395 IPC::SyncChannel::Create(this, ChildProcess::current()->io_task_runner(), | 393 IPC::SyncChannel::Create(this, ChildProcess::current()->io_task_runner(), |
| 396 ChildProcess::current()->GetShutDownEvent()); | 394 ChildProcess::current()->GetShutDownEvent()); |
| 397 #ifdef IPC_MESSAGE_LOG_ENABLED | 395 #ifdef IPC_MESSAGE_LOG_ENABLED |
| 398 if (!IsInBrowserProcess()) | 396 if (!IsInBrowserProcess()) |
| 399 IPC::Logging::GetInstance()->SetIPCSender(this); | 397 IPC::Logging::GetInstance()->SetIPCSender(this); |
| 400 #endif | 398 #endif |
| 401 // TODO(erikchen): Temporary code to help track http://crbug.com/527588. | |
| 402 IPC::Channel::SetMessageVerifier( | |
| 403 &content::CheckContentsOfDataReceivedMessage); | |
| 404 | 399 |
| 405 mojo_application_.reset(new MojoApplication(GetIOTaskRunner())); | 400 mojo_application_.reset(new MojoApplication(GetIOTaskRunner())); |
| 406 | 401 |
| 407 sync_message_filter_ = channel_->CreateSyncMessageFilter(); | 402 sync_message_filter_ = channel_->CreateSyncMessageFilter(); |
| 408 thread_safe_sender_ = new ThreadSafeSender( | 403 thread_safe_sender_ = new ThreadSafeSender( |
| 409 message_loop_->task_runner(), sync_message_filter_.get()); | 404 message_loop_->task_runner(), sync_message_filter_.get()); |
| 410 | 405 |
| 411 resource_dispatcher_.reset(new ResourceDispatcher( | 406 resource_dispatcher_.reset(new ResourceDispatcher( |
| 412 this, message_loop()->task_runner())); | 407 this, message_loop()->task_runner())); |
| 413 websocket_dispatcher_.reset(new WebSocketDispatcher); | 408 websocket_dispatcher_.reset(new WebSocketDispatcher); |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 743 void ChildThreadImpl::EnsureConnected() { | 738 void ChildThreadImpl::EnsureConnected() { |
| 744 VLOG(0) << "ChildThreadImpl::EnsureConnected()"; | 739 VLOG(0) << "ChildThreadImpl::EnsureConnected()"; |
| 745 base::Process::Current().Terminate(0, false); | 740 base::Process::Current().Terminate(0, false); |
| 746 } | 741 } |
| 747 | 742 |
| 748 bool ChildThreadImpl::IsInBrowserProcess() const { | 743 bool ChildThreadImpl::IsInBrowserProcess() const { |
| 749 return browser_process_io_runner_; | 744 return browser_process_io_runner_; |
| 750 } | 745 } |
| 751 | 746 |
| 752 } // namespace content | 747 } // namespace content |
| OLD | NEW |