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

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

Issue 2549363004: Multiprocess test client: Android child process launcher rework. (Closed)
Patch Set: Sublime ate my channel_pair change... 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 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 package org.chromium.base;
6
7 import android.annotation.SuppressLint;
8 import android.os.Parcel;
9 import android.os.ParcelFileDescriptor;
10 import android.os.Parcelable;
11
12 /**
13 * Parcelable class that contains file descriptor and an ID.
14 * TODO(jcivelli): should be merged with
15 * org.chromium.content.common.FileDescriptorInfo
16 */
17 @SuppressLint("ParcelClassLoader")
18 public final class FileDescriptorInfo implements Parcelable {
19 public final int mId;
nyquist 2016/12/13 20:40:30 Nit: Could you describe what the ID is for?
Jay Civelli 2016/12/14 02:20:10 Done.
20 public final ParcelFileDescriptor mFd;
nyquist 2016/12/13 20:40:30 Nit: Public fields should not have the m-prefix I
Jay Civelli 2016/12/14 02:20:10 Done.
21
22 public FileDescriptorInfo(int id, ParcelFileDescriptor fd) {
23 mId = id;
24 mFd = fd;
25 }
26
27 FileDescriptorInfo(Parcel in) {
28 mId = in.readInt();
29 mFd = in.readParcelable(null);
30 }
31
32 @Override
33 public int describeContents() {
34 return CONTENTS_FILE_DESCRIPTOR;
35 }
36
37 @Override
38 public void writeToParcel(Parcel dest, int flags) {
39 dest.writeInt(mId);
40 dest.writeParcelable(mFd, CONTENTS_FILE_DESCRIPTOR);
41 }
42
43 public static final Parcelable.Creator<FileDescriptorInfo> CREATOR =
44 new Parcelable.Creator<FileDescriptorInfo>() {
45 @Override
46 public FileDescriptorInfo createFromParcel(Parcel in) {
47 return new FileDescriptorInfo(in);
48 }
49
50 @Override
51 public FileDescriptorInfo[] newArray(int size) {
52 return new FileDescriptorInfo[size];
53 }
54 };
55 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698