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_, |