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 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 FROM_HERE_WITH_EXPLICIT_FUNCTION( | 358 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
359 "466866 BrowserGpuChannelHostFactory::GpuChannelEstablished2")); | 359 "466866 BrowserGpuChannelHostFactory::GpuChannelEstablished2")); |
360 | 360 |
361 std::vector<gpu::GpuChannelEstablishedCallback> established_callbacks; | 361 std::vector<gpu::GpuChannelEstablishedCallback> established_callbacks; |
362 established_callbacks_.swap(established_callbacks); | 362 established_callbacks_.swap(established_callbacks); |
363 for (auto& callback : established_callbacks) | 363 for (auto& callback : established_callbacks) |
364 callback.Run(gpu_channel_); | 364 callback.Run(gpu_channel_); |
365 } | 365 } |
366 | 366 |
367 // static | 367 // static |
368 void BrowserGpuChannelHostFactory::AddFilterOnIO( | |
369 int host_id, | |
370 scoped_refptr<IPC::MessageFilter> filter) { | |
371 DCHECK_CURRENTLY_ON(BrowserThread::IO); | |
372 | |
373 GpuProcessHost* host = GpuProcessHost::FromID(host_id); | |
374 if (host) | |
375 host->AddFilter(filter.get()); | |
376 } | |
377 | |
378 // static | |
379 void BrowserGpuChannelHostFactory::InitializeShaderDiskCacheOnIO( | 368 void BrowserGpuChannelHostFactory::InitializeShaderDiskCacheOnIO( |
380 int gpu_client_id, | 369 int gpu_client_id, |
381 const base::FilePath& cache_dir) { | 370 const base::FilePath& cache_dir) { |
382 GetShaderCacheFactorySingleton()->SetCacheInfo(gpu_client_id, cache_dir); | 371 GetShaderCacheFactorySingleton()->SetCacheInfo(gpu_client_id, cache_dir); |
383 } | 372 } |
384 | 373 |
385 } // namespace content | 374 } // namespace content |
OLD | NEW |