| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 | 33 |
| 34 enum PacketDirection { kIncomingPacket = 0, kOutgoingPacket }; | 34 enum PacketDirection { kIncomingPacket = 0, kOutgoingPacket }; |
| 35 | 35 |
| 36 class RtcEventLog { | 36 class RtcEventLog { |
| 37 public: | 37 public: |
| 38 virtual ~RtcEventLog() {} | 38 virtual ~RtcEventLog() {} |
| 39 | 39 |
| 40 // Factory method to create an RtcEventLog object. | 40 // Factory method to create an RtcEventLog object. |
| 41 static std::unique_ptr<RtcEventLog> Create(const Clock* clock); | 41 static std::unique_ptr<RtcEventLog> Create(const Clock* clock); |
| 42 | 42 |
| 43 // Create an RtcEventLog object that does nothing. | |
| 44 static std::unique_ptr<RtcEventLog> CreateNull(); | |
| 45 | |
| 46 // Starts logging a maximum of max_size_bytes bytes to the specified file. | 43 // Starts logging a maximum of max_size_bytes bytes to the specified file. |
| 47 // If the file already exists it will be overwritten. | 44 // If the file already exists it will be overwritten. |
| 48 // If max_size_bytes <= 0, logging will be active until StopLogging is called. | 45 // If max_size_bytes <= 0, logging will be active until StopLogging is called. |
| 49 // The function has no effect and returns false if we can't start a new log | 46 // The function has no effect and returns false if we can't start a new log |
| 50 // e.g. because we are already logging or the file cannot be opened. | 47 // e.g. because we are already logging or the file cannot be opened. |
| 51 virtual bool StartLogging(const std::string& file_name, | 48 virtual bool StartLogging(const std::string& file_name, |
| 52 int64_t max_size_bytes) = 0; | 49 int64_t max_size_bytes) = 0; |
| 53 | 50 |
| 54 // Same as above. The RtcEventLog takes ownership of the file if the call | 51 // Same as above. The RtcEventLog takes ownership of the file if the call |
| 55 // is successful, i.e. if it returns true. | 52 // is successful, i.e. if it returns true. |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 // configurations, then the remaining events in timestamp order and finally | 102 // configurations, then the remaining events in timestamp order and finally |
| 106 // a LOG_END event. However, this might change without further notice. | 103 // a LOG_END event. However, this might change without further notice. |
| 107 // TODO(terelius): Change result type to a vector? | 104 // TODO(terelius): Change result type to a vector? |
| 108 static bool ParseRtcEventLog(const std::string& file_name, | 105 static bool ParseRtcEventLog(const std::string& file_name, |
| 109 rtclog::EventStream* result); | 106 rtclog::EventStream* result); |
| 110 }; | 107 }; |
| 111 | 108 |
| 112 } // namespace webrtc | 109 } // namespace webrtc |
| 113 | 110 |
| 114 #endif // WEBRTC_CALL_RTC_EVENT_LOG_H_ | 111 #endif // WEBRTC_CALL_RTC_EVENT_LOG_H_ |
| OLD | NEW |