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

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

Issue 2163983006: Add unit test for WebRTCInternalsMessageHandler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add unit test for WebRTCInternalsMessageHandler. Created 4 years, 5 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 <memory> 8 #include <memory>
9 #include <queue> 9 #include <queue>
10 10
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 107
108 bool IsEventLogRecordingsEnabled() const; 108 bool IsEventLogRecordingsEnabled() const;
109 const base::FilePath& GetEventLogFilePath() const; 109 const base::FilePath& GetEventLogFilePath() const;
110 110
111 protected: 111 protected:
112 // Constructor/Destructor are protected to allow tests to derive from the 112 // Constructor/Destructor are protected to allow tests to derive from the
113 // class and do per-instance testing without having to use the global 113 // class and do per-instance testing without having to use the global
114 // instance. 114 // instance.
115 // The default ctor sets |aggregate_updates_ms| to 500ms. 115 // The default ctor sets |aggregate_updates_ms| to 500ms.
116 WebRTCInternals(); 116 WebRTCInternals();
117 explicit WebRTCInternals(int aggregate_updates_ms); 117 explicit WebRTCInternals(int aggregate_updates_ms,
118 bool should_block_power_saving);
tommi (sloooow) - chröme 2016/07/25 10:16:06 remove 'explicit' (only used for a single argument
Max Morin 2016/07/25 10:41:18 Done.
118 ~WebRTCInternals() override; 119 ~WebRTCInternals() override;
119 120
120 private: 121 private:
121 friend struct base::DefaultLazyInstanceTraits<WebRTCInternals>; 122 friend struct base::DefaultLazyInstanceTraits<WebRTCInternals>;
122 FRIEND_TEST_ALL_PREFIXES(WebRtcAudioDebugRecordingsBrowserTest, 123 FRIEND_TEST_ALL_PREFIXES(WebRtcAudioDebugRecordingsBrowserTest,
123 CallWithAudioDebugRecordings); 124 CallWithAudioDebugRecordings);
124 FRIEND_TEST_ALL_PREFIXES(WebRtcAudioDebugRecordingsBrowserTest, 125 FRIEND_TEST_ALL_PREFIXES(WebRtcAudioDebugRecordingsBrowserTest,
125 CallWithAudioDebugRecordingsEnabledThenDisabled); 126 CallWithAudioDebugRecordingsEnabledThenDisabled);
126 FRIEND_TEST_ALL_PREFIXES(WebRtcAudioDebugRecordingsBrowserTest, 127 FRIEND_TEST_ALL_PREFIXES(WebRtcAudioDebugRecordingsBrowserTest,
127 TwoCallsWithAudioDebugRecordings); 128 TwoCallsWithAudioDebugRecordings);
(...skipping 22 matching lines...) Expand all
150 151
151 // Enables event log recordings on all render process hosts using 152 // Enables event log recordings on all render process hosts using
152 // |event_log_recordings_file_path_|. 153 // |event_log_recordings_file_path_|.
153 void EnableEventLogRecordingsOnAllRenderProcessHosts(); 154 void EnableEventLogRecordingsOnAllRenderProcessHosts();
154 #endif 155 #endif
155 156
156 // Called whenever an element is added to or removed from 157 // Called whenever an element is added to or removed from
157 // |peer_connection_data_| to impose/release a block on suspending the current 158 // |peer_connection_data_| to impose/release a block on suspending the current
158 // application for power-saving. 159 // application for power-saving.
159 void CreateOrReleasePowerSaveBlocker(); 160 void CreateOrReleasePowerSaveBlocker();
161 const bool should_block_power_saving_;
tommi (sloooow) - chröme 2016/07/25 10:16:06 keep member variables together and at the bottom o
Max Morin 2016/07/25 10:41:18 Done.
160 162
161 // Called on a timer to deliver updates to javascript. 163 // Called on a timer to deliver updates to javascript.
162 // We throttle and bulk together updates to avoid DOS like scenarios where 164 // We throttle and bulk together updates to avoid DOS like scenarios where
163 // a page uses a lot of peerconnection instances with many event 165 // a page uses a lot of peerconnection instances with many event
164 // notifications. 166 // notifications.
165 void ProcessPendingUpdates(); 167 void ProcessPendingUpdates();
166 168
167 base::ObserverList<WebRTCInternalsUIObserver> observers_; 169 base::ObserverList<WebRTCInternalsUIObserver> observers_;
168 170
169 // |peer_connection_data_| is a list containing all the PeerConnection 171 // |peer_connection_data_| is a list containing all the PeerConnection
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 std::queue<PendingUpdate> pending_updates_; 241 std::queue<PendingUpdate> pending_updates_;
240 const int aggregate_updates_ms_; 242 const int aggregate_updates_ms_;
241 243
242 // Weak factory for this object that we use for bulking up updates. 244 // Weak factory for this object that we use for bulking up updates.
243 base::WeakPtrFactory<WebRTCInternals> weak_factory_; 245 base::WeakPtrFactory<WebRTCInternals> weak_factory_;
244 }; 246 };
245 247
246 } // namespace content 248 } // namespace content
247 249
248 #endif // CONTENT_BROWSER_MEDIA_WEBRTC_WEBRTC_INTERNALS_H_ 250 #endif // CONTENT_BROWSER_MEDIA_WEBRTC_WEBRTC_INTERNALS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698