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

Unified Diff: services/gles2/command_buffer_impl.h

Issue 1161533005: Fix crash when backgrounding MojoShell on Android. Fixes issue #186. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 7 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
« no previous file with comments | « no previous file | services/gles2/command_buffer_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/gles2/command_buffer_impl.h
diff --git a/services/gles2/command_buffer_impl.h b/services/gles2/command_buffer_impl.h
index 44bf85ba23d861127ab25699409cb9be867a8807..d2f79c4d3a9bc348705a988e346a156f031df877 100644
--- a/services/gles2/command_buffer_impl.h
+++ b/services/gles2/command_buffer_impl.h
@@ -8,7 +8,7 @@
#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/public/cpp/bindings/binding.h"
#include "mojo/services/gpu/public/interfaces/command_buffer.mojom.h"
#include "mojo/services/gpu/public/interfaces/viewport_parameter_listener.mojom.h"
@@ -23,7 +23,7 @@ class CommandBufferDriver;
// so that we can insert sync points without blocking on the GL driver. It
// forwards most method calls to the CommandBufferDriver, which runs on the
// same thread as the native viewport.
-class CommandBufferImpl : public mojo::CommandBuffer {
+class CommandBufferImpl : public mojo::CommandBuffer, mojo::ErrorHandler {
public:
class Observer {
public:
@@ -57,17 +57,26 @@ class CommandBufferImpl : public mojo::CommandBuffer {
void UpdateVSyncParameters(base::TimeTicks timebase,
base::TimeDelta interval);
+ // Sets an observer for CommandBufferImpl destruction. An observer registered
+ // here will be notified of the destruction of this object on the thread used
+ // to create it, before the destruction happens.
void set_observer(Observer* observer) { observer_ = observer; }
+ // mojo::ErrorHandler implementation
+ void OnConnectionError() override;
+
private:
void BindToRequest(mojo::InterfaceRequest<CommandBuffer> request);
+ void NotifyAndDestroy();
+ void Destroy();
scoped_refptr<gpu::SyncPointManager> sync_point_manager_;
+ scoped_refptr<base::SingleThreadTaskRunner> control_task_runner_;
scoped_refptr<base::SingleThreadTaskRunner> driver_task_runner_;
scoped_ptr<CommandBufferDriver> driver_;
mojo::CommandBufferSyncPointClientPtr sync_point_client_;
mojo::ViewportParameterListenerPtr viewport_parameter_listener_;
- mojo::StrongBinding<CommandBuffer> binding_;
+ mojo::Binding<CommandBuffer> binding_;
Observer* observer_;
base::WeakPtrFactory<CommandBufferImpl> weak_factory_;
« no previous file with comments | « no previous file | services/gles2/command_buffer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698