manzagop | f232266 | 2016-09-27 11:39:59 | [diff] [blame] | 1 | // Copyright 2016 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. |
| 4 | |
manzagop | 6d14991 | 2016-12-19 20:17:09 | [diff] [blame] | 5 | #ifndef COMPONENTS_BROWSER_WATCHER_STABILITY_DEBUGGING_H_ |
| 6 | #define COMPONENTS_BROWSER_WATCHER_STABILITY_DEBUGGING_H_ |
| 7 | |
| 8 | #include <stdint.h> |
manzagop | f232266 | 2016-09-27 11:39:59 | [diff] [blame] | 9 | |
| 10 | #include "base/files/file_path.h" |
| 11 | #include "base/gtest_prod_util.h" |
| 12 | #include "base/process/process.h" |
manzagop | 6d14991 | 2016-12-19 20:17:09 | [diff] [blame] | 13 | #include "base/strings/string_piece.h" |
manzagop | f232266 | 2016-09-27 11:39:59 | [diff] [blame] | 14 | |
| 15 | namespace browser_watcher { |
| 16 | |
manzagop | 6d14991 | 2016-12-19 20:17:09 | [diff] [blame] | 17 | #if defined(OS_WIN) |
| 18 | |
manzagop | f232266 | 2016-09-27 11:39:59 | [diff] [blame] | 19 | // Returns the the stability debugging directory. |
| 20 | base::FilePath GetStabilityDir(const base::FilePath& user_data_dir); |
| 21 | |
| 22 | // On success, |path| contains the path to the stability debugging information |
| 23 | // file for |process|. |
| 24 | bool GetStabilityFileForProcess(const base::Process& process, |
| 25 | const base::FilePath& user_data_dir, |
| 26 | base::FilePath* path); |
| 27 | |
| 28 | // Returns a pattern that matches file names returned by GetFileForProcess. |
| 29 | base::FilePath::StringType GetStabilityFilePattern(); |
| 30 | |
manzagop | 14aff5d | 2016-11-23 17:27:00 | [diff] [blame] | 31 | // Marks the stability file for deletion. |
| 32 | void MarkStabilityFileForDeletion(const base::FilePath& user_data_dir); |
| 33 | |
manzagop | 6d14991 | 2016-12-19 20:17:09 | [diff] [blame] | 34 | #endif // defined(OS_WIN) |
| 35 | |
| 36 | // Adds or updates the global stability user data. |
| 37 | void SetStabilityDataInt(base::StringPiece name, int64_t value); |
| 38 | |
manzagop | f232266 | 2016-09-27 11:39:59 | [diff] [blame] | 39 | } // namespace browser_watcher |
| 40 | |
manzagop | 6d14991 | 2016-12-19 20:17:09 | [diff] [blame] | 41 | #endif // COMPONENTS_BROWSER_WATCHER_STABILITY_DEBUGGING_H_ |