Chromium Code Reviews| Index: content/public/android/java/src/org/chromium/content/browser/ChildProcessConnectionImpl.java |
| diff --git a/content/public/android/java/src/org/chromium/content/browser/ChildProcessConnectionImpl.java b/content/public/android/java/src/org/chromium/content/browser/ChildProcessConnectionImpl.java |
| index 2f783f27f0f90c9cadbaa35963ee752df9ac81cf..e68d5959475445e3d5c60a220355803eab67027b 100644 |
| --- a/content/public/android/java/src/org/chromium/content/browser/ChildProcessConnectionImpl.java |
| +++ b/content/public/android/java/src/org/chromium/content/browser/ChildProcessConnectionImpl.java |
| @@ -11,7 +11,6 @@ import android.content.ServiceConnection; |
| import android.os.Bundle; |
| import android.os.DeadObjectException; |
| import android.os.IBinder; |
| -import android.os.ParcelFileDescriptor; |
| import android.os.RemoteException; |
| import android.util.Log; |
| @@ -320,34 +319,7 @@ public class ChildProcessConnectionImpl implements ChildProcessConnection { |
| Bundle bundle = new Bundle(); |
| bundle.putStringArray(EXTRA_COMMAND_LINE, mConnectionParams.mCommandLine); |
|
Yaron
2015/05/29 18:29:22
nit: no ws
agrieve
2015/05/29 19:16:40
Done.
|
| - FileDescriptorInfo[] fileInfos = mConnectionParams.mFilesToBeMapped; |
| - ParcelFileDescriptor[] parcelFiles = new ParcelFileDescriptor[fileInfos.length]; |
| - for (int i = 0; i < fileInfos.length; i++) { |
| - if (fileInfos[i].mFd == -1) { |
| - // If someone provided an invalid FD, they are doing something wrong. |
| - Log.e(TAG, "Invalid FD (id=" + fileInfos[i].mId + ") for process connection, " |
| - + "aborting connection."); |
| - return; |
| - } |
| - String idName = EXTRA_FILES_PREFIX + i + EXTRA_FILES_ID_SUFFIX; |
| - String fdName = EXTRA_FILES_PREFIX + i + EXTRA_FILES_FD_SUFFIX; |
| - if (fileInfos[i].mAutoClose) { |
| - // Adopt the FD, it will be closed when we close the ParcelFileDescriptor. |
| - parcelFiles[i] = ParcelFileDescriptor.adoptFd(fileInfos[i].mFd); |
| - } else { |
| - try { |
| - parcelFiles[i] = ParcelFileDescriptor.fromFd(fileInfos[i].mFd); |
| - } catch (IOException e) { |
| - Log.e(TAG, |
| - "Invalid FD provided for process connection, aborting connection.", |
| - e); |
| - return; |
| - } |
| - |
| - } |
| - bundle.putParcelable(fdName, parcelFiles[i]); |
| - bundle.putInt(idName, fileInfos[i].mId); |
| - } |
| + bundle.putParcelableArray(EXTRA_FILES, mConnectionParams.mFilesToBeMapped); |
| // Add the CPU properties now. |
| bundle.putInt(EXTRA_CPU_COUNT, CpuFeatures.getCount()); |
| bundle.putLong(EXTRA_CPU_FEATURES, CpuFeatures.getMask()); |
| @@ -363,8 +335,8 @@ public class ChildProcessConnectionImpl implements ChildProcessConnection { |
| } |
| // We proactively close the FDs rather than wait for GC & finalizer. |
| try { |
| - for (ParcelFileDescriptor parcelFile : parcelFiles) { |
| - if (parcelFile != null) parcelFile.close(); |
| + for (FileDescriptorInfo fileInfo : mConnectionParams.mFilesToBeMapped) { |
| + fileInfo.mFd.close(); |
| } |
| } catch (IOException ioe) { |
| Log.w(TAG, "Failed to close FD.", ioe); |