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

Unified Diff: base/test/android/java/src/org/chromium/base/FileDescriptorInfo.java

Issue 2549363004: Multiprocess test client: Android child process launcher rework. (Closed)
Patch Set: Fixed tests Created 4 years 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
Index: base/test/android/java/src/org/chromium/base/FileDescriptorInfo.java
diff --git a/base/test/android/java/src/org/chromium/base/FileDescriptorInfo.java b/base/test/android/java/src/org/chromium/base/FileDescriptorInfo.java
new file mode 100644
index 0000000000000000000000000000000000000000..102787684a8b09e03e69d1e69339b738d096f15d
--- /dev/null
+++ b/base/test/android/java/src/org/chromium/base/FileDescriptorInfo.java
@@ -0,0 +1,55 @@
+// Copyright 2016 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.
+
+package org.chromium.base;
+
+import android.annotation.SuppressLint;
+import android.os.Parcel;
+import android.os.ParcelFileDescriptor;
+import android.os.Parcelable;
+
+/**
+ * Parcelable class that contains file descriptor and an ID.
+ * TODO(jcivelli): should be merged with
+ * org.chromium.content.common.FileDescriptorInfo
+ */
+@SuppressLint("ParcelClassLoader")
+public final class FileDescriptorInfo implements Parcelable {
+ public final int mId;
+ public final ParcelFileDescriptor mFd;
+
+ public FileDescriptorInfo(int id, ParcelFileDescriptor fd) {
+ mId = id;
+ mFd = fd;
+ }
+
+ FileDescriptorInfo(Parcel in) {
+ mId = in.readInt();
+ mFd = in.readParcelable(null);
+ }
+
+ @Override
+ public int describeContents() {
+ return CONTENTS_FILE_DESCRIPTOR;
+ }
+
+ @Override
+ public void writeToParcel(Parcel dest, int flags) {
+ dest.writeInt(mId);
+ dest.writeParcelable(mFd, CONTENTS_FILE_DESCRIPTOR);
+ }
+
+ public static final Parcelable.Creator<FileDescriptorInfo> CREATOR =
+ new Parcelable.Creator<FileDescriptorInfo>() {
+ @Override
+ public FileDescriptorInfo createFromParcel(Parcel in) {
+ return new FileDescriptorInfo(in);
+ }
+
+ @Override
+ public FileDescriptorInfo[] newArray(int size) {
+ return new FileDescriptorInfo[size];
+ }
+ };
+}

Powered by Google App Engine
This is Rietveld 408576698