1 // Copyright 2015 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_CHROME_WATCHER_CHROME_WATCHER_MAIN_API_H_
6 #define CHROME_CHROME_WATCHER_CHROME_WATCHER_MAIN_API_H_
9 #include "base/files/file_path.h"
10 #include "base/process/process_handle.h"
11 #include "base/strings/string16.h"
13 // The name of the watcher DLL.
14 extern const base::FilePath::CharType kChromeWatcherDll
[];
15 // The name of the watcher DLLs entrypoint function.
16 extern const char kChromeWatcherDLLEntrypoint
[];
17 // The subdirectory of the browser data directory where permanently failed crash
18 // reports will be stored.
19 extern const base::FilePath::CharType kPermanentlyFailedReportsSubdir
[];
21 // The type of the watcher DLL's main entry point.
22 // Watches |parent_process| and records its exit code under |registry_path| in
23 // HKCU. If SyzyASAN is enabled, a Kasko reporter process is also instantiated,
24 // using |browser_data_directory| to store crash reports. |on_initialized_event|
25 // will be signaled once the process is fully initialized. Takes ownership of
26 // |parent_process| and |on_initialized_event|.
27 typedef int (*ChromeWatcherMainFunction
)(
28 const base::char16
* registry_path
,
29 HANDLE parent_process
,
30 HANDLE on_initialized_event
,
31 const base::char16
* browser_data_directory
);
33 // Returns an RPC endpoint name for the identified client process. This method
34 // may be invoked in both the client and the watcher process with the PID of the
35 // client process to establish communication between the two using a common
37 base::string16
GetKaskoEndpoint(base::ProcessId client_process_id
);
39 #endif // CHROME_CHROME_WATCHER_CHROME_WATCHER_MAIN_API_H_