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

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

Issue 307653003: Introduce IPC::Channel::Create*() to ensure it being heap-allocated. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixing windows build, landing again. 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_.reset(new IPC::Channel( 167 channel_ = IPC::Channel::CreateServer(channel_id_, this);
168 channel_id_, IPC::Channel::MODE_SERVER, this));
169 if (!channel_->Connect()) 168 if (!channel_->Connect())
170 return std::string(); 169 return std::string();
171 170
172 for (size_t i = 0; i < filters_.size(); ++i) 171 for (size_t i = 0; i < filters_.size(); ++i)
173 filters_[i]->OnFilterAdded(channel_.get()); 172 filters_[i]->OnFilterAdded(channel_.get());
174 173
175 // Make sure these messages get sent first. 174 // Make sure these messages get sent first.
176 #if defined(IPC_MESSAGE_LOG_ENABLED) 175 #if defined(IPC_MESSAGE_LOG_ENABLED)
177 bool enabled = IPC::Logging::GetInstance()->Enabled(); 176 bool enabled = IPC::Logging::GetInstance()->Enabled();
178 Send(new ChildProcessMsg_SetIPCLoggingEnabled(enabled)); 177 Send(new ChildProcessMsg_SetIPCLoggingEnabled(enabled));
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 uint32 usage, 314 uint32 usage,
316 gfx::GpuMemoryBufferHandle* handle) { 315 gfx::GpuMemoryBufferHandle* handle) {
317 handle->type = gfx::SHARED_MEMORY_BUFFER; 316 handle->type = gfx::SHARED_MEMORY_BUFFER;
318 AllocateSharedMemory( 317 AllocateSharedMemory(
319 width * height * GpuMemoryBufferImpl::BytesPerPixel(internalformat), 318 width * height * GpuMemoryBufferImpl::BytesPerPixel(internalformat),
320 peer_handle_, 319 peer_handle_,
321 &handle->handle); 320 &handle->handle);
322 } 321 }
323 322
324 } // namespace content 323 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/plugin_service_impl_browsertest.cc ('k') | content/renderer/render_thread_impl_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698