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

Unified Diff: content/browser/gpu/browser_gpu_channel_host_factory.cc

Issue 1274763003: Initialize GPU shader disk cache on brower thread. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chrome_content_browser_client.cc ('k') | content/public/browser/content_browser_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/gpu/browser_gpu_channel_host_factory.cc
diff --git a/content/browser/gpu/browser_gpu_channel_host_factory.cc b/content/browser/gpu/browser_gpu_channel_host_factory.cc
index 750a8e4365f79e6f16e45ff7ef62a206710cce3d..87f646c3031a01c3b24f5528aa867325a509bfab 100644
--- a/content/browser/gpu/browser_gpu_channel_host_factory.cc
+++ b/content/browser/gpu/browser_gpu_channel_host_factory.cc
@@ -5,6 +5,7 @@
#include "content/browser/gpu/browser_gpu_channel_host_factory.h"
#include "base/bind.h"
+#include "base/command_line.h"
#include "base/location.h"
#include "base/profiler/scoped_tracker.h"
#include "base/single_thread_task_runner.h"
@@ -17,11 +18,14 @@
#include "content/browser/gpu/gpu_data_manager_impl.h"
#include "content/browser/gpu/gpu_process_host.h"
#include "content/browser/gpu/gpu_surface_tracker.h"
+#include "content/browser/gpu/shader_disk_cache.h"
#include "content/common/child_process_host_impl.h"
#include "content/common/gpu/gpu_messages.h"
#include "content/public/browser/browser_thread.h"
+#include "content/public/browser/content_browser_client.h"
#include "content/public/browser/gpu_data_manager.h"
#include "content/public/common/content_client.h"
+#include "gpu/command_buffer/service/gpu_switches.h"
#include "ipc/ipc_channel_handle.h"
#include "ipc/message_filter.h"
@@ -144,6 +148,18 @@ void BrowserGpuChannelHostFactory::EstablishRequest::EstablishOnIO() {
reused_gpu_process_ = true;
}
+ if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kDisableGpuShaderDiskCache)) {
+ base::FilePath user_data_dir =
+ GetContentClient()->browser()->GetUserDataDirectory();
+ if (!user_data_dir.empty()) {
+ ShaderCacheFactory::GetInstance()->SetCacheInfo(gpu_client_id_,
+ user_data_dir);
Ken Russell (switch to Gerrit) 2015/08/06 01:01:01 Something seems suspicious about this. GpuChannels
piman 2015/08/06 19:53:13 FYI, this code path is to setup the GpuChannelHost
+ } else {
+ LOG(ERROR) << "Failed to init browser shader cache.";
+ }
+ }
+
host->EstablishGpuChannel(
gpu_client_id_,
gpu_client_tracing_id_,
« no previous file with comments | « chrome/browser/chrome_content_browser_client.cc ('k') | content/public/browser/content_browser_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698