OLD | NEW |
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 Loading... |
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 // TODO(xhwang): Added to investigate crbug.com/95732. Clean up after fixed. |
| 422 CHECK(false); |
421 return true; | 423 return true; |
| 424 } |
422 | 425 |
423 // Map renderer ID to a (single) channel to that process. | 426 // Map renderer ID to a (single) channel to that process. |
424 std::string channel_name = GetChannelName(); | 427 std::string channel_name = GetChannelName(); |
425 channel_.reset(new IPC::SyncChannel( | 428 channel_.reset(new IPC::SyncChannel( |
426 channel_name, | 429 channel_name, |
427 IPC::Channel::MODE_SERVER, | 430 IPC::Channel::MODE_SERVER, |
428 this, | 431 this, |
429 io_message_loop, | 432 io_message_loop, |
430 false, | 433 false, |
431 shutdown_event)); | 434 shutdown_event)); |
(...skipping 18 matching lines...) Expand all Loading... |
450 | 453 |
451 #if defined(OS_POSIX) | 454 #if defined(OS_POSIX) |
452 int GpuChannel::TakeRendererFileDescriptor() { | 455 int GpuChannel::TakeRendererFileDescriptor() { |
453 if (!channel_.get()) { | 456 if (!channel_.get()) { |
454 NOTREACHED(); | 457 NOTREACHED(); |
455 return -1; | 458 return -1; |
456 } | 459 } |
457 return channel_->TakeClientFileDescriptor(); | 460 return channel_->TakeClientFileDescriptor(); |
458 } | 461 } |
459 #endif // defined(OS_POSIX) | 462 #endif // defined(OS_POSIX) |
OLD | NEW |