OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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 #include "content/browser/media/webrtc/webrtc_eventlog_host.h" | 5 #include "content/browser/media/webrtc/webrtc_eventlog_host.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 return IPC::TakePlatformFileForTransit(std::move(event_log_file)); | 60 return IPC::TakePlatformFileForTransit(std::move(event_log_file)); |
61 } | 61 } |
62 | 62 |
63 } // namespace | 63 } // namespace |
64 | 64 |
65 WebRTCEventLogHost::WebRTCEventLogHost(int render_process_id) | 65 WebRTCEventLogHost::WebRTCEventLogHost(int render_process_id) |
66 : render_process_id_(render_process_id), | 66 : render_process_id_(render_process_id), |
67 rtc_event_logging_enabled_(false), | 67 rtc_event_logging_enabled_(false), |
68 weak_ptr_factory_(this) { | 68 weak_ptr_factory_(this) { |
69 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 69 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
70 auto webrtc_internals = WebRTCInternals::GetInstance(); | 70 auto* webrtc_internals = WebRTCInternals::GetInstance(); |
71 if (webrtc_internals->IsEventLogRecordingsEnabled()) | 71 if (webrtc_internals->IsEventLogRecordingsEnabled()) |
72 StartWebRTCEventLog(webrtc_internals->GetEventLogFilePath()); | 72 StartWebRTCEventLog(webrtc_internals->GetEventLogFilePath()); |
73 } | 73 } |
74 | 74 |
75 WebRTCEventLogHost::~WebRTCEventLogHost() { | 75 WebRTCEventLogHost::~WebRTCEventLogHost() { |
76 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 76 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
77 } | 77 } |
78 | 78 |
79 void WebRTCEventLogHost::PeerConnectionAdded(int peer_connection_local_id) { | 79 void WebRTCEventLogHost::PeerConnectionAdded(int peer_connection_local_id) { |
80 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 80 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 if (rph) { | 150 if (rph) { |
151 rph->Send(new PeerConnectionTracker_StartEventLog(peer_connection_local_id, | 151 rph->Send(new PeerConnectionTracker_StartEventLog(peer_connection_local_id, |
152 file_for_transit)); | 152 file_for_transit)); |
153 } else { | 153 } else { |
154 --number_active_log_files_; | 154 --number_active_log_files_; |
155 IPC::PlatformFileForTransitToFile(file_for_transit).Close(); | 155 IPC::PlatformFileForTransitToFile(file_for_transit).Close(); |
156 } | 156 } |
157 } | 157 } |
158 | 158 |
159 } // namespace content | 159 } // namespace content |
OLD | NEW |