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
3 // found in the LICENSE file.
5 #ifndef CHROME_APP_CHROME_WATCHER_COMMAND_LINE_WIN_H_
6 #define CHROME_APP_CHROME_WATCHER_COMMAND_LINE_WIN_H_
10 #include "base/win/scoped_handle.h"
17 // Generates a CommandLine that will launch |chrome_exe| in Chrome Watcher mode
18 // to observe |parent_process|, whose main thread is identified by
19 // |main_thread_id|. The watcher process will signal |on_initialized_event| when
20 // its initialization is complete.
21 base::CommandLine
GenerateChromeWatcherCommandLine(
22 const base::FilePath
& chrome_exe
,
23 HANDLE parent_process
,
25 HANDLE on_initialized_event
);
27 // Interprets the Command Line used to launch a Chrome Watcher process and
28 // extracts the parent process and initialization event HANDLEs and the parent
29 // process main thread ID. Verifies that the handles are usable in this process
30 // before returning them. Returns true if all parameters are successfully parsed
31 // and false otherwise. In case of partial failure, any successfully parsed
32 // HANDLEs will be closed.
33 bool InterpretChromeWatcherCommandLine(
34 const base::CommandLine
& command_line
,
35 base::win::ScopedHandle
* parent_process
,
36 DWORD
* main_thread_id
,
37 base::win::ScopedHandle
* on_initialized_event
);
39 #endif // CHROME_APP_CHROME_WATCHER_COMMAND_LINE_WIN_H_