Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3045)

Unified Diff: base/android/parcelable_channel_client.cc

Issue 2735113003: Changing SpawnChild to return a struct.
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/android/parcelable_channel_client.h ('k') | base/android/parcelable_channel_server.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « base/android/parcelable_channel_client.h ('k') | base/android/parcelable_channel_server.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698