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 | 10 |
11 #if defined(OS_WIN) | |
Mark Mentovai
2017/05/04 16:47:10
You should #include "build/build_config.h" to succ
manzagop (departed)
2017/05/04 19:52:41
Done.
| |
12 #include <winsock2.h> | |
13 #endif // defined(OS_WIN) | |
14 | |
11 namespace browser_watcher { | 15 namespace browser_watcher { |
12 | 16 |
13 #if defined(OS_WIN) | 17 // Returns the stability debugging directory. |
Mark Mentovai
2017/05/04 16:47:10
You’re getting rid of these guards here in the hea
manzagop (departed)
2017/05/04 19:52:41
Yeah. The intent is for these to be cross-platform
| |
14 | |
15 // Returns the the stability debugging directory. | |
16 base::FilePath GetStabilityDir(const base::FilePath& user_data_dir); | 18 base::FilePath GetStabilityDir(const base::FilePath& user_data_dir); |
17 | 19 |
18 // On success, |path| contains the path to the stability debugging information | 20 // Returns the stability debugging path, which is based on pid and creation time |
19 // file for |process|. | 21 // to ensure unicity in the face of pid recycling. |
22 base::FilePath GetStabilityFileForProcess(base::ProcessId pid, | |
23 timeval creation_time, | |
24 const base::FilePath& user_data_dir); | |
25 | |
26 // On success, returns true and |path| contains the path to the stability file. | |
27 // On failure, returns false. | |
20 bool GetStabilityFileForProcess(const base::Process& process, | 28 bool GetStabilityFileForProcess(const base::Process& process, |
21 const base::FilePath& user_data_dir, | 29 const base::FilePath& user_data_dir, |
22 base::FilePath* path); | 30 base::FilePath* path); |
23 | 31 |
24 // Returns a pattern that matches file names returned by GetFileForProcess. | 32 // Returns a pattern that matches file names returned by GetFileForProcess. |
25 base::FilePath::StringType GetStabilityFilePattern(); | 33 base::FilePath::StringType GetStabilityFilePattern(); |
26 | 34 |
27 // Marks the stability file for deletion. | 35 // Marks the stability file for deletion. |
28 void MarkStabilityFileForDeletion(const base::FilePath& user_data_dir); | 36 void MarkStabilityFileForDeletion(const base::FilePath& user_data_dir); |
29 | 37 |
30 #endif // defined(OS_WIN) | |
31 | |
32 } // namespace browser_watcher | 38 } // namespace browser_watcher |
33 | 39 |
34 #endif // COMPONENTS_BROWSER_WATCHER_STABILITY_PATHS_H_ | 40 #endif // COMPONENTS_BROWSER_WATCHER_STABILITY_PATHS_H_ |
OLD | NEW |