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

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 NON_EXPORTED_BASE annotation. Created 4 years, 4 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
« no previous file with comments | « no previous file | content/browser/media/webrtc/webrtc_internals.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 WebRTCInternals(int aggregate_updates_ms, bool should_block_power_saving);
118 ~WebRTCInternals() override; 118 ~WebRTCInternals() override;
119 119
120 private: 120 private:
121 friend struct base::DefaultLazyInstanceTraits<WebRTCInternals>; 121 friend struct base::DefaultLazyInstanceTraits<WebRTCInternals>;
122 FRIEND_TEST_ALL_PREFIXES(WebRtcAudioDebugRecordingsBrowserTest, 122 FRIEND_TEST_ALL_PREFIXES(WebRtcAudioDebugRecordingsBrowserTest,
123 CallWithAudioDebugRecordings); 123 CallWithAudioDebugRecordings);
124 FRIEND_TEST_ALL_PREFIXES(WebRtcAudioDebugRecordingsBrowserTest, 124 FRIEND_TEST_ALL_PREFIXES(WebRtcAudioDebugRecordingsBrowserTest,
125 CallWithAudioDebugRecordingsEnabledThenDisabled); 125 CallWithAudioDebugRecordingsEnabledThenDisabled);
126 FRIEND_TEST_ALL_PREFIXES(WebRtcAudioDebugRecordingsBrowserTest, 126 FRIEND_TEST_ALL_PREFIXES(WebRtcAudioDebugRecordingsBrowserTest,
127 TwoCallsWithAudioDebugRecordings); 127 TwoCallsWithAudioDebugRecordings);
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 200
201 // Diagnostic event log recording state. 201 // Diagnostic event log recording state.
202 bool event_log_recordings_; 202 bool event_log_recordings_;
203 bool selecting_event_log_; 203 bool selecting_event_log_;
204 base::FilePath event_log_recordings_file_path_; 204 base::FilePath event_log_recordings_file_path_;
205 205
206 // While |peer_connection_data_| is non-empty, hold an instance of 206 // While |peer_connection_data_| is non-empty, hold an instance of
207 // PowerSaveBlocker. This prevents the application from being suspended while 207 // PowerSaveBlocker. This prevents the application from being suspended while
208 // remoting. 208 // remoting.
209 std::unique_ptr<device::PowerSaveBlocker> power_save_blocker_; 209 std::unique_ptr<device::PowerSaveBlocker> power_save_blocker_;
210 const bool should_block_power_saving_;
210 211
211 // Set of render process hosts that |this| is registered as an observer on. 212 // Set of render process hosts that |this| is registered as an observer on.
212 base::hash_set<int> render_process_id_set_; 213 base::hash_set<int> render_process_id_set_;
213 214
214 // Used to bulk up updates that we send to javascript. 215 // Used to bulk up updates that we send to javascript.
215 // The class owns the value/dictionary and command name of an update. 216 // The class owns the value/dictionary and command name of an update.
216 // For each update, a PendingUpdate is stored in the |pending_updates_| queue 217 // For each update, a PendingUpdate is stored in the |pending_updates_| queue
217 // and deleted as soon as the update has been delivered. 218 // and deleted as soon as the update has been delivered.
218 // The class is moveble and not copyable to avoid copying while still allowing 219 // The class is moveble and not copyable to avoid copying while still allowing
219 // us to use an stl container without needing scoped_ptr or similar. 220 // us to use an stl container without needing scoped_ptr or similar.
(...skipping 19 matching lines...) Expand all
239 std::queue<PendingUpdate> pending_updates_; 240 std::queue<PendingUpdate> pending_updates_;
240 const int aggregate_updates_ms_; 241 const int aggregate_updates_ms_;
241 242
242 // Weak factory for this object that we use for bulking up updates. 243 // Weak factory for this object that we use for bulking up updates.
243 base::WeakPtrFactory<WebRTCInternals> weak_factory_; 244 base::WeakPtrFactory<WebRTCInternals> weak_factory_;
244 }; 245 };
245 246
246 } // namespace content 247 } // namespace content
247 248
248 #endif // CONTENT_BROWSER_MEDIA_WEBRTC_WEBRTC_INTERNALS_H_ 249 #endif // CONTENT_BROWSER_MEDIA_WEBRTC_WEBRTC_INTERNALS_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/media/webrtc/webrtc_internals.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698