| 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 "base/memory/scoped_ptr.h" | 8 #include <memory> |
| 9 |
| 9 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
| 10 | 11 |
| 11 namespace chromecast { | 12 namespace chromecast { |
| 12 | 13 |
| 13 class DumpInfo; | 14 class DumpInfo; |
| 14 | 15 |
| 15 // Creates a DumpInfo object corresponding to the deserialization of | 16 // Creates a DumpInfo object corresponding to the deserialization of |
| 16 // |json_string|. Returned DumpInfo object maybe invalid if |json_string| | 17 // |json_string|. Returned DumpInfo object maybe invalid if |json_string| |
| 17 // doesn't correspond to a valid DumpInfo object. | 18 // doesn't correspond to a valid DumpInfo object. |
| 18 scoped_ptr<DumpInfo> CreateDumpInfo(const std::string& json_string); | 19 std::unique_ptr<DumpInfo> CreateDumpInfo(const std::string& json_string); |
| 19 | 20 |
| 20 // Populates |dumps| with all the DumpInfo entries serialized in the lockfile at | 21 // Populates |dumps| with all the DumpInfo entries serialized in the lockfile at |
| 21 // |lockfile_path|. Returns true on success, false on error. | 22 // |lockfile_path|. Returns true on success, false on error. |
| 22 bool FetchDumps(const std::string& lockfile_path, | 23 bool FetchDumps(const std::string& lockfile_path, |
| 23 ScopedVector<DumpInfo>* dumps); | 24 ScopedVector<DumpInfo>* dumps); |
| 24 | 25 |
| 25 // Clear all dumps in the lockfile at |lockfile_path|. | 26 // Clear all dumps in the lockfile at |lockfile_path|. |
| 26 // Returns true on success, false on error. | 27 // Returns true on success, false on error. |
| 27 bool ClearDumps(const std::string& lockfile_path); | 28 bool ClearDumps(const std::string& lockfile_path); |
| 28 | 29 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 39 const std::string& metadata_path, | 40 const std::string& metadata_path, |
| 40 const DumpInfo& dump); | 41 const DumpInfo& dump); |
| 41 | 42 |
| 42 // Set the ratelimit period start in the metadata file at |metadata_path| to | 43 // Set the ratelimit period start in the metadata file at |metadata_path| to |
| 43 // |start|. Returns true on success, false on error. | 44 // |start|. Returns true on success, false on error. |
| 44 bool SetRatelimitPeriodStart(const std::string& metadata_path, time_t start); | 45 bool SetRatelimitPeriodStart(const std::string& metadata_path, time_t start); |
| 45 | 46 |
| 46 } // namespace chromecast | 47 } // namespace chromecast |
| 47 | 48 |
| 48 #endif // CHROMECAST_CRASH_LINUX_CRASH_TESTING_UTILS_H_ | 49 #endif // CHROMECAST_CRASH_LINUX_CRASH_TESTING_UTILS_H_ |
| OLD | NEW |