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 #include "base/android/parcelable_channel_server.h" |
| 6 |
| 7 #include "jni/ParcelableChannelServer_jni.h" |
| 8 |
| 9 namespace base { |
| 10 namespace android { |
| 11 |
| 12 ParcelableChannelServer::ParcelableChannelServer() {} |
| 13 |
| 14 ParcelableChannelServer::ParcelableChannelServer( |
| 15 const base::android::JavaRef<jobject>& j_parcelable_channel) |
| 16 : j_parcelable_channel_(j_parcelable_channel) { |
| 17 DCHECK(!j_parcelable_channel_.is_null()); |
| 18 } |
| 19 |
| 20 ParcelableChannelServer::ParcelableChannelServer( |
| 21 ParcelableChannelServer&& other) |
| 22 : j_parcelable_channel_(std::move(other.j_parcelable_channel_)) {} |
| 23 |
| 24 ParcelableChannelServer& ParcelableChannelServer::operator=( |
| 25 ParcelableChannelServer&& other) { |
| 26 j_parcelable_channel_ = std::move(other.j_parcelable_channel_); |
| 27 return *this; |
| 28 } |
| 29 |
| 30 base::android::ScopedJavaLocalRef<jobject> |
| 31 ParcelableChannelServer::TakeParcelable(uint32_t id) { |
| 32 DCHECK(!j_parcelable_channel_.is_null()); |
| 33 |
| 34 return Java_ParcelableChannelServer_takeParcelable( |
| 35 base::android::AttachCurrentThread(), j_parcelable_channel_, id); |
| 36 } |
| 37 |
| 38 } // namespace android |
| 39 } // namespace base |
OLD | NEW |