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

Unified Diff: remoting/android/javatests/src/org/chromium/chromoting/Pointer.java

Issue 1999583002: Add Event and EventTest (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use only a Set instead of a Set and a List Created 4 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
Index: remoting/android/javatests/src/org/chromium/chromoting/Pointer.java
diff --git a/remoting/android/javatests/src/org/chromium/chromoting/Pointer.java b/remoting/android/javatests/src/org/chromium/chromoting/Pointer.java
new file mode 100644
index 0000000000000000000000000000000000000000..71091d38d428b05777bd889ff13a22c318099ceb
--- /dev/null
+++ b/remoting/android/javatests/src/org/chromium/chromoting/Pointer.java
@@ -0,0 +1,35 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.chromoting;
+
+/**
+ * A container of a reference to pass data into or out from a closure. This class is usually useful
+ * in test cases.
+ *
+ * @param <T> The type of reference.
+ */
+public class Pointer<T> {
+ private T mRef;
+
+ public Pointer() {
+ clear();
+ }
+
+ public Pointer(T ref) {
+ set(ref);
+ }
+
+ public void clear() {
+ set(null);
+ }
+
+ public void set(T ref) {
+ mRef = ref;
+ }
+
+ public T get() {
+ return mRef;
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698