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

Side by Side Diff: content/common/gpu/gpu_channel.cc

Issue 9834065: Revert 128016 - Make sandbox explicitly block opening broker and sandboxed processes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | sandbox/src/broker_services.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 #if defined(OS_WIN) 5 #if defined(OS_WIN)
6 #include <windows.h> 6 #include <windows.h>
7 #endif 7 #endif
8 8
9 #include "content/common/gpu/gpu_channel.h" 9 #include "content/common/gpu/gpu_channel.h"
10 10
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 router_.RemoveRoute(route_id); 308 router_.RemoveRoute(route_id);
309 } 309 }
310 310
311 bool GpuChannel::ShouldPreferDiscreteGpu() const { 311 bool GpuChannel::ShouldPreferDiscreteGpu() const {
312 return num_contexts_preferring_discrete_gpu_ > 0; 312 return num_contexts_preferring_discrete_gpu_ > 0;
313 } 313 }
314 314
315 void GpuChannel::OnInitialize(base::ProcessHandle renderer_process) { 315 void GpuChannel::OnInitialize(base::ProcessHandle renderer_process) {
316 // Initialize should only happen once. 316 // Initialize should only happen once.
317 DCHECK(!renderer_process_); 317 DCHECK(!renderer_process_);
318 renderer_process_ = renderer_process; 318
319 // Verify that the renderer has passed its own process handle.
320 if (base::GetProcId(renderer_process) == renderer_pid_)
321 renderer_process_ = renderer_process;
319 } 322 }
320 323
321 void GpuChannel::OnCreateOffscreenCommandBuffer( 324 void GpuChannel::OnCreateOffscreenCommandBuffer(
322 const gfx::Size& size, 325 const gfx::Size& size,
323 const GPUCreateCommandBufferConfig& init_params, 326 const GPUCreateCommandBufferConfig& init_params,
324 IPC::Message* reply_message) { 327 IPC::Message* reply_message) {
325 int32 route_id = MSG_ROUTING_NONE; 328 int32 route_id = MSG_ROUTING_NONE;
326 329
327 content::GetContentClient()->SetActiveURL(init_params.active_url); 330 content::GetContentClient()->SetActiveURL(init_params.active_url);
328 #if defined(ENABLE_GPU) 331 #if defined(ENABLE_GPU)
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 444
442 #if defined(OS_POSIX) 445 #if defined(OS_POSIX)
443 int GpuChannel::TakeRendererFileDescriptor() { 446 int GpuChannel::TakeRendererFileDescriptor() {
444 if (!channel_.get()) { 447 if (!channel_.get()) {
445 NOTREACHED(); 448 NOTREACHED();
446 return -1; 449 return -1;
447 } 450 }
448 return channel_->TakeClientFileDescriptor(); 451 return channel_->TakeClientFileDescriptor();
449 } 452 }
450 #endif // defined(OS_POSIX) 453 #endif // defined(OS_POSIX)
OLDNEW
« no previous file with comments | « no previous file | sandbox/src/broker_services.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698