OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CONTENT_BROWSER_MEDIA_WEBRTC_WEBRTC_EVENTLOG_HOST_H_ | |
6 #define CONTENT_BROWSER_MEDIA_WEBRTC_WEBRTC_EVENTLOG_HOST_H_ | |
7 | |
8 #include <set> | |
9 | |
10 #include "base/files/file_path.h" | |
11 #include "base/threading/thread_checker.h" | |
12 | |
13 namespace content { | |
14 | |
15 // This class is used to active and disable WebRTC event logs on each of the | |
16 // peer connections in the render process. To be able to do this, it needs to | |
17 // keep track of all the PeerConnections in the render process. | |
18 class WebRTCEventLogHost { | |
19 public: | |
20 explicit WebRTCEventLogHost(int render_process_id); | |
21 ~WebRTCEventLogHost(); | |
22 | |
23 // Starts an RTC event log for each peerconnection on the render process. | |
24 // A base file_path can be supplied, which will be extended to include several | |
25 // identifiers to ensure uniqueness. If a recording was already in progress, | |
26 // this call will return false and have no other effect. | |
27 bool StartWebRTCEventLog(const base::FilePath& file_path); | |
28 | |
29 // Stops recording an RTC event log for each peerconnection on the render | |
30 // process. If no recording was in progress, this call will return false. | |
31 bool StopWebRTCEventLog(); | |
32 | |
33 void PeerConnectionAdded(int connection_id); | |
Henrik Grunell
2016/05/24 13:31:59
Please comment on these functions too.
Ivo-OOO until feb 6
2016/05/25 14:57:00
Done.
| |
34 void PeerConnectionRemoved(int connection_id); | |
35 | |
36 private: | |
37 // The render process ID that this object is associated with. | |
38 const int render_process_id_; | |
39 | |
40 // In case new PeerConnections are created during logging, the path is needed | |
41 // to enable logging for them. | |
42 base::FilePath base_file_path_; | |
43 | |
44 // The local identifiers of all the currently active PeerConnections. | |
45 std::set<int> active_peer_connection_local_id_; | |
46 | |
47 // Number of active log files that have been opened. | |
48 int number_active_log_files_; | |
Henrik Grunell
2016/05/24 13:31:59
Can active_peer_connection_local_id_.size() be use
Ivo-OOO until feb 6
2016/05/25 14:57:00
That's an interesting question. Theoretically it c
| |
49 | |
50 bool is_rtc_event_logging_in_progress_; | |
51 | |
52 base::ThreadChecker thread_checker_; | |
53 }; | |
Henrik Grunell
2016/05/24 13:31:59
DISALLOW_COPY_AND_ASSIGN()
Ivo-OOO until feb 6
2016/05/25 14:57:00
Done.
| |
54 | |
55 } // namespace content | |
56 | |
57 #endif // CONTENT_BROWSER_MEDIA_WEBRTC_WEBRTC_EVENTLOG_HOST_H_ | |
OLD | NEW |