| Index: trunk/src/chrome/browser/media/webrtc_logging_handler_host.h
|
| ===================================================================
|
| --- trunk/src/chrome/browser/media/webrtc_logging_handler_host.h (revision 273764)
|
| +++ trunk/src/chrome/browser/media/webrtc_logging_handler_host.h (working copy)
|
| @@ -7,11 +7,8 @@
|
|
|
| #include "base/basictypes.h"
|
| #include "base/memory/shared_memory.h"
|
| -#include "chrome/browser/media/rtp_dump_type.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 "content/public/browser/render_process_host.h"
|
| #include "net/base/net_util.h"
|
|
|
| namespace net {
|
| @@ -20,6 +17,7 @@
|
|
|
| class PartialCircularBuffer;
|
| class Profile;
|
| +class RenderProcessHost;
|
|
|
| typedef std::map<std::string, std::string> MetaDataMap;
|
|
|
| @@ -53,16 +51,16 @@
|
| // called. Must be called on the IO thread.
|
| void StopLogging(const GenericDoneCallback& callback);
|
|
|
| - // 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.
|
| + // Uploads the log and 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 and the RTP dumps. May only be called after logging has
|
| - // stopped. Must be called on the IO thread.
|
| + // Discards the log. 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.
|
| @@ -76,27 +74,21 @@
|
| }
|
|
|
| // Starts dumping the RTP headers for the specified direction. Must be called
|
| - // on the IO thread. |type| specifies which direction(s) of RTP packets should
|
| - // be dumped. |callback| will be called when starting the dump is done.
|
| - // |stop_callback| will be called when StopRtpDump is called.
|
| - void StartRtpDump(RtpDumpType type,
|
| - const GenericDoneCallback& callback,
|
| - const content::RenderProcessHost::WebRtcStopRtpDumpCallback&
|
| - stop_callback);
|
| + // on the IO thread. |incoming| and |outgoing| specifies which direction(s) of
|
| + // RTP packets should be dumped. |callback| will be called when starting the
|
| + // dump is done.
|
| + void StartRtpDump(bool incoming,
|
| + bool outgoing,
|
| + const GenericDoneCallback& callback);
|
|
|
| // Stops dumping the RTP headers for the specified direction. Must be called
|
| - // on the IO thread. |type| specifies which direction(s) of RTP packet dumping
|
| - // should be stopped. |callback| will be called when stopping the dump is
|
| - // done.
|
| - void StopRtpDump(RtpDumpType type, const GenericDoneCallback& callback);
|
| + // on the IO thread. |incoming| and |outgoing| specifies which direction(s) of
|
| + // RTP packet dumping should be stopped. |callback| will be called when
|
| + // stopping the dump is done.
|
| + void StopRtpDump(bool incoming,
|
| + bool outgoing,
|
| + const GenericDoneCallback& callback);
|
|
|
| - // Called when an RTP packet is sent or received. Must be called on the UI
|
| - // thread.
|
| - 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.
|
| @@ -147,31 +139,12 @@
|
| // called on the FILE thread.
|
| base::FilePath GetLogDirectoryAndEnsureExists();
|
|
|
| - void TriggerUpload(const base::FilePath& log_directory);
|
| + void TriggerUploadLog(const base::FilePath& log_directory);
|
|
|
| - // A helper for TriggerUpload to do the real work.
|
| - void DoUploadLogAndRtpDumps(const base::FilePath& log_directory);
|
| -
|
| void FireGenericDoneCallback(GenericDoneCallback* callback,
|
| bool success,
|
| const std::string& error_message);
|
|
|
| - // Create the RTP dump handler and start dumping. Must be called after making
|
| - // sure the log directory exists.
|
| - void CreateRtpDumpHandlerAndStart(RtpDumpType type,
|
| - GenericDoneCallback callback,
|
| - const base::FilePath& dump_dir);
|
| -
|
| - // A helper for starting RTP dump assuming the RTP dump handler has been
|
| - // created.
|
| - void DoStartRtpDump(RtpDumpType type, GenericDoneCallback* callback);
|
| -
|
| - // Adds the packet to the dump on IO thread.
|
| - 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_;
|
|
|
| @@ -206,12 +179,6 @@
|
| // changes to STOPPED.
|
| base::Time logging_started_time_;
|
|
|
| - // The RTP dump handler responsible for creating the RTP header dump files.
|
| - scoped_ptr<WebRtcRtpDumpHandler> rtp_dump_handler_;
|
| -
|
| - // The callback to call when StopRtpDump is called.
|
| - content::RenderProcessHost::WebRtcStopRtpDumpCallback stop_rtp_dump_callback_;
|
| -
|
| DISALLOW_COPY_AND_ASSIGN(WebRtcLoggingHandlerHost);
|
| };
|
|
|
|
|