Chromium Code Reviews| 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 835fbda0b0b5b8146812acb83f8fc585dc9a9f0f..2595e000c7b5e81d01d6387d3617befd6cc4d30e 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/browser/media/webrtc_rtp_dump_handler.h" |
| #include "chrome/common/media/webrtc_logging_message_data.h" |
| #include "content/public/browser/browser_message_filter.h" |
| #include "net/base/net_util.h" |
| @@ -51,16 +52,16 @@ class WebRtcLoggingHandlerHost : public content::BrowserMessageFilter { |
| // called. Must be called on the IO thread. |
| void StopLogging(const GenericDoneCallback& callback); |
| - // Uploads the log and discards the local copy. May only be called after |
| - // logging has stopped. Must be called on the IO thread. |
| + // Uploads the log and the RTP dumps. Discards the local copy. May only be |
| + // called after logging has stopped. Must be called on the IO thread. |
| void UploadLog(const UploadDoneCallback& callback); |
| // Called by WebRtcLogUploader when uploading has finished. Must be called on |
| // the IO thread. |
| void UploadLogDone(); |
| - // Discards the log. May only be called after logging has stopped. Must be |
| - // called on the IO thread. |
| + // Discards the log and the RTP dumps. May only be called after logging has |
| + // stopped. Must be called on the IO thread. |
| void DiscardLog(const GenericDoneCallback& callback); |
| // Adds a message to the log. |
| @@ -89,6 +90,12 @@ class WebRtcLoggingHandlerHost : public content::BrowserMessageFilter { |
| bool outgoing, |
| const GenericDoneCallback& callback); |
| + // Called when a RTP packet is sent or received. Can be called on any thread. |
|
Henrik Grunell
2014/05/13 09:12:31
Nit: an RTP packet.
jiayl
2014/05/13 21:48:17
Done.
|
| + void OnRtpPacket(const uint8* packet_header, |
| + size_t header_length, |
| + size_t packet_length, |
| + bool incoming); |
| + |
| private: |
| // States used for protecting from function calls made at non-allowed points |
| // in time. For example, StartLogging() is only allowed in CLOSED state. |
| @@ -140,12 +147,25 @@ class WebRtcLoggingHandlerHost : public content::BrowserMessageFilter { |
| // called on the FILE thread. |
| base::FilePath GetLogDirectoryAndEnsureExists(); |
| - void TriggerUploadLog(const base::FilePath& log_directory); |
| + void TriggerUploadLogAndRtpDump(const base::FilePath& log_directory); |
|
Henrik Grunell
2014/05/13 09:12:31
Maybe just TriggerUpload?
jiayl
2014/05/13 21:48:17
Done.
|
| void FireGenericDoneCallback(GenericDoneCallback* callback, |
| bool success, |
| const std::string& error_message); |
| + void CreateRtpDumpHandlerAndStart(bool incoming, |
|
Henrik Grunell
2014/05/13 09:12:31
I think comments on all added functions are good.
jiayl
2014/05/13 21:48:17
Done.
|
| + bool outgoing, |
| + GenericDoneCallback callback, |
| + const base::FilePath& dump_dir); |
| + |
| + void DoUpload(const base::FilePath& log_directory, |
|
Henrik Grunell
2014/05/13 09:12:31
What will this upload? Can the name be changed to
jiayl
2014/05/13 21:48:17
Done.
|
| + const WebRtcRtpDumpHandler::ReleasedDumps& rtp_dumps); |
| + |
| + void DumpRtpPacketOnIOThread(scoped_ptr<uint8[]> packet_header, |
| + size_t header_length, |
| + size_t packet_length, |
| + bool incoming); |
| + |
| scoped_ptr<unsigned char[]> log_buffer_; |
| scoped_ptr<PartialCircularBuffer> circular_buffer_; |
| @@ -180,6 +200,8 @@ class WebRtcLoggingHandlerHost : public content::BrowserMessageFilter { |
| // changes to STOPPED. |
| base::Time logging_started_time_; |
| + scoped_ptr<WebRtcRtpDumpHandler> rtp_dump_handler_; |
|
Henrik Grunell
2014/05/13 09:12:31
Add comment.
jiayl
2014/05/13 21:48:17
Done.
|
| + |
| DISALLOW_COPY_AND_ASSIGN(WebRtcLoggingHandlerHost); |
| }; |