Chromium Code Reviews| OLD | NEW |
|---|---|
| (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.os.Parcel; | |
| 8 import android.os.Parcelable; | |
| 9 | |
| 10 import org.chromium.base.annotations.CalledByNative; | |
| 11 import org.chromium.base.annotations.JNINamespace; | |
| 12 | |
| 13 /** | |
| 14 * Contains the result of a native main method that ran in a child process. | |
| 15 */ | |
| 16 | |
|
nyquist
2016/12/13 20:40:30
Nit: remove empty line
Jay Civelli
2016/12/14 02:20:10
Done.
| |
| 17 @JNINamespace("base::android") | |
| 18 public final class MainReturnCodeResult implements Parcelable { | |
| 19 private final int mMainReturnCode; | |
| 20 private final boolean mTimedOut; | |
| 21 | |
| 22 public MainReturnCodeResult(int mainReturnCode, boolean timedOut) { | |
| 23 mMainReturnCode = mainReturnCode; | |
| 24 mTimedOut = timedOut; | |
| 25 } | |
| 26 | |
| 27 MainReturnCodeResult(Parcel in) { | |
| 28 mMainReturnCode = in.readInt(); | |
| 29 mTimedOut = (in.readInt() != 0); | |
| 30 } | |
| 31 | |
| 32 @CalledByNative | |
| 33 public int getReturnCode() { | |
| 34 return mMainReturnCode; | |
| 35 } | |
| 36 | |
| 37 @CalledByNative | |
| 38 public boolean hasTimedOut() { | |
| 39 return mTimedOut; | |
| 40 } | |
| 41 | |
| 42 @Override | |
| 43 public int describeContents() { | |
| 44 return 0; | |
| 45 } | |
| 46 | |
| 47 @Override | |
| 48 public void writeToParcel(Parcel dest, int flags) { | |
| 49 dest.writeInt(mMainReturnCode); | |
| 50 dest.writeInt(mTimedOut ? 1 : 0); | |
| 51 } | |
| 52 | |
| 53 public static final Parcelable.Creator<MainReturnCodeResult> CREATOR = | |
| 54 new Parcelable.Creator<MainReturnCodeResult>() { | |
| 55 @Override | |
| 56 public MainReturnCodeResult createFromParcel(Parcel in) { | |
| 57 return new MainReturnCodeResult(in); | |
| 58 } | |
| 59 | |
| 60 @Override | |
| 61 public MainReturnCodeResult[] newArray(int size) { | |
| 62 return new MainReturnCodeResult[size]; | |
| 63 } | |
| 64 }; | |
| 65 } | |
| OLD | NEW |