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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 // TODO(piman): Make this asynchronous. | 129 // TODO(piman): Make this asynchronous. |
130 request.event.Wait(); | 130 request.event.Wait(); |
131 return request.route_id; | 131 return request.route_id; |
132 } | 132 } |
133 | 133 |
134 void BrowserGpuChannelHostFactory::EstablishGpuChannelOnIO( | 134 void BrowserGpuChannelHostFactory::EstablishGpuChannelOnIO( |
135 EstablishRequest* request, | 135 EstablishRequest* request, |
136 CauseForGpuLaunch cause_for_gpu_launch) { | 136 CauseForGpuLaunch cause_for_gpu_launch) { |
137 GpuProcessHost* host = GpuProcessHost::FromID(gpu_host_id_); | 137 GpuProcessHost* host = GpuProcessHost::FromID(gpu_host_id_); |
138 if (!host) { | 138 if (!host) { |
139 host = GpuProcessHost::GetForClient(gpu_client_id_, cause_for_gpu_launch); | 139 host = GpuProcessHost::Get(GpuProcessHost::kSandboxed, |
| 140 cause_for_gpu_launch); |
140 if (!host) { | 141 if (!host) { |
141 request->event.Signal(); | 142 request->event.Signal(); |
142 return; | 143 return; |
143 } | 144 } |
144 gpu_host_id_ = host->host_id(); | 145 gpu_host_id_ = host->host_id(); |
145 } | 146 } |
146 | 147 |
147 host->EstablishGpuChannel( | 148 host->EstablishGpuChannel( |
148 gpu_client_id_, | 149 gpu_client_id_, |
149 0, | 150 0, |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 gpu_channel_->set_gpu_info(request.gpu_info); | 212 gpu_channel_->set_gpu_info(request.gpu_info); |
212 content::GetContentClient()->SetGpuInfo(request.gpu_info); | 213 content::GetContentClient()->SetGpuInfo(request.gpu_info); |
213 | 214 |
214 // Connect to the GPU process if a channel name was received. | 215 // Connect to the GPU process if a channel name was received. |
215 gpu_channel_->Connect(request.channel_handle, browser_process_for_gpu); | 216 gpu_channel_->Connect(request.channel_handle, browser_process_for_gpu); |
216 | 217 |
217 return gpu_channel_.get(); | 218 return gpu_channel_.get(); |
218 } | 219 } |
219 | 220 |
220 } // namespace content | 221 } // namespace content |
OLD | NEW |