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. | |
vrk (LEFT CHROMIUM)
2014/05/02 18:13:48
nit: expand comment to explain the parameters.
jiayl
2014/05/02 21:22:43
Done.
| |
78 void StartRtpDump(bool incoming, | |
79 bool outgoing, | |
80 const GenericDoneCallback& callback); | |
81 | |
82 // Stops dumping the RTP headers for the specified direction. Must be called | |
83 // on the IO thread. | |
vrk (LEFT CHROMIUM)
2014/05/02 18:13:48
nit: expand comment to explain the parameters.
jiayl
2014/05/02 21:22:43
Done.
| |
84 void StopRtpDump(bool incoming, | |
85 bool outgoing, | |
86 const GenericDoneCallback& callback); | |
87 | |
76 private: | 88 private: |
77 // States used for protecting from function calls made at non-allowed points | 89 // States used for protecting from function calls made at non-allowed points |
78 // in time. For example, StartLogging() is only allowed in CLOSED state. | 90 // in time. For example, StartLogging() is only allowed in CLOSED state. |
79 // Transitions: SetMetaData(): CLOSED -> CLOSED. | 91 // Transitions: SetMetaData(): CLOSED -> CLOSED. |
80 // StartLogging(): CLOSED -> STARTING. | 92 // StartLogging(): CLOSED -> STARTING. |
81 // Start done: STARTING -> STARTED. | 93 // Start done: STARTING -> STARTED. |
82 // StopLogging(): STARTED -> STOPPING. | 94 // StopLogging(): STARTED -> STOPPING. |
83 // Stop done: STOPPING -> STOPPED. | 95 // Stop done: STOPPING -> STOPPED. |
84 // UploadLog(): STOPPED -> UPLOADING. | 96 // UploadLog(): STOPPED -> UPLOADING. |
85 // Upload done: UPLOADING -> CLOSED. | 97 // Upload done: UPLOADING -> CLOSED. |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
161 base::SharedMemoryHandle foreign_memory_handle_; | 173 base::SharedMemoryHandle foreign_memory_handle_; |
162 | 174 |
163 // The system time in ms when logging is started. Reset when logging_state_ | 175 // The system time in ms when logging is started. Reset when logging_state_ |
164 // changes to STOPPED. | 176 // changes to STOPPED. |
165 base::Time logging_started_time_; | 177 base::Time logging_started_time_; |
166 | 178 |
167 DISALLOW_COPY_AND_ASSIGN(WebRtcLoggingHandlerHost); | 179 DISALLOW_COPY_AND_ASSIGN(WebRtcLoggingHandlerHost); |
168 }; | 180 }; |
169 | 181 |
170 #endif // CHROME_BROWSER_MEDIA_WEBRTC_LOGGING_HANDLER_HOST_H_ | 182 #endif // CHROME_BROWSER_MEDIA_WEBRTC_LOGGING_HANDLER_HOST_H_ |
OLD | NEW |