OLD | NEW |
---|---|
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2014 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 CHROME_APP_CHROME_WATCHER_COMMAND_LINE_WIN_H_ | 5 #ifndef CHROME_APP_CHROME_WATCHER_COMMAND_LINE_WIN_H_ |
6 #define CHROME_APP_CHROME_WATCHER_COMMAND_LINE_WIN_H_ | 6 #define CHROME_APP_CHROME_WATCHER_COMMAND_LINE_WIN_H_ |
7 | 7 |
8 #include <windows.h> | 8 #include <windows.h> |
9 | 9 |
10 #include "base/win/scoped_handle.h" | 10 #include "base/win/scoped_handle.h" |
grt (UTC plus 2)
2015/02/03 21:20:45
can ScopedHandle be forward decl'd now?
erikwright (departed)
2015/02/03 21:56:47
It's a typedef, so no.
grt (UTC plus 2)
2015/02/04 03:04:47
Acknowledged.
| |
11 | 11 |
12 namespace base { | 12 namespace base { |
13 class CommandLine; | 13 class CommandLine; |
14 class FilePath; | 14 class FilePath; |
15 } // namespace base | 15 } // namespace base |
16 | 16 |
17 // Generates a CommandLine that will launch |chrome_exe| in Chrome Watcher mode | 17 // Generates a CommandLine that will launch |chrome_exe| in Chrome Watcher mode |
18 // to observe |parent_process|. | 18 // to observe |parent_process|. The watcher process will signal |
19 // |on_initialized_event| when its initialization is completed. | |
grt (UTC plus 2)
2015/02/03 21:20:45
nit: "is complete" or "has completed"
erikwright (departed)
2015/02/03 21:56:47
Done.
| |
19 base::CommandLine GenerateChromeWatcherCommandLine( | 20 base::CommandLine GenerateChromeWatcherCommandLine( |
20 const base::FilePath& chrome_exe, | 21 const base::FilePath& chrome_exe, |
22 HANDLE on_initialized_event, | |
grt (UTC plus 2)
2015/02/03 21:20:45
based on the comment above, i'd swap on_initialize
erikwright (departed)
2015/02/03 21:26:02
We end up binding this to |chrome_exe|, and later
grt (UTC plus 2)
2015/02/04 03:04:47
It took me a really long time to understand what y
erikwright (departed)
2015/02/04 04:19:18
I reversed the order to make the public contract i
| |
21 HANDLE parent_process); | 23 HANDLE parent_process); |
22 | 24 |
23 // Interprets the Command Line used to launch a Chrome Watcher process and | 25 // Interprets the Command Line used to launch a Chrome Watcher process and |
24 // extracts the parent process HANDLE. Verifies that the handle is usable in | 26 // extracts the parent process and initialization event HANDLEs. Verifies that |
25 // this process before returning it, and returns NULL in case of a failure. | 27 // the handles are usable in this process before returning them. Returns true if |
26 base::win::ScopedHandle InterpretChromeWatcherCommandLine( | 28 // both handles are successfully parsed and false otherwise. If only one of the |
27 const base::CommandLine& command_line); | 29 // handles can be parsed, it will be closed. |
30 bool InterpretChromeWatcherCommandLine( | |
31 const base::CommandLine& command_line, | |
32 base::win::ScopedHandle* on_initialized_event, | |
grt (UTC plus 2)
2015/02/03 21:20:45
i'd swap them here, too
erikwright (departed)
2015/02/03 21:26:02
Ordered for consistency with the above.
If you co
| |
33 base::win::ScopedHandle* parent_process); | |
28 | 34 |
29 #endif // CHROME_APP_CHROME_WATCHER_COMMAND_LINE_WIN_H_ | 35 #endif // CHROME_APP_CHROME_WATCHER_COMMAND_LINE_WIN_H_ |
OLD | NEW |