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

Unified Diff: mojo/services/gles2/command_buffer_impl.h

Issue 739493002: Introduce command buffer control thread (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Forward echo too Created 6 years, 1 month 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: mojo/services/gles2/command_buffer_impl.h
diff --git a/mojo/services/gles2/command_buffer_impl.h b/mojo/services/gles2/command_buffer_impl.h
index 44ff14ca5cc7d50eebf1bd34b44234dad8fe21f6..a28112e454e1262cb0bc54d82abf7dc20af99980 100644
--- a/mojo/services/gles2/command_buffer_impl.h
+++ b/mojo/services/gles2/command_buffer_impl.h
@@ -6,6 +6,8 @@
#define MOJO_SERVICES_GLES2_COMMAND_BUFFER_IMPL_H_
#include "base/memory/scoped_ptr.h"
+#include "base/memory/weak_ptr.h"
+#include "base/single_thread_task_runner.h"
#include "mojo/public/cpp/bindings/strong_binding.h"
#include "mojo/services/public/interfaces/gpu/command_buffer.mojom.h"
@@ -14,27 +16,33 @@ class CommandBufferDriver;
class CommandBufferImpl : public CommandBuffer {
jamesr 2014/11/19 06:43:02 could use a class level comment
abarth-chromium 2014/11/19 16:54:10 Done.
public:
- CommandBufferImpl(InterfaceRequest<CommandBuffer> request,
- scoped_ptr<CommandBufferDriver> driver);
+ CommandBufferImpl(
+ InterfaceRequest<CommandBuffer> request,
+ scoped_refptr<base::SingleThreadTaskRunner> control_task_runner,
+ scoped_ptr<CommandBufferDriver> driver);
~CommandBufferImpl() override;
void Initialize(CommandBufferSyncClientPtr sync_client,
- mojo::ScopedSharedBufferHandle shared_state) override;
+ ScopedSharedBufferHandle shared_state) override;
void SetGetBuffer(int32_t buffer) override;
void Flush(int32_t put_offset) override;
void MakeProgress(int32_t last_get_offset) override;
void RegisterTransferBuffer(int32_t id,
- mojo::ScopedSharedBufferHandle transfer_buffer,
+ ScopedSharedBufferHandle transfer_buffer,
uint32_t size) override;
void DestroyTransferBuffer(int32_t id) override;
void Echo(const Callback<void()>& callback) override;
private:
+ void BindToRequest(InterfaceRequest<CommandBuffer> request);
void OnContextLost(int32_t reason);
- StrongBinding<CommandBuffer> binding_;
+ scoped_refptr<base::SingleThreadTaskRunner> driver_task_runner_;
scoped_ptr<CommandBufferDriver> driver_;
+ scoped_ptr<StrongBinding<CommandBuffer>> binding_;
jamesr 2014/11/19 06:43:02 hmm, no inherent need to have a scoped_ptr<> to th
abarth-chromium 2014/11/19 15:42:11 Sure thing.
+ base::WeakPtrFactory<CommandBufferImpl> weak_factory_;
+
DISALLOW_COPY_AND_ASSIGN(CommandBufferImpl);
};

Powered by Google App Engine
This is Rietveld 408576698