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

Side by Side Diff: content/browser/child_process_launcher.cc

Issue 1156183003: Pass file Regions along with FDs to child processes on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add operator!= for Region Created 5 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/child_process_launcher.h" 5 #include "content/browser/child_process_launcher.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/files/file_util.h" 9 #include "base/files/file_util.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 files_to_register->Share(kPrimaryIPCChannel, ipcfd.get()); 137 files_to_register->Share(kPrimaryIPCChannel, ipcfd.get());
138 #else 138 #else
139 files_to_register->Transfer(kPrimaryIPCChannel, ipcfd.Pass()); 139 files_to_register->Transfer(kPrimaryIPCChannel, ipcfd.Pass());
140 #endif 140 #endif
141 #endif 141 #endif
142 142
143 #if defined(OS_ANDROID) 143 #if defined(OS_ANDROID)
144 // Android WebView runs in single process, ensure that we never get here 144 // Android WebView runs in single process, ensure that we never get here
145 // when running in single process mode. 145 // when running in single process mode.
146 CHECK(!cmd_line->HasSwitch(switches::kSingleProcess)); 146 CHECK(!cmd_line->HasSwitch(switches::kSingleProcess));
147 147 std::map<int, base::MemoryMappedFile::Region> regions;
148 GetContentClient()->browser()->GetAdditionalMappedFilesForChildProcess( 148 GetContentClient()->browser()->GetAdditionalMappedFilesForChildProcess(
149 *cmd_line, child_process_id, files_to_register.get()); 149 *cmd_line, child_process_id, files_to_register.get());
150 150
151 StartChildProcess( 151 StartChildProcess(
152 cmd_line->argv(), child_process_id, files_to_register.Pass(), 152 cmd_line->argv(), child_process_id, files_to_register.Pass(), regions,
153 base::Bind(&OnChildProcessStartedAndroid, callback, client_thread_id, 153 base::Bind(&OnChildProcessStartedAndroid, callback, client_thread_id,
154 begin_launch_time, base::Passed(&ipcfd))); 154 begin_launch_time, base::Passed(&ipcfd)));
155 155
156 #elif defined(OS_POSIX) 156 #elif defined(OS_POSIX)
157 // We need to close the client end of the IPC channel to reliably detect 157 // We need to close the client end of the IPC channel to reliably detect
158 // child termination. 158 // child termination.
159 159
160 #if !defined(OS_MACOSX) 160 #if !defined(OS_MACOSX)
161 GetContentClient()->browser()->GetAdditionalMappedFilesForChildProcess( 161 GetContentClient()->browser()->GetAdditionalMappedFilesForChildProcess(
162 *cmd_line, child_process_id, files_to_register.get()); 162 *cmd_line, child_process_id, files_to_register.get());
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
493 } 493 }
494 494
495 ChildProcessLauncher::Client* ChildProcessLauncher::ReplaceClientForTest( 495 ChildProcessLauncher::Client* ChildProcessLauncher::ReplaceClientForTest(
496 Client* client) { 496 Client* client) {
497 Client* ret = client_; 497 Client* ret = client_;
498 client_ = client; 498 client_ = client;
499 return ret; 499 return ret;
500 } 500 }
501 501
502 } // namespace content 502 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698