Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2341)

Unified Diff: chrome/browser/media/webrtc_logging_handler_host.h

Issue 218403004: Fix the timestamp generation for webrtc native log. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/media/webrtc_logging_handler_host.h
diff --git a/chrome/browser/media/webrtc_logging_handler_host.h b/chrome/browser/media/webrtc_logging_handler_host.h
index 864498637cb45797ed949e77cfe6270dfaf6569b..1c505ad09fb566158ceabc49bfa9c58ac9e75e43 100644
--- a/chrome/browser/media/webrtc_logging_handler_host.h
+++ b/chrome/browser/media/webrtc_logging_handler_host.h
@@ -7,6 +7,7 @@
#include "base/basictypes.h"
#include "base/memory/shared_memory.h"
+#include "chrome/common/media/webrtc_logging_messages.h"
#include "content/public/browser/browser_message_filter.h"
#include "net/base/net_util.h"
@@ -104,11 +105,12 @@ class WebRtcLoggingHandlerHost : public content::BrowserMessageFilter {
bool* message_was_ok) OVERRIDE;
// Handles log message requests from renderer process.
- void OnAddLogMessage(const std::string& message);
+ void OnAddLogMessages(const std::vector<WebRtcLoggingMessage>& messages);
void OnLoggingStoppedInRenderer();
// Handles log message requests from browser process.
- void AddLogMessageFromBrowser(const std::string& message);
+ void AddLogMessageFromBrowser(uint64 timestamp_ms,
+ const std::string& message);
void StartLoggingIfAllowed();
void DoStartLogging();
@@ -129,6 +131,9 @@ class WebRtcLoggingHandlerHost : public content::BrowserMessageFilter {
bool success,
const std::string& error_message);
+ std::string FormatMessageWithTimestamp(uint64 msg_created_time_ms,
+ const std::string& message);
+
scoped_ptr<unsigned char[]> log_buffer_;
scoped_ptr<PartialCircularBuffer> circular_buffer_;
@@ -159,6 +164,10 @@ class WebRtcLoggingHandlerHost : public content::BrowserMessageFilter {
// It's only accessed on the IO thread.
base::SharedMemoryHandle foreign_memory_handle_;
+ // The system time in ms when logging is started. Reset when logging_state_
+ // changes to STOPPED.
+ uint64 logging_started_time_ms_;
+
DISALLOW_COPY_AND_ASSIGN(WebRtcLoggingHandlerHost);
};

Powered by Google App Engine
This is Rietveld 408576698