Roll src/third_party/WebKit dbf9be3:8d6c3d5 (svn 202308:202312)
[chromium-blink-merge.git] / chrome / app / chrome_watcher_command_line_win.h
blobd4d4a97dba0b3e3ebf80b67c0302ed6e63225504
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_
8 #include <windows.h>
10 #include "base/win/scoped_handle.h"
12 namespace base {
13 class CommandLine;
14 class FilePath;
15 } // namespace base
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,
24 DWORD main_thread_id,
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_