Index: content/common/gpu/gpu_channel.cc |
diff --git a/content/common/gpu/gpu_channel.cc b/content/common/gpu/gpu_channel.cc |
index 7bf61344c8fb2029e179fd21b2a92e5a9219f7c6..b3e2fac0a6eedbbaa75ba8363adc874371dcb555 100644 |
--- a/content/common/gpu/gpu_channel.cc |
+++ b/content/common/gpu/gpu_channel.cc |
@@ -29,6 +29,7 @@ |
#include "gpu/command_buffer/service/image_factory.h" |
#include "gpu/command_buffer/service/mailbox_manager_impl.h" |
#include "gpu/command_buffer/service/sync_point_manager.h" |
+#include "gpu/command_buffer/service/valuebuffer_manager.h" |
#include "ipc/ipc_channel.h" |
#include "ipc/message_filter.h" |
#include "ui/gl/gl_context.h" |
@@ -425,10 +426,14 @@ GpuChannel::GpuChannel(GpuChannelManager* gpu_channel_manager, |
const base::CommandLine* command_line = |
base::CommandLine::ForCurrentProcess(); |
log_messages_ = command_line->HasSwitch(switches::kLogPluginMessages); |
+ |
+ subscription_ref_set_ = new gpu::gles2::SubscriptionRefSet(); |
+ subscription_ref_set_->AddObserver(this); |
} |
GpuChannel::~GpuChannel() { |
STLDeleteElements(&deferred_messages_); |
+ subscription_ref_set_->RemoveObserver(this); |
if (preempting_flag_.get()) |
preempting_flag_->Reset(); |
} |
@@ -512,6 +517,16 @@ bool GpuChannel::Send(IPC::Message* message) { |
return channel_->Send(message); |
} |
+void GpuChannel::OnAddSubscription(unsigned int target) { |
+ gpu_channel_manager()->Send( |
+ new GpuHostMsg_AddSubscription(client_id_, target)); |
+} |
+ |
+void GpuChannel::OnRemoveSubscription(unsigned int target) { |
+ gpu_channel_manager()->Send( |
+ new GpuHostMsg_RemoveSubscription(client_id_, target)); |
+} |
+ |
void GpuChannel::RequeueMessage() { |
DCHECK(currently_processing_message_); |
deferred_messages_.push_front( |
@@ -581,6 +596,7 @@ CreateCommandBufferResult GpuChannel::CreateViewCommandBuffer( |
share_group, |
window, |
mailbox_manager_.get(), |
+ subscription_ref_set_.get(), |
pending_valuebuffer_state_.get(), |
gfx::Size(), |
disallowed_features_, |
@@ -740,6 +756,7 @@ void GpuChannel::OnCreateOffscreenCommandBuffer( |
share_group, |
gfx::GLSurfaceHandle(), |
mailbox_manager_.get(), |
+ subscription_ref_set_.get(), |
pending_valuebuffer_state_.get(), |
size, |
disallowed_features_, |