| 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" | 10 #include "build/build_config.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 | 28 |
| 29 // On success, returns true and |path| contains the path to the stability file. | 29 // On success, returns true and |path| contains the path to the stability file. |
| 30 // On failure, returns false. | 30 // On failure, returns false. |
| 31 bool GetStabilityFileForProcess(const base::Process& process, | 31 bool GetStabilityFileForProcess(const base::Process& process, |
| 32 const base::FilePath& user_data_dir, | 32 const base::FilePath& user_data_dir, |
| 33 base::FilePath* path); | 33 base::FilePath* path); |
| 34 | 34 |
| 35 // Returns a pattern that matches file names returned by GetFileForProcess. | 35 // Returns a pattern that matches file names returned by GetFileForProcess. |
| 36 base::FilePath::StringType GetStabilityFilePattern(); | 36 base::FilePath::StringType GetStabilityFilePattern(); |
| 37 | 37 |
| 38 // Marks the stability file for deletion. | 38 // Sets the current process's stability file's state to deleted (via the |
| 39 void MarkStabilityFileForDeletion(const base::FilePath& user_data_dir); | 39 // GlobalActivityTracker) and opens the file for deletion. Metrics pertaining to |
| 40 // stability recording are logged. |
| 41 void MarkOwnStabilityFileDeleted(const base::FilePath& user_data_dir); |
| 42 |
| 43 // Sets another process's stability file's state to deleted, then opens it for |
| 44 // deletion. This function is meant for use by the crashpad handler; it logs |
| 45 // metrics labelled as in the context of crash collection. |
| 46 void MarkStabilityFileDeletedOnCrash(const base::FilePath& file_path); |
| 40 | 47 |
| 41 #endif // defined(OS_WIN) | 48 #endif // defined(OS_WIN) |
| 42 | 49 |
| 43 } // namespace browser_watcher | 50 } // namespace browser_watcher |
| 44 | 51 |
| 45 #endif // COMPONENTS_BROWSER_WATCHER_STABILITY_PATHS_H_ | 52 #endif // COMPONENTS_BROWSER_WATCHER_STABILITY_PATHS_H_ |
| OLD | NEW |