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

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

Issue 1960513002: [Merge to M50] IPC: Fix attachment brokering race condition. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2661
Patch Set: Created 4 years, 7 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/child/child_thread_impl.cc ('k') | ipc/ipc_channel_proxy.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"
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 filter->OnFilterAdded(channel_.get()); 125 filter->OnFilterAdded(channel_.get());
126 } 126 }
127 127
128 void ChildProcessHostImpl::ForceShutdown() { 128 void ChildProcessHostImpl::ForceShutdown() {
129 Send(new ChildProcessMsg_Shutdown()); 129 Send(new ChildProcessMsg_Shutdown());
130 } 130 }
131 131
132 std::string ChildProcessHostImpl::CreateChannel() { 132 std::string ChildProcessHostImpl::CreateChannel() {
133 channel_id_ = IPC::Channel::GenerateVerifiedChannelID(std::string()); 133 channel_id_ = IPC::Channel::GenerateVerifiedChannelID(std::string());
134 channel_ = IPC::Channel::CreateServer(channel_id_, this); 134 channel_ = IPC::Channel::CreateServer(channel_id_, this);
135 if (!channel_->Connect())
136 return std::string();
137 #if USE_ATTACHMENT_BROKER 135 #if USE_ATTACHMENT_BROKER
138 IPC::AttachmentBroker::GetGlobal()->RegisterCommunicationChannel( 136 IPC::AttachmentBroker::GetGlobal()->RegisterCommunicationChannel(
139 channel_.get()); 137 channel_.get());
140 #endif 138 #endif
139 if (!channel_->Connect()) {
140 #if USE_ATTACHMENT_BROKER
141 IPC::AttachmentBroker::GetGlobal()->DeregisterCommunicationChannel(
142 channel_.get());
143 #endif
144 return std::string();
145 }
141 146
142 for (size_t i = 0; i < filters_.size(); ++i) 147 for (size_t i = 0; i < filters_.size(); ++i)
143 filters_[i]->OnFilterAdded(channel_.get()); 148 filters_[i]->OnFilterAdded(channel_.get());
144 149
145 // Make sure these messages get sent first. 150 // Make sure these messages get sent first.
146 #if defined(IPC_MESSAGE_LOG_ENABLED) 151 #if defined(IPC_MESSAGE_LOG_ENABLED)
147 bool enabled = IPC::Logging::GetInstance()->Enabled(); 152 bool enabled = IPC::Logging::GetInstance()->Enabled();
148 Send(new ChildProcessMsg_SetIPCLoggingEnabled(enabled)); 153 Send(new ChildProcessMsg_SetIPCLoggingEnabled(enabled));
149 #endif 154 #endif
150 155
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 } 328 }
324 329
325 void ChildProcessHostImpl::OnDeletedGpuMemoryBuffer( 330 void ChildProcessHostImpl::OnDeletedGpuMemoryBuffer(
326 gfx::GpuMemoryBufferId id, 331 gfx::GpuMemoryBufferId id,
327 const gpu::SyncToken& sync_token) { 332 const gpu::SyncToken& sync_token) {
328 // Note: Nothing to do here as ownership of shared memory backed 333 // Note: Nothing to do here as ownership of shared memory backed
329 // GpuMemoryBuffers is passed with IPC. 334 // GpuMemoryBuffers is passed with IPC.
330 } 335 }
331 336
332 } // namespace content 337 } // namespace content
OLDNEW
« no previous file with comments | « content/child/child_thread_impl.cc ('k') | ipc/ipc_channel_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698