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

Side by Side Diff: content/browser/media/webrtc/webrtc_internals.h

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: Merge with existing WebRtcEventLogHandler. 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
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 CONTENT_BROWSER_MEDIA_WEBRTC_WEBRTC_INTERNALS_H_ 5 #ifndef CONTENT_BROWSER_MEDIA_WEBRTC_WEBRTC_INTERNALS_H_
6 #define CONTENT_BROWSER_MEDIA_WEBRTC_WEBRTC_INTERNALS_H_ 6 #define CONTENT_BROWSER_MEDIA_WEBRTC_WEBRTC_INTERNALS_H_
7 7
8 #include <map>
8 #include <memory> 9 #include <memory>
9 #include <queue> 10 #include <queue>
10 11
12 #include "base/callback_forward.h"
11 #include "base/containers/hash_tables.h" 13 #include "base/containers/hash_tables.h"
12 #include "base/gtest_prod_util.h" 14 #include "base/gtest_prod_util.h"
13 #include "base/lazy_instance.h" 15 #include "base/lazy_instance.h"
14 #include "base/memory/weak_ptr.h" 16 #include "base/memory/weak_ptr.h"
15 #include "base/observer_list.h" 17 #include "base/observer_list.h"
16 #include "base/process/process.h" 18 #include "base/process/process.h"
17 #include "base/threading/thread_checker.h" 19 #include "base/threading/thread_checker.h"
18 #include "base/values.h" 20 #include "base/values.h"
19 #include "content/common/content_export.h" 21 #include "content/common/content_export.h"
20 #include "content/public/browser/render_process_host_observer.h" 22 #include "content/public/browser/render_process_host_observer.h"
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 void EnableAudioDebugRecordings(content::WebContents* web_contents); 97 void EnableAudioDebugRecordings(content::WebContents* web_contents);
96 void DisableAudioDebugRecordings(); 98 void DisableAudioDebugRecordings();
97 99
98 bool IsAudioDebugRecordingsEnabled() const; 100 bool IsAudioDebugRecordingsEnabled() const;
99 const base::FilePath& GetAudioDebugRecordingsFilePath() const; 101 const base::FilePath& GetAudioDebugRecordingsFilePath() const;
100 102
101 // Enables or disables diagnostic event log. 103 // Enables or disables diagnostic event log.
102 void SetEventLogRecordings(bool enable, content::WebContents* web_contents); 104 void SetEventLogRecordings(bool enable, content::WebContents* web_contents);
103 105
104 bool IsEventLogRecordingsEnabled() const; 106 bool IsEventLogRecordingsEnabled() const;
105 const base::FilePath& GetEventLogRecordingsFilePath() const; 107
108 // Register functions to handle starting and stopping the WebRTC event log
109 // functionality from the chrome://webrtc-internals page.
110 typedef base::Callback<void(const base::FilePath&)> event_log_start_func;
111 typedef base::Callback<void()> event_log_stop_func;
dcheng 2016/05/10 06:48:17 Nit: Prefer using to typedef. Also TypeNamesAreWri
Ivo-OOO until feb 6 2016/05/12 13:23:24 Done.
112 void RegisterEventLogHandler(int render_process_id,
113 event_log_start_func start_logging_callback,
114 event_log_stop_func stop_logging_callback);
106 115
107 protected: 116 protected:
108 // Constructor/Destructor are protected to allow tests to derive from the 117 // Constructor/Destructor are protected to allow tests to derive from the
109 // class and do per-instance testing without having to use the global 118 // class and do per-instance testing without having to use the global
110 // instance. 119 // instance.
111 // The default ctor sets |aggregate_updates_ms| to 500ms. 120 // The default ctor sets |aggregate_updates_ms| to 500ms.
112 WebRTCInternals(); 121 WebRTCInternals();
113 explicit WebRTCInternals(int aggregate_updates_ms); 122 explicit WebRTCInternals(int aggregate_updates_ms);
114 ~WebRTCInternals() override; 123 ~WebRTCInternals() override;
115 124
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 // For managing select file dialog. 199 // For managing select file dialog.
191 scoped_refptr<ui::SelectFileDialog> select_file_dialog_; 200 scoped_refptr<ui::SelectFileDialog> select_file_dialog_;
192 201
193 // Diagnostic audio recording state. 202 // Diagnostic audio recording state.
194 bool audio_debug_recordings_; 203 bool audio_debug_recordings_;
195 base::FilePath audio_debug_recordings_file_path_; 204 base::FilePath audio_debug_recordings_file_path_;
196 205
197 // Diagnostic event log recording state. 206 // Diagnostic event log recording state.
198 bool event_log_recordings_; 207 bool event_log_recordings_;
199 bool selecting_event_log_; 208 bool selecting_event_log_;
209 int number_event_log_files_;
200 base::FilePath event_log_recordings_file_path_; 210 base::FilePath event_log_recordings_file_path_;
211 std::map<int, std::pair<event_log_start_func, event_log_stop_func>>
212 event_log_handlers;
Henrik Grunell 2016/05/10 08:44:56 Trailing _.
Ivo-OOO until feb 6 2016/05/12 13:23:24 Done.
201 213
202 // While |peer_connection_data_| is non-empty, hold an instance of 214 // While |peer_connection_data_| is non-empty, hold an instance of
203 // PowerSaveBlocker. This prevents the application from being suspended while 215 // PowerSaveBlocker. This prevents the application from being suspended while
204 // remoting. 216 // remoting.
205 std::unique_ptr<PowerSaveBlocker> power_save_blocker_; 217 std::unique_ptr<PowerSaveBlocker> power_save_blocker_;
206 218
207 // Set of render process hosts that |this| is registered as an observer on. 219 // Set of render process hosts that |this| is registered as an observer on.
208 base::hash_set<int> render_process_id_set_; 220 base::hash_set<int> render_process_id_set_;
209 221
210 // Used to bulk up updates that we send to javascript. 222 // Used to bulk up updates that we send to javascript.
(...skipping 24 matching lines...) Expand all
235 std::queue<PendingUpdate> pending_updates_; 247 std::queue<PendingUpdate> pending_updates_;
236 const int aggregate_updates_ms_; 248 const int aggregate_updates_ms_;
237 249
238 // Weak factory for this object that we use for bulking up updates. 250 // Weak factory for this object that we use for bulking up updates.
239 base::WeakPtrFactory<WebRTCInternals> weak_factory_; 251 base::WeakPtrFactory<WebRTCInternals> weak_factory_;
240 }; 252 };
241 253
242 } // namespace content 254 } // namespace content
243 255
244 #endif // CONTENT_BROWSER_MEDIA_WEBRTC_WEBRTC_INTERNALS_H_ 256 #endif // CONTENT_BROWSER_MEDIA_WEBRTC_WEBRTC_INTERNALS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698