OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/renderer/render_thread.h" | 5 #include "chrome/renderer/render_thread.h" |
6 | 6 |
7 #include <v8.h> | 7 #include <v8.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <limits> | 10 #include <limits> |
(...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
696 gpu_channel_ = NULL; | 696 gpu_channel_ = NULL; |
697 } | 697 } |
698 | 698 |
699 if (!gpu_channel_.get()) | 699 if (!gpu_channel_.get()) |
700 gpu_channel_ = new GpuChannelHost; | 700 gpu_channel_ = new GpuChannelHost; |
701 | 701 |
702 // Ask the browser for the channel name. | 702 // Ask the browser for the channel name. |
703 Send(new ViewHostMsg_EstablishGpuChannel()); | 703 Send(new ViewHostMsg_EstablishGpuChannel()); |
704 } | 704 } |
705 | 705 |
| 706 GpuChannelHost* RenderThread::EstablishGpuChannelSync() { |
| 707 EstablishGpuChannel(); |
| 708 Send(new ViewHostMsg_SynchronizeGpu()); |
| 709 // TODO(kbr): the GPU channel is still in the unconnected state at this point. |
| 710 // Need to figure out whether it is really safe to return it. |
| 711 return gpu_channel_.get(); |
| 712 } |
| 713 |
706 GpuChannelHost* RenderThread::GetGpuChannel() { | 714 GpuChannelHost* RenderThread::GetGpuChannel() { |
707 if (!gpu_channel_.get()) | 715 if (!gpu_channel_.get()) |
708 return NULL; | 716 return NULL; |
709 | 717 |
710 if (gpu_channel_->state() != GpuChannelHost::CONNECTED) | 718 if (gpu_channel_->state() != GpuChannelHost::CONNECTED) |
711 return NULL; | 719 return NULL; |
712 | 720 |
713 return gpu_channel_.get(); | 721 return gpu_channel_.get(); |
714 } | 722 } |
715 | 723 |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
983 #endif | 991 #endif |
984 | 992 |
985 if (channel_handle.name.size() != 0) { | 993 if (channel_handle.name.size() != 0) { |
986 // Connect to the GPU process if a channel name was received. | 994 // Connect to the GPU process if a channel name was received. |
987 gpu_channel_->Connect(channel_handle.name); | 995 gpu_channel_->Connect(channel_handle.name); |
988 } else { | 996 } else { |
989 // Otherwise cancel the connection. | 997 // Otherwise cancel the connection. |
990 gpu_channel_ = NULL; | 998 gpu_channel_ = NULL; |
991 } | 999 } |
992 } | 1000 } |
OLD | NEW |