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/browser/gpu/browser_gpu_channel_host_factory.h" | 5 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "content/browser/gpu/gpu_data_manager_impl.h" | 8 #include "content/browser/gpu/gpu_data_manager_impl.h" |
9 #include "content/browser/gpu/gpu_process_host.h" | 9 #include "content/browser/gpu/gpu_process_host.h" |
10 #include "content/browser/gpu/gpu_surface_tracker.h" | 10 #include "content/browser/gpu/gpu_surface_tracker.h" |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 host = GpuProcessHost::GetForClient(gpu_client_id_, cause_for_gpu_launch); | 139 host = GpuProcessHost::GetForClient(gpu_client_id_, cause_for_gpu_launch); |
140 if (!host) { | 140 if (!host) { |
141 request->event.Signal(); | 141 request->event.Signal(); |
142 return; | 142 return; |
143 } | 143 } |
144 gpu_host_id_ = host->host_id(); | 144 gpu_host_id_ = host->host_id(); |
145 } | 145 } |
146 | 146 |
147 host->EstablishGpuChannel( | 147 host->EstablishGpuChannel( |
148 gpu_client_id_, | 148 gpu_client_id_, |
149 0, | 149 true, |
150 base::Bind(&BrowserGpuChannelHostFactory::GpuChannelEstablishedOnIO, | 150 base::Bind(&BrowserGpuChannelHostFactory::GpuChannelEstablishedOnIO, |
151 request)); | 151 request)); |
152 } | 152 } |
153 | 153 |
154 // static | 154 // static |
155 void BrowserGpuChannelHostFactory::GpuChannelEstablishedOnIO( | 155 void BrowserGpuChannelHostFactory::GpuChannelEstablishedOnIO( |
156 EstablishRequest* request, | 156 EstablishRequest* request, |
157 const IPC::ChannelHandle& channel_handle, | 157 const IPC::ChannelHandle& channel_handle, |
158 base::ProcessHandle gpu_process_handle, | 158 base::ProcessHandle gpu_process_handle, |
159 const GPUInfo& gpu_info) { | 159 const GPUInfo& gpu_info) { |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 gpu_channel_->set_gpu_info(request.gpu_info); | 211 gpu_channel_->set_gpu_info(request.gpu_info); |
212 content::GetContentClient()->SetGpuInfo(request.gpu_info); | 212 content::GetContentClient()->SetGpuInfo(request.gpu_info); |
213 | 213 |
214 // Connect to the GPU process if a channel name was received. | 214 // Connect to the GPU process if a channel name was received. |
215 gpu_channel_->Connect(request.channel_handle, browser_process_for_gpu); | 215 gpu_channel_->Connect(request.channel_handle, browser_process_for_gpu); |
216 | 216 |
217 return gpu_channel_.get(); | 217 return gpu_channel_.get(); |
218 } | 218 } |
219 | 219 |
220 } // namespace content | 220 } // namespace content |
OLD | NEW |