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

Unified Diff: content/browser/android/child_process_launcher_android.cc

Issue 2613803003: Simplifying ContentBrowserClient::GetAdditionalMappedFiles...() (Closed)
Patch Set: Addressed jam@'s comment Created 3 years, 11 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/browser/android/child_process_launcher_android.cc
diff --git a/content/browser/android/child_process_launcher_android.cc b/content/browser/android/child_process_launcher_android.cc
index 77b45d526ebf263acd959f105d372bcadb319ed4..a196b1abd438031f195bdec4f28c02dceae5c91a 100644
--- a/content/browser/android/child_process_launcher_android.cc
+++ b/content/browser/android/child_process_launcher_android.cc
@@ -113,7 +113,6 @@ void StartChildProcess(
const base::CommandLine::StringVector& argv,
int child_process_id,
std::unique_ptr<content::FileDescriptorInfo> files_to_register,
- const std::map<int, base::MemoryMappedFile::Region>& regions,
const StartChildProcessCallback& callback) {
JNIEnv* env = AttachCurrentThread();
DCHECK(env);
@@ -135,13 +134,10 @@ void StartChildProcess(
PCHECK(0 <= fd);
int id = files_to_register->GetIDAt(i);
bool auto_close = files_to_register->OwnsFD(fd);
- int64_t offset = 0L;
- int64_t size = 0L;
- auto found_region_iter = regions.find(id);
- if (found_region_iter != regions.end()) {
- offset = found_region_iter->second.offset;
- size = found_region_iter->second.size;
- }
+ const base::MemoryMappedFile::Region& region =
+ files_to_register->GetRegionAt(i);
+ int64_t offset = region.offset;
+ int64_t size = region.size;
ScopedJavaLocalRef<jobject> j_file_info =
Java_ChildProcessLauncher_makeFdInfo(env, id, fd, auto_close, offset,
size);

Powered by Google App Engine
This is Rietveld 408576698