Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(137)

Side by Side Diff: content/browser/gpu/browser_gpu_channel_host_factory.cc

Issue 2133083002: Remove all remaining traces of MessageLoopProxy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 74
75 scoped_refptr<BrowserGpuChannelHostFactory::EstablishRequest> 75 scoped_refptr<BrowserGpuChannelHostFactory::EstablishRequest>
76 BrowserGpuChannelHostFactory::EstablishRequest::Create( 76 BrowserGpuChannelHostFactory::EstablishRequest::Create(
77 CauseForGpuLaunch cause, 77 CauseForGpuLaunch cause,
78 int gpu_client_id, 78 int gpu_client_id,
79 uint64_t gpu_client_tracing_id, 79 uint64_t gpu_client_tracing_id,
80 int gpu_host_id) { 80 int gpu_host_id) {
81 scoped_refptr<EstablishRequest> establish_request = new EstablishRequest( 81 scoped_refptr<EstablishRequest> establish_request = new EstablishRequest(
82 cause, gpu_client_id, gpu_client_tracing_id, gpu_host_id); 82 cause, gpu_client_id, gpu_client_tracing_id, gpu_host_id);
83 scoped_refptr<base::SingleThreadTaskRunner> task_runner = 83 scoped_refptr<base::SingleThreadTaskRunner> task_runner =
84 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); 84 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO);
85 // PostTask outside the constructor to ensure at least one reference exists. 85 // PostTask outside the constructor to ensure at least one reference exists.
86 task_runner->PostTask( 86 task_runner->PostTask(
87 FROM_HERE, 87 FROM_HERE,
88 base::Bind(&BrowserGpuChannelHostFactory::EstablishRequest::EstablishOnIO, 88 base::Bind(&BrowserGpuChannelHostFactory::EstablishRequest::EstablishOnIO,
89 establish_request)); 89 establish_request));
90 return establish_request; 90 return establish_request;
91 } 91 }
92 92
93 BrowserGpuChannelHostFactory::EstablishRequest::EstablishRequest( 93 BrowserGpuChannelHostFactory::EstablishRequest::EstablishRequest(
94 CauseForGpuLaunch cause, 94 CauseForGpuLaunch cause,
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 gpu_channel_ = NULL; 260 gpu_channel_ = NULL;
261 } 261 }
262 } 262 }
263 263
264 bool BrowserGpuChannelHostFactory::IsMainThread() { 264 bool BrowserGpuChannelHostFactory::IsMainThread() {
265 return BrowserThread::CurrentlyOn(BrowserThread::UI); 265 return BrowserThread::CurrentlyOn(BrowserThread::UI);
266 } 266 }
267 267
268 scoped_refptr<base::SingleThreadTaskRunner> 268 scoped_refptr<base::SingleThreadTaskRunner>
269 BrowserGpuChannelHostFactory::GetIOThreadTaskRunner() { 269 BrowserGpuChannelHostFactory::GetIOThreadTaskRunner() {
270 return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); 270 return BrowserThread::GetTaskRunnerForThread(BrowserThread::IO);
271 } 271 }
272 272
273 std::unique_ptr<base::SharedMemory> 273 std::unique_ptr<base::SharedMemory>
274 BrowserGpuChannelHostFactory::AllocateSharedMemory(size_t size) { 274 BrowserGpuChannelHostFactory::AllocateSharedMemory(size_t size) {
275 std::unique_ptr<base::SharedMemory> shm(new base::SharedMemory()); 275 std::unique_ptr<base::SharedMemory> shm(new base::SharedMemory());
276 if (!shm->CreateAnonymous(size)) 276 if (!shm->CreateAnonymous(size))
277 return std::unique_ptr<base::SharedMemory>(); 277 return std::unique_ptr<base::SharedMemory>();
278 return shm; 278 return shm;
279 } 279 }
280 280
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 } 371 }
372 372
373 // static 373 // static
374 void BrowserGpuChannelHostFactory::InitializeShaderDiskCacheOnIO( 374 void BrowserGpuChannelHostFactory::InitializeShaderDiskCacheOnIO(
375 int gpu_client_id, 375 int gpu_client_id,
376 const base::FilePath& cache_dir) { 376 const base::FilePath& cache_dir) {
377 ShaderCacheFactory::GetInstance()->SetCacheInfo(gpu_client_id, cache_dir); 377 ShaderCacheFactory::GetInstance()->SetCacheInfo(gpu_client_id, cache_dir);
378 } 378 }
379 379
380 } // namespace content 380 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698