OLD | NEW |
---|---|
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 BASE_TEST_MULTIPROCESS_TEST_H_ | 5 #ifndef BASE_TEST_MULTIPROCESS_TEST_H_ |
6 #define BASE_TEST_MULTIPROCESS_TEST_H_ | 6 #define BASE_TEST_MULTIPROCESS_TEST_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
51 // | 51 // |
52 // Example signature: | 52 // Example signature: |
53 // extern "C" int __declspec(dllexport) FooBar() { | 53 // extern "C" int __declspec(dllexport) FooBar() { |
54 // // do client work here | 54 // // do client work here |
55 // } | 55 // } |
56 // | 56 // |
57 // Returns the handle to the child, or NULL on failure | 57 // Returns the handle to the child, or NULL on failure |
58 ProcessHandle SpawnChild(const std::string& procname, bool debug_on_start); | 58 ProcessHandle SpawnChild(const std::string& procname, bool debug_on_start); |
59 | 59 |
60 #if defined(OS_POSIX) | 60 #if defined(OS_POSIX) |
61 // TODO(evan): see if we can delete this via more refactoring. | |
61 ProcessHandle SpawnChild(const std::string& procname, | 62 ProcessHandle SpawnChild(const std::string& procname, |
62 const file_handle_mapping_vector& fds_to_map, | 63 const file_handle_mapping_vector& fds_to_map, |
63 bool debug_on_start); | 64 bool debug_on_start); |
64 #endif | 65 #endif |
65 | 66 |
66 // Set up the command line used to spawn the child process. | 67 // Set up the command line used to spawn the child process. |
67 virtual CommandLine MakeCmdLine(const std::string& procname, | 68 virtual CommandLine MakeCmdLine(const std::string& procname, |
68 bool debug_on_start); | 69 bool debug_on_start); |
69 | 70 |
70 private: | 71 private: |
71 #if defined(OS_WIN) | |
72 ProcessHandle SpawnChildImpl(const std::string& procname, | |
73 bool debug_on_start); | |
74 | |
75 #elif defined(OS_POSIX) | |
76 // TODO(port): with the CommandLine refactoring, this code is very similar | |
77 // to the Windows code. Investigate whether this can be made shorter. | |
78 ProcessHandle SpawnChildImpl(const std::string& procname, | 72 ProcessHandle SpawnChildImpl(const std::string& procname, |
79 const file_handle_mapping_vector& fds_to_map, | 73 const file_handle_mapping_vector& fds_to_map, |
Mark Mentovai
2011/07/12 20:45:00
This argument is still unused on Windows. Mention
Evan Martin
2011/07/12 21:22:29
I think my eventual refactoring target here is hav
| |
80 bool debug_on_start); | 74 bool debug_on_start); |
81 #endif | |
82 | 75 |
83 DISALLOW_COPY_AND_ASSIGN(MultiProcessTest); | 76 DISALLOW_COPY_AND_ASSIGN(MultiProcessTest); |
84 }; | 77 }; |
85 | 78 |
86 } // namespace base | 79 } // namespace base |
87 | 80 |
88 #endif // BASE_TEST_MULTIPROCESS_TEST_H_ | 81 #endif // BASE_TEST_MULTIPROCESS_TEST_H_ |
OLD | NEW |