OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 COMPONENTS_BROWSER_WATCHER_STABILITY_PATHS_H_ | 5 #ifndef COMPONENTS_BROWSER_WATCHER_STABILITY_PATHS_H_ |
6 #define COMPONENTS_BROWSER_WATCHER_STABILITY_PATHS_H_ | 6 #define COMPONENTS_BROWSER_WATCHER_STABILITY_PATHS_H_ |
7 | 7 |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/process/process.h" | 9 #include "base/process/process.h" |
| 10 #include "build/build_config.h" |
| 11 |
| 12 #if defined(OS_WIN) |
| 13 #include <winsock2.h> |
| 14 #endif // defined(OS_WIN) |
10 | 15 |
11 namespace browser_watcher { | 16 namespace browser_watcher { |
12 | 17 |
13 #if defined(OS_WIN) | 18 #if defined(OS_WIN) |
14 | 19 |
15 // Returns the the stability debugging directory. | 20 // Returns the stability debugging directory. |
16 base::FilePath GetStabilityDir(const base::FilePath& user_data_dir); | 21 base::FilePath GetStabilityDir(const base::FilePath& user_data_dir); |
17 | 22 |
18 // On success, |path| contains the path to the stability debugging information | 23 // Returns the stability debugging path, which is based on pid and creation time |
19 // file for |process|. | 24 // to ensure uniqueness in the face of pid recycling. |
| 25 base::FilePath GetStabilityFileForProcess(base::ProcessId pid, |
| 26 timeval creation_time, |
| 27 const base::FilePath& user_data_dir); |
| 28 |
| 29 // On success, returns true and |path| contains the path to the stability file. |
| 30 // On failure, returns false. |
20 bool GetStabilityFileForProcess(const base::Process& process, | 31 bool GetStabilityFileForProcess(const base::Process& process, |
21 const base::FilePath& user_data_dir, | 32 const base::FilePath& user_data_dir, |
22 base::FilePath* path); | 33 base::FilePath* path); |
23 | 34 |
24 // Returns a pattern that matches file names returned by GetFileForProcess. | 35 // Returns a pattern that matches file names returned by GetFileForProcess. |
25 base::FilePath::StringType GetStabilityFilePattern(); | 36 base::FilePath::StringType GetStabilityFilePattern(); |
26 | 37 |
27 // Marks the stability file for deletion. | 38 // Marks the stability file for deletion. |
28 void MarkStabilityFileForDeletion(const base::FilePath& user_data_dir); | 39 void MarkStabilityFileForDeletion(const base::FilePath& user_data_dir); |
29 | 40 |
30 #endif // defined(OS_WIN) | 41 #endif // defined(OS_WIN) |
31 | 42 |
32 } // namespace browser_watcher | 43 } // namespace browser_watcher |
33 | 44 |
34 #endif // COMPONENTS_BROWSER_WATCHER_STABILITY_PATHS_H_ | 45 #endif // COMPONENTS_BROWSER_WATCHER_STABILITY_PATHS_H_ |
OLD | NEW |