| 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 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 std::unique_ptr<base::SharedMemory> | 266 std::unique_ptr<base::SharedMemory> |
| 267 BrowserGpuChannelHostFactory::AllocateSharedMemory(size_t size) { | 267 BrowserGpuChannelHostFactory::AllocateSharedMemory(size_t size) { |
| 268 std::unique_ptr<base::SharedMemory> shm(new base::SharedMemory()); | 268 std::unique_ptr<base::SharedMemory> shm(new base::SharedMemory()); |
| 269 if (!shm->CreateAnonymous(size)) | 269 if (!shm->CreateAnonymous(size)) |
| 270 return std::unique_ptr<base::SharedMemory>(); | 270 return std::unique_ptr<base::SharedMemory>(); |
| 271 return shm; | 271 return shm; |
| 272 } | 272 } |
| 273 | 273 |
| 274 void BrowserGpuChannelHostFactory::EstablishGpuChannel( | 274 void BrowserGpuChannelHostFactory::EstablishGpuChannel( |
| 275 const gpu::GpuChannelEstablishedCallback& callback) { | 275 const gpu::GpuChannelEstablishedCallback& callback) { |
| 276 DCHECK(!shell::ShellIsRemote()); | 276 DCHECK(!service_manager::ServiceManagerIsRemote()); |
| 277 if (gpu_channel_.get() && gpu_channel_->IsLost()) { | 277 if (gpu_channel_.get() && gpu_channel_->IsLost()) { |
| 278 DCHECK(!pending_request_.get()); | 278 DCHECK(!pending_request_.get()); |
| 279 // Recreate the channel if it has been lost. | 279 // Recreate the channel if it has been lost. |
| 280 gpu_channel_->DestroyChannel(); | 280 gpu_channel_->DestroyChannel(); |
| 281 gpu_channel_ = NULL; | 281 gpu_channel_ = NULL; |
| 282 } | 282 } |
| 283 | 283 |
| 284 if (!gpu_channel_.get() && !pending_request_.get()) { | 284 if (!gpu_channel_.get() && !pending_request_.get()) { |
| 285 // We should only get here if the context was lost. | 285 // We should only get here if the context was lost. |
| 286 pending_request_ = EstablishRequest::Create( | 286 pending_request_ = EstablishRequest::Create( |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 } | 368 } |
| 369 | 369 |
| 370 // static | 370 // static |
| 371 void BrowserGpuChannelHostFactory::InitializeShaderDiskCacheOnIO( | 371 void BrowserGpuChannelHostFactory::InitializeShaderDiskCacheOnIO( |
| 372 int gpu_client_id, | 372 int gpu_client_id, |
| 373 const base::FilePath& cache_dir) { | 373 const base::FilePath& cache_dir) { |
| 374 ShaderCacheFactory::GetInstance()->SetCacheInfo(gpu_client_id, cache_dir); | 374 ShaderCacheFactory::GetInstance()->SetCacheInfo(gpu_client_id, cache_dir); |
| 375 } | 375 } |
| 376 | 376 |
| 377 } // namespace content | 377 } // namespace content |
| OLD | NEW |