Send a crash report when a hung process is detected.
[chromium-blink-merge.git] / chrome / chrome_watcher / chrome_watcher_main_api.h
blobd070a577770d3c912c7f21f1ab68a7ce973dbddf
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_
8 #include <Windows.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. A window named |message_window_name|, owned by |parent_process|, will
24 // be monitored for responsiveness. If SyzyASAN is enabled, a Kasko reporter
25 // process is also instantiated, using |browser_data_directory| to store crash
26 // reports. |on_initialized_event| will be signaled once the watcher process is
27 // fully initialized. Takes ownership of |parent_process| and
28 // |on_initialized_event|.
29 // |channel_name| is the current Chrome distribution channel (one of
30 // installer::kChromeChannelXXX).
31 typedef int (*ChromeWatcherMainFunction)(
32 const base::char16* registry_path,
33 HANDLE parent_process,
34 HANDLE on_initialized_event,
35 const base::char16* browser_data_directory,
36 const base::char16* message_window_name,
37 const base::char16* channel_name);
39 // Returns an RPC endpoint name for the identified client process. This method
40 // may be invoked in both the client and the watcher process with the PID of the
41 // client process to establish communication between the two using a common
42 // endpoint name.
43 base::string16 GetKaskoEndpoint(base::ProcessId client_process_id);
45 #endif // CHROME_CHROME_WATCHER_CHROME_WATCHER_MAIN_API_H_