| 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 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 | 261 |
| 262 bool BrowserGpuChannelHostFactory::IsMainThread() { | 262 bool BrowserGpuChannelHostFactory::IsMainThread() { |
| 263 return BrowserThread::CurrentlyOn(BrowserThread::UI); | 263 return BrowserThread::CurrentlyOn(BrowserThread::UI); |
| 264 } | 264 } |
| 265 | 265 |
| 266 scoped_refptr<base::SingleThreadTaskRunner> | 266 scoped_refptr<base::SingleThreadTaskRunner> |
| 267 BrowserGpuChannelHostFactory::GetIOThreadTaskRunner() { | 267 BrowserGpuChannelHostFactory::GetIOThreadTaskRunner() { |
| 268 return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); | 268 return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); |
| 269 } | 269 } |
| 270 | 270 |
| 271 scoped_ptr<base::SharedMemory> | 271 std::unique_ptr<base::SharedMemory> |
| 272 BrowserGpuChannelHostFactory::AllocateSharedMemory(size_t size) { | 272 BrowserGpuChannelHostFactory::AllocateSharedMemory(size_t size) { |
| 273 scoped_ptr<base::SharedMemory> shm(new base::SharedMemory()); | 273 std::unique_ptr<base::SharedMemory> shm(new base::SharedMemory()); |
| 274 if (!shm->CreateAnonymous(size)) | 274 if (!shm->CreateAnonymous(size)) |
| 275 return scoped_ptr<base::SharedMemory>(); | 275 return std::unique_ptr<base::SharedMemory>(); |
| 276 return shm; | 276 return shm; |
| 277 } | 277 } |
| 278 | 278 |
| 279 // Blocking the UI thread to open a GPU channel is not supported on Android. | 279 // Blocking the UI thread to open a GPU channel is not supported on Android. |
| 280 // (Opening the initial channel to a child process involves handling a reply | 280 // (Opening the initial channel to a child process involves handling a reply |
| 281 // task on the UI thread first, so we cannot block here.) | 281 // task on the UI thread first, so we cannot block here.) |
| 282 #if !defined(OS_ANDROID) | 282 #if !defined(OS_ANDROID) |
| 283 gpu::GpuChannelHost* BrowserGpuChannelHostFactory::EstablishGpuChannelSync( | 283 gpu::GpuChannelHost* BrowserGpuChannelHostFactory::EstablishGpuChannelSync( |
| 284 CauseForGpuLaunch cause_for_gpu_launch) { | 284 CauseForGpuLaunch cause_for_gpu_launch) { |
| 285 EstablishGpuChannel(cause_for_gpu_launch, base::Closure()); | 285 EstablishGpuChannel(cause_for_gpu_launch, base::Closure()); |
| (...skipping 82 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 |