OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef BASE_ANDROID_PARCELABLE_CHANNEL_CLIENT_H_ |
| 6 #define BASE_ANDROID_PARCELABLE_CHANNEL_CLIENT_H_ |
| 7 |
| 8 #include "base/android/scoped_java_ref.h" |
| 9 #include "base/base_export.h" |
| 10 |
| 11 namespace base { |
| 12 namespace android { |
| 13 |
| 14 class BASE_EXPORT ParcelableChannelClient { |
| 15 public: |
| 16 ParcelableChannelClient(); |
| 17 explicit ParcelableChannelClient( |
| 18 const base::android::JavaRef<jobject>& j_parcelable_channel); |
| 19 |
| 20 ParcelableChannelClient(ParcelableChannelClient&& other); |
| 21 ParcelableChannelClient& operator=(ParcelableChannelClient&& other); |
| 22 |
| 23 bool is_valid() const { return !j_parcelable_channel_.is_null(); } |
| 24 |
| 25 // Sends the |parcelable| over the channel. |
| 26 void SendParcelable(uint32_t id, |
| 27 base::android::ScopedJavaLocalRef<jobject> parcelable); |
| 28 |
| 29 private: |
| 30 base::android::ScopedJavaGlobalRef<jobject> j_parcelable_channel_; |
| 31 |
| 32 DISALLOW_COPY_AND_ASSIGN(ParcelableChannelClient); |
| 33 }; |
| 34 |
| 35 } // namespace android |
| 36 } // namespace base |
| 37 |
| 38 #endif // #define BASE_ANDROID_PARCELABLE_CHANNEL_CLIENT_H_ |
OLD | NEW |