| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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 CHROMECAST_CRASH_LINUX_CRASH_TESTING_UTILS_H_ | 5 #ifndef CHROMECAST_CRASH_LINUX_CRASH_TESTING_UTILS_H_ |
| 6 #define CHROMECAST_CRASH_LINUX_CRASH_TESTING_UTILS_H_ | 6 #define CHROMECAST_CRASH_LINUX_CRASH_TESTING_UTILS_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
| 11 #include "base/time/time.h" |
| 11 | 12 |
| 12 namespace chromecast { | 13 namespace chromecast { |
| 13 | 14 |
| 14 class DumpInfo; | 15 class DumpInfo; |
| 15 | 16 |
| 16 // Creates a DumpInfo object corresponding to the deserialization of | 17 // Creates a DumpInfo object corresponding to the deserialization of |
| 17 // |json_string|. Returned DumpInfo object maybe invalid if |json_string| | 18 // |json_string|. Returned DumpInfo object maybe invalid if |json_string| |
| 18 // doesn't correspond to a valid DumpInfo object. | 19 // doesn't correspond to a valid DumpInfo object. |
| 19 std::unique_ptr<DumpInfo> CreateDumpInfo(const std::string& json_string); | 20 std::unique_ptr<DumpInfo> CreateDumpInfo(const std::string& json_string); |
| 20 | 21 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 35 // Appends serialization of |dump| onto the lockfile at |lockfile_path|. | 36 // Appends serialization of |dump| onto the lockfile at |lockfile_path|. |
| 36 // Creates default initialized lockfile in |lockfile_path| and metadata file in | 37 // Creates default initialized lockfile in |lockfile_path| and metadata file in |
| 37 // |metadata_path| if they don't exist. | 38 // |metadata_path| if they don't exist. |
| 38 // Returns true on success, false on error. | 39 // Returns true on success, false on error. |
| 39 bool AppendLockFile(const std::string& lockfile_path, | 40 bool AppendLockFile(const std::string& lockfile_path, |
| 40 const std::string& metadata_path, | 41 const std::string& metadata_path, |
| 41 const DumpInfo& dump); | 42 const DumpInfo& dump); |
| 42 | 43 |
| 43 // Set the ratelimit period start in the metadata file at |metadata_path| to | 44 // Set the ratelimit period start in the metadata file at |metadata_path| to |
| 44 // |start|. Returns true on success, false on error. | 45 // |start|. Returns true on success, false on error. |
| 45 bool SetRatelimitPeriodStart(const std::string& metadata_path, time_t start); | 46 bool SetRatelimitPeriodStart(const std::string& metadata_path, |
| 47 const base::Time& start); |
| 46 | 48 |
| 47 } // namespace chromecast | 49 } // namespace chromecast |
| 48 | 50 |
| 49 #endif // CHROMECAST_CRASH_LINUX_CRASH_TESTING_UTILS_H_ | 51 #endif // CHROMECAST_CRASH_LINUX_CRASH_TESTING_UTILS_H_ |
| OLD | NEW |