Chromium Code Reviews| Index: content/browser/gpu/gpu_process_host.cc |
| diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc |
| index 2d04cb9be80970aaf82e0577ceb30d04a5c628c5..b3cc7627c9515eb536b3a869111848fdee71ee0d 100644 |
| --- a/content/browser/gpu/gpu_process_host.cc |
| +++ b/content/browser/gpu/gpu_process_host.cc |
| @@ -141,6 +141,16 @@ void SendGpuProcessMessage(GpuProcessHost::GpuProcessKind kind, |
| } |
| } |
| +void SendGpuProcessUpdateValueStateMessage(int client_id, |
| + unsigned int target, |
| + const gpu::ValueState& state) { |
| + GpuProcessHost* host = GpuProcessHost::Get( |
| + GpuProcessHost::GPU_PROCESS_KIND_SANDBOXED, |
| + CAUSE_FOR_GPU_LAUNCH_NO_LAUNCH); |
| + if (host) |
| + host->SendUpdateValueState(client_id, target, state); |
| +} |
| + |
| // NOTE: changes to this class need to be reviewed by the security team. |
| class GpuSandboxedProcessLauncherDelegate |
| : public SandboxedProcessLauncherDelegate { |
| @@ -349,6 +359,16 @@ void GpuProcessHost::SendOnIO(GpuProcessKind kind, |
| } |
| } |
| +//static |
| +void GpuProcessHost::SendUpdateValueStateOnIO(int client_id, |
| + unsigned int target, |
| + const gpu::ValueState& state) { |
| + BrowserThread::PostTask( |
| + BrowserThread::IO, FROM_HERE, |
|
Tom Sepez
2014/12/04 22:08:10
nit: indentation.
orglofch
2014/12/04 23:37:10
Done.
|
| + base::Bind(&SendGpuProcessUpdateValueStateMessage, |
| + client_id, target, state)); |
| +} |
| + |
| GpuMainThreadFactoryFunction g_gpu_main_thread_factory = NULL; |
| void GpuProcessHost::RegisterGpuMainThreadFactory( |
| @@ -582,7 +602,8 @@ bool GpuProcessHost::OnMessageReceived(const IPC::Message& message) { |
| OnDestroyChannel) |
| IPC_MESSAGE_HANDLER(GpuHostMsg_CacheShader, |
| OnCacheShader) |
| - |
| + IPC_MESSAGE_HANDLER(GpuHostMsg_AddSubscription, OnAddSubscription) |
| + IPC_MESSAGE_HANDLER(GpuHostMsg_RemoveSubscription, OnRemoveSubscription) |
| IPC_MESSAGE_UNHANDLED(RouteOnUIThread(message)) |
| IPC_END_MESSAGE_MAP() |
| @@ -1039,6 +1060,15 @@ void GpuProcessHost::LoadedShader(const std::string& key, |
| Send(new GpuMsg_LoadedShader(data)); |
| } |
| +void GpuProcessHost::SendUpdateValueState(int client_id, |
| + unsigned int target, |
| + const gpu::ValueState& state) { |
| + // Only send data if a valuebuffer is subscribed to the target |
| + if (subscription_set_.find(target) != subscription_set_.end()) { |
| + Send(new GpuMsg_UpdateValueState(client_id, target, state)); |
| + } |
| +} |
| + |
| void GpuProcessHost::CreateChannelCache(int32 client_id) { |
| TRACE_EVENT0("gpu", "GpuProcessHost::CreateChannelCache"); |
| @@ -1069,4 +1099,12 @@ void GpuProcessHost::OnCacheShader(int32 client_id, |
| iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader); |
| } |
| +void GpuProcessHost::OnAddSubscription(unsigned int target) { |
| + subscription_set_.insert(target); |
| +} |
| + |
| +void GpuProcessHost::OnRemoveSubscription(unsigned int target) { |
| + subscription_set_.erase(target); |
| +} |
| + |
| } // namespace content |