Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: content/browser/media/webrtc/webrtc_eventlog_callback_handler.cc

Issue 1855193002: Move the call to enable the WebRTC event log from PeerConnectionFactory to PeerConnection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed content/public/ interface, used RenderProcessHost instead. Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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 #include "content/browser/media/webrtc/webrtc_eventlog_callback_handler.h"
6
7 namespace content {
8
9 WebRTCEventLogCallbackHandler::WebRTCEventLogCallbackHandler() {}
10
11 WebRTCEventLogCallbackHandler::~WebRTCEventLogCallbackHandler() {}
12
13 void WebRTCEventLogCallbackHandler::RegisterEventLogHandler(
14 const EventLogStartFunc& start_logging_callback,
15 const EventLogStopFunc& stop_logging_callback) {
16 eventlog_start_fn_ = start_logging_callback;
17 eventlog_stop_fn_ = stop_logging_callback;
18 }
19
20 void WebRTCEventLogCallbackHandler::RegisterPeerConnectionCallbacks(
21 const PeerConnectionAddedFunc& pc_added_callback,
22 const PeerConnectionRemovedFunc& pc_removed_callback) {
23 peerconnection_added_fn_.push_back(pc_added_callback);
24 peerconnection_removed_fn_.push_back(pc_removed_callback);
25 }
26
27 void WebRTCEventLogCallbackHandler::PeerConnectionAdded(int connection_id) {
28 for (auto& pc_added : peerconnection_added_fn_) {
29 pc_added.Run(connection_id);
30 }
31 }
32
33 void WebRTCEventLogCallbackHandler::PeerConnectionRemoved(int connection_id) {
34 for (auto& pc_removed : peerconnection_removed_fn_) {
35 pc_removed.Run(connection_id);
36 }
37 }
38
39 void WebRTCEventLogCallbackHandler::StartEventLog(
40 const base::FilePath& file_path) {
41 if (eventlog_start_fn_) {
42 eventlog_start_fn_.value().Run(file_path);
43 }
44 }
45
46 void WebRTCEventLogCallbackHandler::StopEventLog() {
47 if (eventlog_stop_fn_) {
48 eventlog_stop_fn_.value().Run();
49 }
50 }
51
52 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698