Index: base/android/parcelable_channel_client.cc |
diff --git a/base/android/parcelable_channel_client.cc b/base/android/parcelable_channel_client.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..0983ab8423a7bdae2e4423d6687a7053f30c26d7 |
--- /dev/null |
+++ b/base/android/parcelable_channel_client.cc |
@@ -0,0 +1,41 @@ |
+// 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. |
+ |
+#include "base/android/parcelable_channel_client.h" |
+ |
+#include "jni/ParcelableChannelClient_jni.h" |
+ |
+namespace base { |
+namespace android { |
+ |
+ParcelableChannelClient::ParcelableChannelClient() {} |
+ |
+ParcelableChannelClient::ParcelableChannelClient( |
+ const base::android::JavaRef<jobject>& j_parcelable_channel) |
+ : j_parcelable_channel_(j_parcelable_channel) { |
+ DCHECK(!j_parcelable_channel_.is_null()); |
+} |
+ |
+ParcelableChannelClient::ParcelableChannelClient( |
+ ParcelableChannelClient&& other) |
+ : j_parcelable_channel_(std::move(other.j_parcelable_channel_)) {} |
+ |
+ParcelableChannelClient& ParcelableChannelClient::operator=( |
+ ParcelableChannelClient&& other) { |
+ j_parcelable_channel_ = std::move(other.j_parcelable_channel_); |
+ return *this; |
+} |
+ |
+void ParcelableChannelClient::SendParcelable( |
+ uint32_t id, |
+ base::android::ScopedJavaLocalRef<jobject> parcelable) { |
+ DCHECK(!j_parcelable_channel_.is_null()); |
+ |
+ Java_ParcelableChannelClient_sendParcelable( |
+ base::android::AttachCurrentThread(), j_parcelable_channel_, id, |
+ parcelable); |
+} |
+ |
+} // namespace android |
+} // namespace base |