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

Unified Diff: content/public/android/java/src/org/chromium/content/browser/ChildProcessConnectionImpl.java

Issue 1156873002: Load v8 snapshots directly from APK (and store them uncompressed) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@v8initializer
Patch Set: Pass FDs & Regions through to child process (Still has formatting errors) Created 5 years, 7 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
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..d9eb9e91c85473a14eceb04ab7a28275afc12919 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
@@ -313,6 +313,7 @@ public class ChildProcessConnectionImpl implements ChildProcessConnection {
*/
private void doConnectionSetupLocked() {
try {
+ Log.e(TAG, "ANDREW SETUP CONN0.");
TraceEvent.begin("ChildProcessConnectionImpl.doConnectionSetupLocked");
assert mServiceConnectComplete && mService != null;
assert mConnectionParams != null;
@@ -320,41 +321,14 @@ public class ChildProcessConnectionImpl implements ChildProcessConnection {
Bundle bundle = new Bundle();
bundle.putStringArray(EXTRA_COMMAND_LINE, mConnectionParams.mCommandLine);
- 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());
bundle.putBundle(Linker.EXTRA_LINKER_SHARED_RELROS,
mConnectionParams.mSharedRelros);
-
+ Log.e(TAG, "ANDREW SETUP CONN.");
try {
mPid = mService.setupConnection(bundle, mConnectionParams.mCallback);
assert mPid != 0 : "Child service claims to be run by a process of pid=0.";
@@ -363,8 +337,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);

Powered by Google App Engine
This is Rietveld 408576698