OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_MEDIA_WEBRTC_LOGGING_HANDLER_HOST_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_WEBRTC_LOGGING_HANDLER_HOST_H_ |
6 #define CHROME_BROWSER_MEDIA_WEBRTC_LOGGING_HANDLER_HOST_H_ | 6 #define CHROME_BROWSER_MEDIA_WEBRTC_LOGGING_HANDLER_HOST_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/shared_memory.h" | 9 #include "base/memory/shared_memory.h" |
10 #include "chrome/common/media/webrtc_logging_message_data.h" | 10 #include "chrome/common/media/webrtc_logging_message_data.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 // Adds a message to the log. | 66 // Adds a message to the log. |
67 void LogMessage(const std::string& message); | 67 void LogMessage(const std::string& message); |
68 | 68 |
69 // May be called on any thread. |upload_log_on_render_close_| is used | 69 // May be called on any thread. |upload_log_on_render_close_| is used |
70 // for decision making and it's OK if it changes before the execution based | 70 // for decision making and it's OK if it changes before the execution based |
71 // on that decision has finished. | 71 // on that decision has finished. |
72 void set_upload_log_on_render_close(bool should_upload) { | 72 void set_upload_log_on_render_close(bool should_upload) { |
73 upload_log_on_render_close_ = should_upload; | 73 upload_log_on_render_close_ = should_upload; |
74 } | 74 } |
75 | 75 |
| 76 // Starts dumping the RTP headers for the specified direction. Must be called |
| 77 // on the IO thread. |incoming| and |outgoing| specifies which direction(s) of |
| 78 // RTP packets should be dumped. |callback| will be called when starting the |
| 79 // dump is done. |
| 80 void StartRtpDump(bool incoming, |
| 81 bool outgoing, |
| 82 const GenericDoneCallback& callback); |
| 83 |
| 84 // Stops dumping the RTP headers for the specified direction. Must be called |
| 85 // on the IO thread. |incoming| and |outgoing| specifies which direction(s) of |
| 86 // RTP packet dumping should be stopped. |callback| will be called when |
| 87 // stopping the dump is done. |
| 88 void StopRtpDump(bool incoming, |
| 89 bool outgoing, |
| 90 const GenericDoneCallback& callback); |
| 91 |
76 private: | 92 private: |
77 // States used for protecting from function calls made at non-allowed points | 93 // States used for protecting from function calls made at non-allowed points |
78 // in time. For example, StartLogging() is only allowed in CLOSED state. | 94 // in time. For example, StartLogging() is only allowed in CLOSED state. |
79 // Transitions: SetMetaData(): CLOSED -> CLOSED. | 95 // Transitions: SetMetaData(): CLOSED -> CLOSED. |
80 // StartLogging(): CLOSED -> STARTING. | 96 // StartLogging(): CLOSED -> STARTING. |
81 // Start done: STARTING -> STARTED. | 97 // Start done: STARTING -> STARTED. |
82 // StopLogging(): STARTED -> STOPPING. | 98 // StopLogging(): STARTED -> STOPPING. |
83 // Stop done: STOPPING -> STOPPED. | 99 // Stop done: STOPPING -> STOPPED. |
84 // UploadLog(): STOPPED -> UPLOADING. | 100 // UploadLog(): STOPPED -> UPLOADING. |
85 // Upload done: UPLOADING -> CLOSED. | 101 // Upload done: UPLOADING -> CLOSED. |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 base::SharedMemoryHandle foreign_memory_handle_; | 177 base::SharedMemoryHandle foreign_memory_handle_; |
162 | 178 |
163 // The system time in ms when logging is started. Reset when logging_state_ | 179 // The system time in ms when logging is started. Reset when logging_state_ |
164 // changes to STOPPED. | 180 // changes to STOPPED. |
165 base::Time logging_started_time_; | 181 base::Time logging_started_time_; |
166 | 182 |
167 DISALLOW_COPY_AND_ASSIGN(WebRtcLoggingHandlerHost); | 183 DISALLOW_COPY_AND_ASSIGN(WebRtcLoggingHandlerHost); |
168 }; | 184 }; |
169 | 185 |
170 #endif // CHROME_BROWSER_MEDIA_WEBRTC_LOGGING_HANDLER_HOST_H_ | 186 #endif // CHROME_BROWSER_MEDIA_WEBRTC_LOGGING_HANDLER_HOST_H_ |
OLD | NEW |