Index: base/android/parcelable_channel_client.h |
diff --git a/base/android/parcelable_channel_client.h b/base/android/parcelable_channel_client.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..3e987a12319011ecdae345af51c2f73ecc2d0e07 |
--- /dev/null |
+++ b/base/android/parcelable_channel_client.h |
@@ -0,0 +1,38 @@ |
+// Copyright 2017 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. |
+ |
+#ifndef BASE_ANDROID_PARCELABLE_CHANNEL_CLIENT_H_ |
+#define BASE_ANDROID_PARCELABLE_CHANNEL_CLIENT_H_ |
+ |
+#include "base/android/scoped_java_ref.h" |
+#include "base/base_export.h" |
+ |
+namespace base { |
+namespace android { |
+ |
+class BASE_EXPORT ParcelableChannelClient { |
+ public: |
+ ParcelableChannelClient(); |
+ explicit ParcelableChannelClient( |
+ const base::android::JavaRef<jobject>& j_parcelable_channel); |
+ |
+ ParcelableChannelClient(ParcelableChannelClient&& other); |
+ ParcelableChannelClient& operator=(ParcelableChannelClient&& other); |
+ |
+ bool is_valid() const { return !j_parcelable_channel_.is_null(); } |
+ |
+ // Sends the |parcelable| over the channel. |
+ void SendParcelable(uint32_t id, |
+ base::android::ScopedJavaLocalRef<jobject> parcelable); |
+ |
+ private: |
+ base::android::ScopedJavaGlobalRef<jobject> j_parcelable_channel_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(ParcelableChannelClient); |
+}; |
+ |
+} // namespace android |
+} // namespace base |
+ |
+#endif // #define BASE_ANDROID_PARCELABLE_CHANNEL_CLIENT_H_ |