| OLD | NEW |
| 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 #ifndef CONTENT_BROWSER_CHILD_PROCESS_LAUNCHER_HELPER_POSIX_H_ | 5 #ifndef CONTENT_BROWSER_CHILD_PROCESS_LAUNCHER_HELPER_POSIX_H_ |
| 6 #define CONTENT_BROWSER_CHILD_PROCESS_LAUNCHER_HELPER_POSIX_H_ | 6 #define CONTENT_BROWSER_CHILD_PROCESS_LAUNCHER_HELPER_POSIX_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/files/file.h" | 10 #include "base/files/file.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 const mojo::edk::PlatformHandle& mojo_client_handle, | 36 const mojo::edk::PlatformHandle& mojo_client_handle, |
| 37 bool include_service_required_files, | 37 bool include_service_required_files, |
| 38 const std::string& process_type, | 38 const std::string& process_type, |
| 39 base::CommandLine* command_line); | 39 base::CommandLine* command_line); |
| 40 | 40 |
| 41 // Called by the service manager to register the files that should be mapped for | 41 // Called by the service manager to register the files that should be mapped for |
| 42 // a service in the child process. | 42 // a service in the child process. |
| 43 void SetFilesToShareForServicePosix(const std::string& service_name, | 43 void SetFilesToShareForServicePosix(const std::string& service_name, |
| 44 catalog::RequiredFileMap required_files); | 44 catalog::RequiredFileMap required_files); |
| 45 | 45 |
| 46 // Called from unit_tests in order to reset all previously registered files. |
| 47 void ResetFilesToShareForTestingPosix(); |
| 48 |
| 46 // Opens the file in read mode at the given path. Note that the path should be | 49 // Opens the file in read mode at the given path. Note that the path should be |
| 47 // relative and the way it is resolved is platform specific. | 50 // relative and the way it is resolved is platform specific. |
| 48 // |region| is set to the region of the file that should be read. | 51 // |region| is set to the region of the file that should be read. |
| 49 base::File OpenFileToShare(const base::FilePath& path, | 52 base::File OpenFileToShare(const base::FilePath& path, |
| 50 base::MemoryMappedFile::Region* region); | 53 base::MemoryMappedFile::Region* region); |
| 51 | 54 |
| 52 } // namespace internal | 55 } // namespace internal |
| 53 | 56 |
| 54 } // namespace content | 57 } // namespace content |
| 55 | 58 |
| 56 #endif // CONTENT_BROWSER_CHILD_PROCESS_LAUNCHER_HELPER_POSIX_H_ | 59 #endif // CONTENT_BROWSER_CHILD_PROCESS_LAUNCHER_HELPER_POSIX_H_ |
| OLD | NEW |