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

Unified Diff: content/app/android/child_process_service.cc

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/app/android/child_process_service.cc
diff --git a/content/app/android/child_process_service.cc b/content/app/android/child_process_service.cc
index b1a2add0ce45a96fddefe4aa56876ea3cc644bd9..75819ee5ba1e2db267f0c460daf93d9ced946114 100644
--- a/content/app/android/child_process_service.cc
+++ b/content/app/android/child_process_service.cc
@@ -131,9 +131,7 @@ class SurfaceTextureManagerImpl : public SurfaceTextureManager,
// Chrome actually uses the renderer code path for all of its child
// processes such as renderers, plugins, etc.
-void InternalInitChildProcess(const std::vector<int>& file_ids,
- const std::vector<int>& file_fds,
- JNIEnv* env,
+void InternalInitChildProcess(JNIEnv* env,
jclass clazz,
jobject context,
jobject service_in,
@@ -143,13 +141,6 @@ void InternalInitChildProcess(const std::vector<int>& file_ids,
// Set the CPU properties.
android_setCpu(cpu_count, cpu_features);
- // Register the file descriptors.
- // This includes the IPC channel, the crash dump signals and resource related
- // files.
- DCHECK(file_fds.size() == file_ids.size());
- for (size_t i = 0; i < file_ids.size(); ++i)
- base::GlobalDescriptors::GetInstance()->Set(file_ids[i], file_fds[i]);
-
SurfaceTextureManager::SetInstance(new SurfaceTextureManagerImpl(service));
base::android::MemoryPressureListenerAndroid::RegisterSystemCallback(env);
@@ -157,21 +148,24 @@ void InternalInitChildProcess(const std::vector<int>& file_ids,
} // namespace <anonymous>
+void RegisterGlobalFileDescriptor(JNIEnv* env,
+ jclass clazz,
+ jint id,
+ jint fd,
+ jlong offset,
+ jlong size) {
+ LOG(WARNING) << "REG NATIVE " << id << " " << fd;
+ base::MemoryMappedFile::Region region(offset, size);
+ base::GlobalDescriptors::GetInstance()->Set(id, fd, region);
+}
+
void InitChildProcess(JNIEnv* env,
jclass clazz,
jobject context,
jobject service,
- jintArray j_file_ids,
- jintArray j_file_fds,
jint cpu_count,
jlong cpu_features) {
- std::vector<int> file_ids;
- std::vector<int> file_fds;
- JavaIntArrayToIntVector(env, j_file_ids, &file_ids);
- JavaIntArrayToIntVector(env, j_file_fds, &file_fds);
-
- InternalInitChildProcess(
- file_ids, file_fds, env, clazz, context, service,
+ InternalInitChildProcess(env, clazz, context, service,
cpu_count, cpu_features);
}

Powered by Google App Engine
This is Rietveld 408576698