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

Unified Diff: content/common/gpu/gpu_command_buffer_stub.cc

Issue 7260008: Implement proper synchronization between HW video decode IPC and CommandBuffer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixing compilation errors from bots. Created 9 years, 6 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
Index: content/common/gpu/gpu_command_buffer_stub.cc
diff --git a/content/common/gpu/gpu_command_buffer_stub.cc b/content/common/gpu/gpu_command_buffer_stub.cc
index a6b378e362b2380ab51913ba7a360f4a2f076ce9..bb049dd5e22407de839638cf32629a5d26ed4498 100644
--- a/content/common/gpu/gpu_command_buffer_stub.cc
+++ b/content/common/gpu/gpu_command_buffer_stub.cc
@@ -152,6 +152,8 @@ void GpuCommandBufferStub::OnInitialize(
&GpuChannel::OnLatchCallback, base::Unretained(channel_), route_id_));
scheduler_->SetScheduledCallback(
NewCallback(this, &GpuCommandBufferStub::OnScheduled));
+ scheduler_->SetTokenCallback(base::Bind(
+ &GpuCommandBufferStub::OnSetToken, base::Unretained(this)));
if (watchdog_)
scheduler_->SetCommandProcessedCallback(
NewCallback(this, &GpuCommandBufferStub::OnCommandProcessed));
@@ -488,6 +490,16 @@ void GpuCommandBufferStub::CommandBufferWasDestroyed() {
HandleDeferredMessages();
}
+void GpuCommandBufferStub::AddSetTokenCallback(
+ const base::Callback<void(int32)>& callback) {
+ set_token_callbacks_.push_back(callback);
+}
+
+void GpuCommandBufferStub::OnSetToken(int32 token) {
+ for (size_t i = 0; i < set_token_callbacks_.size(); ++i)
+ set_token_callbacks_[i].Run(token);
+}
+
void GpuCommandBufferStub::ResizeCallback(gfx::Size size) {
if (handle_ == gfx::kNullPluginWindow) {
scheduler_->decoder()->ResizeOffscreenFrameBuffer(size);

Powered by Google App Engine
This is Rietveld 408576698