| OLD | NEW |
| 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/renderer/render_thread_impl.h" | 5 #include "content/renderer/render_thread_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 790 | 790 |
| 791 // Ask the browser for the channel name. | 791 // Ask the browser for the channel name. |
| 792 IPC::ChannelHandle channel_handle; | 792 IPC::ChannelHandle channel_handle; |
| 793 base::ProcessHandle renderer_process_for_gpu; | 793 base::ProcessHandle renderer_process_for_gpu; |
| 794 content::GPUInfo gpu_info; | 794 content::GPUInfo gpu_info; |
| 795 if (!Send(new GpuHostMsg_EstablishGpuChannel(cause_for_gpu_launch, | 795 if (!Send(new GpuHostMsg_EstablishGpuChannel(cause_for_gpu_launch, |
| 796 &channel_handle, | 796 &channel_handle, |
| 797 &renderer_process_for_gpu, | 797 &renderer_process_for_gpu, |
| 798 &gpu_info)) || | 798 &gpu_info)) || |
| 799 channel_handle.name.empty() || | 799 channel_handle.name.empty() || |
| 800 #if defined(OS_POSIX) |
| 801 channel_handle.socket.fd == -1 || |
| 802 #endif |
| 800 renderer_process_for_gpu == base::kNullProcessHandle) { | 803 renderer_process_for_gpu == base::kNullProcessHandle) { |
| 801 // Otherwise cancel the connection. | 804 // Otherwise cancel the connection. |
| 802 gpu_channel_ = NULL; | 805 gpu_channel_ = NULL; |
| 803 return NULL; | 806 return NULL; |
| 804 } | 807 } |
| 805 | 808 |
| 806 #if defined(OS_POSIX) | |
| 807 // Check the validity of fd for bug investigation. Replace with normal error | |
| 808 // handling (see above) after bug fixed. See for details: crbug.com/95732. | |
| 809 CHECK_NE(-1, channel_handle.socket.fd); | |
| 810 #endif | |
| 811 | |
| 812 gpu_channel_->set_gpu_info(gpu_info); | 809 gpu_channel_->set_gpu_info(gpu_info); |
| 813 content::GetContentClient()->SetGpuInfo(gpu_info); | 810 content::GetContentClient()->SetGpuInfo(gpu_info); |
| 814 | 811 |
| 815 // Connect to the GPU process if a channel name was received. | 812 // Connect to the GPU process if a channel name was received. |
| 816 gpu_channel_->Connect(channel_handle, renderer_process_for_gpu); | 813 gpu_channel_->Connect(channel_handle, renderer_process_for_gpu); |
| 817 | 814 |
| 818 return GetGpuChannel(); | 815 return GetGpuChannel(); |
| 819 } | 816 } |
| 820 | 817 |
| 821 GpuChannelHost* RenderThreadImpl::GetGpuChannel() { | 818 GpuChannelHost* RenderThreadImpl::GetGpuChannel() { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 853 | 850 |
| 854 scoped_refptr<base::MessageLoopProxy> | 851 scoped_refptr<base::MessageLoopProxy> |
| 855 RenderThreadImpl::GetFileThreadMessageLoopProxy() { | 852 RenderThreadImpl::GetFileThreadMessageLoopProxy() { |
| 856 DCHECK(message_loop() == MessageLoop::current()); | 853 DCHECK(message_loop() == MessageLoop::current()); |
| 857 if (!file_thread_.get()) { | 854 if (!file_thread_.get()) { |
| 858 file_thread_.reset(new base::Thread("Renderer::FILE")); | 855 file_thread_.reset(new base::Thread("Renderer::FILE")); |
| 859 file_thread_->Start(); | 856 file_thread_->Start(); |
| 860 } | 857 } |
| 861 return file_thread_->message_loop_proxy(); | 858 return file_thread_->message_loop_proxy(); |
| 862 } | 859 } |
| OLD | NEW |