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

Unified Diff: content/public/android/java/src/org/chromium/content/app/ChildProcessServiceImpl.java

Issue 2684433003: Files required by a service now listed in manifest. (Closed)
Patch Set: Addressed @boliu and @jam's comments. Created 3 years, 10 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/app/ChildProcessServiceImpl.java
diff --git a/content/public/android/java/src/org/chromium/content/app/ChildProcessServiceImpl.java b/content/public/android/java/src/org/chromium/content/app/ChildProcessServiceImpl.java
index e6a84437fbc0ea0786e6e44bf969f43803751509..4b530bdf81a60c9e0783e7df5a8d3a1697bd0ba4 100644
--- a/content/public/android/java/src/org/chromium/content/app/ChildProcessServiceImpl.java
+++ b/content/public/android/java/src/org/chromium/content/app/ChildProcessServiceImpl.java
@@ -260,10 +260,22 @@ public class ChildProcessServiceImpl {
mMainThread.wait();
}
}
- for (FileDescriptorInfo fdInfo : mFdInfos) {
- nativeRegisterGlobalFileDescriptor(
- fdInfo.mId, fdInfo.mFd.detachFd(), fdInfo.mOffset, fdInfo.mSize);
+
+ String sharedFilesValue = CommandLine.getInstance().getSwitchValue(
boliu 2017/02/10 21:33:03 delete this, seems like don't need to copy the swi
Jay Civelli 2017/02/13 18:48:25 Done.
+ ContentSwitches.SHARED_FILES, null);
+
+ int[] fileIds = new int[mFdInfos.length];
+ int[] fds = new int[mFdInfos.length];
+ long[] regionOffsets = new long[mFdInfos.length];
+ long[] regionSizes = new long[mFdInfos.length];
+ for (int i = 0; i < mFdInfos.length; i++) {
+ FileDescriptorInfo fdInfo = mFdInfos[i];
+ fileIds[i] = fdInfo.mId;
+ fds[i] = fdInfo.mFd.detachFd();
+ regionOffsets[i] = fdInfo.mOffset;
+ regionSizes[i] = fdInfo.mSize;
}
+ nativeRegisterFileDescriptors(fileIds, fds, regionOffsets, regionSizes);
nativeInitChildProcessImpl(ChildProcessServiceImpl.this, mCpuCount,
mCpuFeatures);
if (mActivitySemaphore.tryAcquire()) {
@@ -401,12 +413,13 @@ public class ChildProcessServiceImpl {
}
/**
- * Helper for registering FileDescriptorInfo objects with GlobalFileDescriptors.
+ * Helper for registering FileDescriptorInfo objects with GlobalFileDescriptors or
+ * FileDescriptorStore.
* This includes the IPC channel, the crash dump signals and resource related
* files.
*/
- private static native void nativeRegisterGlobalFileDescriptor(
- int id, int fd, long offset, long size);
+ private static native void nativeRegisterFileDescriptors(
+ int[] id, int[] fd, long[] offset, long[] size);
/**
* The main entry point for a child process. This should be called from a new thread since

Powered by Google App Engine
This is Rietveld 408576698