| 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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 event_.Wait(); | 191 event_.Wait(); |
| 192 } | 192 } |
| 193 FinishOnMain(); | 193 FinishOnMain(); |
| 194 } | 194 } |
| 195 | 195 |
| 196 void BrowserGpuChannelHostFactory::EstablishRequest::Cancel() { | 196 void BrowserGpuChannelHostFactory::EstablishRequest::Cancel() { |
| 197 DCHECK(main_task_runner_->BelongsToCurrentThread()); | 197 DCHECK(main_task_runner_->BelongsToCurrentThread()); |
| 198 finished_ = true; | 198 finished_ = true; |
| 199 } | 199 } |
| 200 | 200 |
| 201 void BrowserGpuChannelHostFactory::CloseChannel() { |
| 202 DCHECK(instance_); |
| 203 if (instance_->gpu_channel_) { |
| 204 instance_->gpu_channel_->DestroyChannel(); |
| 205 instance_->gpu_channel_ = nullptr; |
| 206 } |
| 207 } |
| 208 |
| 201 bool BrowserGpuChannelHostFactory::CanUseForTesting() { | 209 bool BrowserGpuChannelHostFactory::CanUseForTesting() { |
| 202 return GpuDataManager::GetInstance()->GpuAccessAllowed(NULL); | 210 return GpuDataManager::GetInstance()->GpuAccessAllowed(NULL); |
| 203 } | 211 } |
| 204 | 212 |
| 205 void BrowserGpuChannelHostFactory::Initialize(bool establish_gpu_channel) { | 213 void BrowserGpuChannelHostFactory::Initialize(bool establish_gpu_channel) { |
| 206 DCHECK(!instance_); | 214 DCHECK(!instance_); |
| 207 instance_ = new BrowserGpuChannelHostFactory(); | 215 instance_ = new BrowserGpuChannelHostFactory(); |
| 208 if (establish_gpu_channel) { | 216 if (establish_gpu_channel) { |
| 209 instance_->EstablishGpuChannel(gpu::GpuChannelEstablishedCallback()); | 217 instance_->EstablishGpuChannel(gpu::GpuChannelEstablishedCallback()); |
| 210 } | 218 } |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 } | 376 } |
| 369 | 377 |
| 370 // static | 378 // static |
| 371 void BrowserGpuChannelHostFactory::InitializeShaderDiskCacheOnIO( | 379 void BrowserGpuChannelHostFactory::InitializeShaderDiskCacheOnIO( |
| 372 int gpu_client_id, | 380 int gpu_client_id, |
| 373 const base::FilePath& cache_dir) { | 381 const base::FilePath& cache_dir) { |
| 374 GetShaderCacheFactorySingleton()->SetCacheInfo(gpu_client_id, cache_dir); | 382 GetShaderCacheFactorySingleton()->SetCacheInfo(gpu_client_id, cache_dir); |
| 375 } | 383 } |
| 376 | 384 |
| 377 } // namespace content | 385 } // namespace content |
| OLD | NEW |