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 "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/profiler/scoped_tracker.h" | 10 #include "base/profiler/scoped_tracker.h" |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 event_.Wait(); | 167 event_.Wait(); |
168 } | 168 } |
169 FinishOnMain(); | 169 FinishOnMain(); |
170 } | 170 } |
171 | 171 |
172 void BrowserGpuChannelHostFactory::EstablishRequest::Cancel() { | 172 void BrowserGpuChannelHostFactory::EstablishRequest::Cancel() { |
173 DCHECK(main_task_runner_->BelongsToCurrentThread()); | 173 DCHECK(main_task_runner_->BelongsToCurrentThread()); |
174 finished_ = true; | 174 finished_ = true; |
175 } | 175 } |
176 | 176 |
177 void BrowserGpuChannelHostFactory::CloseChannel() { | |
178 DCHECK(instance_); | |
179 if (instance_->gpu_channel_) { | |
180 instance_->gpu_channel_->DestroyChannel(); | |
181 instance_->gpu_channel_ = nullptr; | |
182 } | |
183 } | |
184 | |
185 void BrowserGpuChannelHostFactory::Initialize(bool establish_gpu_channel) { | 177 void BrowserGpuChannelHostFactory::Initialize(bool establish_gpu_channel) { |
186 DCHECK(!instance_); | 178 DCHECK(!instance_); |
187 instance_ = new BrowserGpuChannelHostFactory(); | 179 instance_ = new BrowserGpuChannelHostFactory(); |
188 if (establish_gpu_channel) { | 180 if (establish_gpu_channel) { |
189 instance_->EstablishGpuChannel(gpu::GpuChannelEstablishedCallback()); | 181 instance_->EstablishGpuChannel(gpu::GpuChannelEstablishedCallback()); |
190 } | 182 } |
191 } | 183 } |
192 | 184 |
193 void BrowserGpuChannelHostFactory::Terminate() { | 185 void BrowserGpuChannelHostFactory::Terminate() { |
194 DCHECK(instance_); | 186 DCHECK(instance_); |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 } | 327 } |
336 | 328 |
337 // static | 329 // static |
338 void BrowserGpuChannelHostFactory::InitializeShaderDiskCacheOnIO( | 330 void BrowserGpuChannelHostFactory::InitializeShaderDiskCacheOnIO( |
339 int gpu_client_id, | 331 int gpu_client_id, |
340 const base::FilePath& cache_dir) { | 332 const base::FilePath& cache_dir) { |
341 GetShaderCacheFactorySingleton()->SetCacheInfo(gpu_client_id, cache_dir); | 333 GetShaderCacheFactorySingleton()->SetCacheInfo(gpu_client_id, cache_dir); |
342 } | 334 } |
343 | 335 |
344 } // namespace content | 336 } // namespace content |
OLD | NEW |