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

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

Issue 304153005: Revert 273575 "Introduce IPC::Channel::Create*() to ensure it be..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 if (channel_) 157 if (channel_)
158 filter->OnFilterAdded(channel_.get()); 158 filter->OnFilterAdded(channel_.get());
159 } 159 }
160 160
161 void ChildProcessHostImpl::ForceShutdown() { 161 void ChildProcessHostImpl::ForceShutdown() {
162 Send(new ChildProcessMsg_Shutdown()); 162 Send(new ChildProcessMsg_Shutdown());
163 } 163 }
164 164
165 std::string ChildProcessHostImpl::CreateChannel() { 165 std::string ChildProcessHostImpl::CreateChannel() {
166 channel_id_ = IPC::Channel::GenerateVerifiedChannelID(std::string()); 166 channel_id_ = IPC::Channel::GenerateVerifiedChannelID(std::string());
167 channel_ = IPC::Channel::CreateServer(channel_id_, this); 167 channel_.reset(new IPC::Channel(
168 channel_id_, IPC::Channel::MODE_SERVER, this));
168 if (!channel_->Connect()) 169 if (!channel_->Connect())
169 return std::string(); 170 return std::string();
170 171
171 for (size_t i = 0; i < filters_.size(); ++i) 172 for (size_t i = 0; i < filters_.size(); ++i)
172 filters_[i]->OnFilterAdded(channel_.get()); 173 filters_[i]->OnFilterAdded(channel_.get());
173 174
174 // Make sure these messages get sent first. 175 // Make sure these messages get sent first.
175 #if defined(IPC_MESSAGE_LOG_ENABLED) 176 #if defined(IPC_MESSAGE_LOG_ENABLED)
176 bool enabled = IPC::Logging::GetInstance()->Enabled(); 177 bool enabled = IPC::Logging::GetInstance()->Enabled();
177 Send(new ChildProcessMsg_SetIPCLoggingEnabled(enabled)); 178 Send(new ChildProcessMsg_SetIPCLoggingEnabled(enabled));
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 uint32 usage, 315 uint32 usage,
315 gfx::GpuMemoryBufferHandle* handle) { 316 gfx::GpuMemoryBufferHandle* handle) {
316 handle->type = gfx::SHARED_MEMORY_BUFFER; 317 handle->type = gfx::SHARED_MEMORY_BUFFER;
317 AllocateSharedMemory( 318 AllocateSharedMemory(
318 width * height * GpuMemoryBufferImpl::BytesPerPixel(internalformat), 319 width * height * GpuMemoryBufferImpl::BytesPerPixel(internalformat),
319 peer_handle_, 320 peer_handle_,
320 &handle->handle); 321 &handle->handle);
321 } 322 }
322 323
323 } // namespace content 324 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698