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

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

Issue 2749653002: allow unit_tests to re-create service manager context. (Closed)
Patch Set: comment updated Created 3 years, 9 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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 "base/path_service.h" 5 #include "base/path_service.h"
6 #include "base/posix/global_descriptors.h" 6 #include "base/posix/global_descriptors.h"
7 #include "content/browser/child_process_launcher.h" 7 #include "content/browser/child_process_launcher.h"
8 #include "content/browser/child_process_launcher_helper.h" 8 #include "content/browser/child_process_launcher_helper.h"
9 #include "content/browser/child_process_launcher_helper_posix.h" 9 #include "content/browser/child_process_launcher_helper_posix.h"
10 #include "content/browser/renderer_host/render_sandbox_host_linux.h" 10 #include "content/browser/renderer_host/render_sandbox_host_linux.h"
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 } 145 }
146 146
147 // static 147 // static
148 void ChildProcessLauncherHelper::SetRegisteredFilesForService( 148 void ChildProcessLauncherHelper::SetRegisteredFilesForService(
149 const std::string& service_name, 149 const std::string& service_name,
150 catalog::RequiredFileMap required_files) { 150 catalog::RequiredFileMap required_files) {
151 SetFilesToShareForServicePosix(service_name, std::move(required_files)); 151 SetFilesToShareForServicePosix(service_name, std::move(required_files));
152 } 152 }
153 153
154 // static 154 // static
155 void ChildProcessLauncherHelper::ResetRegisteredFilesForTesting() {
156 ResetFilesToShareForTestingPosix();
157 }
158
159 // static
155 base::File OpenFileToShare(const base::FilePath& path, 160 base::File OpenFileToShare(const base::FilePath& path,
156 base::MemoryMappedFile::Region* region) { 161 base::MemoryMappedFile::Region* region) {
157 base::FilePath exe_dir; 162 base::FilePath exe_dir;
158 bool result = base::PathService::Get(base::BasePathKey::DIR_EXE, &exe_dir); 163 bool result = base::PathService::Get(base::BasePathKey::DIR_EXE, &exe_dir);
159 DCHECK(result); 164 DCHECK(result);
160 base::File file(exe_dir.Append(path), 165 base::File file(exe_dir.Append(path),
161 base::File::FLAG_OPEN | base::File::FLAG_READ); 166 base::File::FLAG_OPEN | base::File::FLAG_READ);
162 *region = base::MemoryMappedFile::Region::kWholeFile; 167 *region = base::MemoryMappedFile::Region::kWholeFile;
163 return file; 168 return file;
164 } 169 }
165 170
166 } // namespace internal 171 } // namespace internal
167 } // namespace content 172 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/child_process_launcher_helper_android.cc ('k') | content/browser/child_process_launcher_helper_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698