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

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

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.h
diff --git a/content/common/gpu/gpu_command_buffer_stub.h b/content/common/gpu/gpu_command_buffer_stub.h
index fa8d7eeb969cdd37c0a2076e85c3f034b34b9709..d0e203e3455525fa3806a8dc573bd6d8cb5db762 100644
--- a/content/common/gpu/gpu_command_buffer_stub.h
+++ b/content/common/gpu/gpu_command_buffer_stub.h
@@ -63,6 +63,12 @@ class GpuCommandBufferStub
// to the same renderer process.
int32 route_id() const { return route_id_; }
+ // Return the current token in the underlying command buffer, or 0 if not yet
+ // initialized.
+ int32 token() const {
+ return command_buffer_.get() ? command_buffer_->GetState().token : 0;
scherkus (not reviewing) 2011/06/27 22:54:47 sntyck: worth constant-izing 0 token, or is that t
Ami GONE FROM CHROMIUM 2011/06/28 00:06:35 I am following command_buffer.h:CommandBuffer::Sta
+ }
+
#if defined(OS_WIN)
// Called only by the compositor window's window proc
void OnCompositorWindowPainted();
@@ -84,6 +90,11 @@ class GpuCommandBufferStub
// unblock itself and handle pending messages.
void CommandBufferWasDestroyed();
+ // Register a callback to be Run() whenever the underlying scheduler receives
+ // a set_token() call. The callback will be Run() with the just-set token as
+ // its only parameter. Multiple callbacks may be registered.
+ void AddSetTokenCallback(const base::Callback<void(int32)>& callback);
scherkus (not reviewing) 2011/06/27 22:54:47 IWYU: base/callback.h ?
Ami GONE FROM CHROMIUM 2011/06/28 00:06:35 I'm not U'ing it here, I only need a fwd decl. Bu
+
private:
// Message handlers:
void OnInitialize(base::SharedMemoryHandle ring_buffer,
@@ -126,6 +137,9 @@ class GpuCommandBufferStub
void ResizeCallback(gfx::Size size);
void ReportState();
+ // Callback registered with GpuScheduler to receive set_token() notifications.
+ void OnSetToken(int32 token);
+
// The lifetime of objects of this class is managed by a GpuChannel. The
// GpuChannels destroy all the GpuCommandBufferStubs that they own when they
// are destroyed. So a raw pointer is safe.
@@ -147,6 +161,7 @@ class GpuCommandBufferStub
scoped_ptr<gpu::CommandBufferService> command_buffer_;
scoped_ptr<gpu::GpuScheduler> scheduler_;
std::queue<IPC::Message*> deferred_messages_;
+ std::vector<base::Callback<void(int32)> > set_token_callbacks_;
// SetParent may be called before Initialize, in which case we need to keep
// around the parent stub, so that Initialize can set the parent correctly.

Powered by Google App Engine
This is Rietveld 408576698