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

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

Issue 8877001: Add more CHECK in GPU and NPAPI process on invalid file descriptors (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Also add check in NPChannelBase::Init in ServerMode. Created 9 years 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 } 410 }
411 411
412 void GpuChannel::OnCloseChannel() { 412 void GpuChannel::OnCloseChannel() {
413 gpu_channel_manager_->RemoveChannel(renderer_id_); 413 gpu_channel_manager_->RemoveChannel(renderer_id_);
414 // At this point "this" is deleted! 414 // At this point "this" is deleted!
415 } 415 }
416 416
417 bool GpuChannel::Init(base::MessageLoopProxy* io_message_loop, 417 bool GpuChannel::Init(base::MessageLoopProxy* io_message_loop,
418 base::WaitableEvent* shutdown_event) { 418 base::WaitableEvent* shutdown_event) {
419 // Check whether we're already initialized. 419 // Check whether we're already initialized.
420 if (channel_.get()) 420 if (channel_.get()) {
421 NOTREACHED();
piman 2011/12/08 07:09:11 I think you meant something like LOG(FATAL) or CHE
xhwang 2011/12/08 19:37:49 Done.
421 return true; 422 return true;
423 }
422 424
423 // Map renderer ID to a (single) channel to that process. 425 // Map renderer ID to a (single) channel to that process.
424 std::string channel_name = GetChannelName(); 426 std::string channel_name = GetChannelName();
425 channel_.reset(new IPC::SyncChannel( 427 channel_.reset(new IPC::SyncChannel(
426 channel_name, 428 channel_name,
427 IPC::Channel::MODE_SERVER, 429 IPC::Channel::MODE_SERVER,
428 this, 430 this,
429 io_message_loop, 431 io_message_loop,
430 false, 432 false,
431 shutdown_event)); 433 shutdown_event));
(...skipping 18 matching lines...) Expand all
450 452
451 #if defined(OS_POSIX) 453 #if defined(OS_POSIX)
452 int GpuChannel::TakeRendererFileDescriptor() { 454 int GpuChannel::TakeRendererFileDescriptor() {
453 if (!channel_.get()) { 455 if (!channel_.get()) {
454 NOTREACHED(); 456 NOTREACHED();
455 return -1; 457 return -1;
456 } 458 }
457 return channel_->TakeClientFileDescriptor(); 459 return channel_->TakeClientFileDescriptor();
458 } 460 }
459 #endif // defined(OS_POSIX) 461 #endif // defined(OS_POSIX)
OLDNEW
« no previous file with comments | « no previous file | content/common/gpu/gpu_channel_manager.cc » ('j') | content/common/gpu/gpu_channel_manager.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698