Index: base/android/parcelable_channel_server.cc |
diff --git a/base/android/parcelable_channel_server.cc b/base/android/parcelable_channel_server.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..0c87ece8d5281405da363d208fd6f6c48f304e54 |
--- /dev/null |
+++ b/base/android/parcelable_channel_server.cc |
@@ -0,0 +1,39 @@ |
+// 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_server.h" |
+ |
+#include "jni/ParcelableChannelServer_jni.h" |
+ |
+namespace base { |
+namespace android { |
+ |
+ParcelableChannelServer::ParcelableChannelServer() {} |
+ |
+ParcelableChannelServer::ParcelableChannelServer( |
+ const base::android::JavaRef<jobject>& j_parcelable_channel) |
+ : j_parcelable_channel_(j_parcelable_channel) { |
+ DCHECK(!j_parcelable_channel_.is_null()); |
+} |
+ |
+ParcelableChannelServer::ParcelableChannelServer( |
+ ParcelableChannelServer&& other) |
+ : j_parcelable_channel_(std::move(other.j_parcelable_channel_)) {} |
+ |
+ParcelableChannelServer& ParcelableChannelServer::operator=( |
+ ParcelableChannelServer&& other) { |
+ j_parcelable_channel_ = std::move(other.j_parcelable_channel_); |
+ return *this; |
+} |
+ |
+base::android::ScopedJavaLocalRef<jobject> |
+ParcelableChannelServer::TakeParcelable(uint32_t id) { |
+ DCHECK(!j_parcelable_channel_.is_null()); |
+ |
+ return Java_ParcelableChannelServer_takeParcelable( |
+ base::android::AttachCurrentThread(), j_parcelable_channel_, id); |
+} |
+ |
+} // namespace android |
+} // namespace base |