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

Unified Diff: base/android/parcelable_channel_server.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_server.h ('k') | base/debug/stack_trace_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « base/android/parcelable_channel_server.h ('k') | base/debug/stack_trace_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698