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

Unified Diff: services/native_viewport/native_viewport_impl.h

Issue 1029753002: Plumbs through android supplying multipe touch points (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: cleanup Created 5 years, 9 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: services/native_viewport/native_viewport_impl.h
diff --git a/services/native_viewport/native_viewport_impl.h b/services/native_viewport/native_viewport_impl.h
index 4e778009158c9be3113033bfdc7a8fea8a9a3bae..ebced45d340d948aec2b53bb986383b6eb7e3f68 100644
--- a/services/native_viewport/native_viewport_impl.h
+++ b/services/native_viewport/native_viewport_impl.h
@@ -5,6 +5,8 @@
#ifndef SERVICES_NATIVE_VIEWPORT_NATIVE_VIEWPORT_IMPL_H_
#define SERVICES_NATIVE_VIEWPORT_NATIVE_VIEWPORT_IMPL_H_
+#include <set>
+
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "mojo/public/cpp/bindings/strong_binding.h"
@@ -59,21 +61,31 @@ class NativeViewportImpl : public mojo::NativeViewport,
// mojo::ErrorHandler implementation.
void OnConnectionError() override;
- void AckEvent();
-
private:
+ // Used by AckEvent; see it for details.
+ struct PointerId {
+ int32 id;
qsr 2015/03/24 08:20:22 I am missing something, but why do you need this o
sky 2015/03/24 13:18:21 I did this as I thought it a bit mysterious to tak
+ };
+
+ // Callback when the dispatcher has processed a message we're waiting on
+ // an ack from. |id->id| identifies the pointer the message was associated
+ // with. Receiver does not own supplied value (its owned by the callback).
+ void AckEvent(PointerId* id);
+
bool is_headless_;
scoped_ptr<PlatformViewport> platform_viewport_;
OnscreenContextProvider context_provider_;
bool sent_metrics_;
mojo::ViewportMetricsPtr metrics_;
- bool waiting_for_event_ack_;
CreateCallback create_callback_;
RequestMetricsCallback metrics_callback_;
mojo::NativeViewportEventDispatcherPtr event_dispatcher_;
mojo::Binding<mojo::NativeViewport> binding_;
base::WeakPtrFactory<NativeViewportImpl> weak_factory_;
+ // Set of pointer_ids we've sent a move to and are waiting on an ack.
+ std::set<int32> pointers_waiting_on_ack_;
+
DISALLOW_COPY_AND_ASSIGN(NativeViewportImpl);
};

Powered by Google App Engine
This is Rietveld 408576698