Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / media / webrtc_logging_handler_host.h
index 8644986..835fbda 100644 (file)
@@ -7,6 +7,7 @@
 
 #include "base/basictypes.h"
 #include "base/memory/shared_memory.h"
+#include "chrome/common/media/webrtc_logging_message_data.h"
 #include "content/public/browser/browser_message_filter.h"
 #include "net/base/net_util.h"
 
@@ -72,6 +73,22 @@ class WebRtcLoggingHandlerHost : public content::BrowserMessageFilter {
     upload_log_on_render_close_ = should_upload;
   }
 
+  // Starts dumping the RTP headers for the specified direction. Must be called
+  // 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. |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);
+
  private:
   // States used for protecting from function calls made at non-allowed points
   // in time. For example, StartLogging() is only allowed in CLOSED state.
@@ -104,11 +121,11 @@ 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<WebRtcLoggingMessageData>& messages);
   void OnLoggingStoppedInRenderer();
 
   // Handles log message requests from browser process.
-  void AddLogMessageFromBrowser(const std::string& message);
+  void AddLogMessageFromBrowser(const WebRtcLoggingMessageData& message);
 
   void StartLoggingIfAllowed();
   void DoStartLogging();
@@ -159,6 +176,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.
+  base::Time logging_started_time_;
+
   DISALLOW_COPY_AND_ASSIGN(WebRtcLoggingHandlerHost);
 };