| 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/common/child_process_host_impl.h" | 5 #include "content/common/child_process_host_impl.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "base/atomic_sequence_num.h" | 9 #include "base/atomic_sequence_num.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 11 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
| 12 #include "base/hash.h" | 12 #include "base/hash.h" |
| 13 #include "base/logging.h" | 13 #include "base/logging.h" |
| 14 #include "base/message_loop/message_loop.h" |
| 14 #include "base/metrics/histogram.h" | 15 #include "base/metrics/histogram.h" |
| 15 #include "base/numerics/safe_math.h" | 16 #include "base/numerics/safe_math.h" |
| 16 #include "base/path_service.h" | 17 #include "base/path_service.h" |
| 17 #include "base/process/process_metrics.h" | 18 #include "base/process/process_metrics.h" |
| 18 #include "base/rand_util.h" | 19 #include "base/rand_util.h" |
| 19 #include "base/strings/stringprintf.h" | 20 #include "base/strings/stringprintf.h" |
| 20 #include "base/synchronization/lock.h" | 21 #include "base/synchronization/lock.h" |
| 21 #include "base/third_party/dynamic_annotations/dynamic_annotations.h" | 22 #include "base/third_party/dynamic_annotations/dynamic_annotations.h" |
| 22 #include "build/build_config.h" | 23 #include "build/build_config.h" |
| 23 #include "content/common/child_process_messages.h" | 24 #include "content/common/child_process_messages.h" |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 Send(new ChildProcessMsg_Shutdown()); | 130 Send(new ChildProcessMsg_Shutdown()); |
| 130 } | 131 } |
| 131 | 132 |
| 132 std::string ChildProcessHostImpl::CreateChannel() { | 133 std::string ChildProcessHostImpl::CreateChannel() { |
| 133 channel_id_ = IPC::Channel::GenerateVerifiedChannelID(std::string()); | 134 channel_id_ = IPC::Channel::GenerateVerifiedChannelID(std::string()); |
| 134 channel_ = IPC::Channel::CreateServer(channel_id_, this); | 135 channel_ = IPC::Channel::CreateServer(channel_id_, this); |
| 135 if (!channel_->Connect()) | 136 if (!channel_->Connect()) |
| 136 return std::string(); | 137 return std::string(); |
| 137 #if USE_ATTACHMENT_BROKER | 138 #if USE_ATTACHMENT_BROKER |
| 138 IPC::AttachmentBroker::GetGlobal()->RegisterCommunicationChannel( | 139 IPC::AttachmentBroker::GetGlobal()->RegisterCommunicationChannel( |
| 139 channel_.get()); | 140 channel_.get(), base::MessageLoopForIO::current()->task_runner()); |
| 140 #endif | 141 #endif |
| 141 | 142 |
| 142 for (size_t i = 0; i < filters_.size(); ++i) | 143 for (size_t i = 0; i < filters_.size(); ++i) |
| 143 filters_[i]->OnFilterAdded(channel_.get()); | 144 filters_[i]->OnFilterAdded(channel_.get()); |
| 144 | 145 |
| 145 // Make sure these messages get sent first. | 146 // Make sure these messages get sent first. |
| 146 #if defined(IPC_MESSAGE_LOG_ENABLED) | 147 #if defined(IPC_MESSAGE_LOG_ENABLED) |
| 147 bool enabled = IPC::Logging::GetInstance()->Enabled(); | 148 bool enabled = IPC::Logging::GetInstance()->Enabled(); |
| 148 Send(new ChildProcessMsg_SetIPCLoggingEnabled(enabled)); | 149 Send(new ChildProcessMsg_SetIPCLoggingEnabled(enabled)); |
| 149 #endif | 150 #endif |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 } | 324 } |
| 324 | 325 |
| 325 void ChildProcessHostImpl::OnDeletedGpuMemoryBuffer( | 326 void ChildProcessHostImpl::OnDeletedGpuMemoryBuffer( |
| 326 gfx::GpuMemoryBufferId id, | 327 gfx::GpuMemoryBufferId id, |
| 327 const gpu::SyncToken& sync_token) { | 328 const gpu::SyncToken& sync_token) { |
| 328 // Note: Nothing to do here as ownership of shared memory backed | 329 // Note: Nothing to do here as ownership of shared memory backed |
| 329 // GpuMemoryBuffers is passed with IPC. | 330 // GpuMemoryBuffers is passed with IPC. |
| 330 } | 331 } |
| 331 | 332 |
| 332 } // namespace content | 333 } // namespace content |
| OLD | NEW |