Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(114)

Side by Side Diff: content/common/child_process_host_impl.cc

Issue 1739203004: Add support for Attachment Brokering of IPC::Channels on multiple threads. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/browser/renderer_host/render_process_host_impl.cc ('k') | ipc/attachment_broker.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_process_host_impl.cc ('k') | ipc/attachment_broker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698