| OLD | NEW |
| 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 |
| 11 #include "base/containers/hash_tables.h" | 11 #include "base/containers/hash_tables.h" |
| 12 #include "base/gtest_prod_util.h" | 12 #include "base/gtest_prod_util.h" |
| 13 #include "base/lazy_instance.h" | 13 #include "base/lazy_instance.h" |
| 14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
| 15 #include "base/observer_list.h" | 15 #include "base/observer_list.h" |
| 16 #include "base/process/process.h" | 16 #include "base/process/process.h" |
| 17 #include "base/threading/thread_checker.h" | 17 #include "base/threading/thread_checker.h" |
| 18 #include "base/values.h" | 18 #include "base/values.h" |
| 19 #include "content/common/content_export.h" | 19 #include "content/common/content_export.h" |
| 20 #include "content/public/browser/render_process_host_observer.h" | 20 #include "content/public/browser/render_process_host_observer.h" |
| 21 #include "ui/shell_dialogs/select_file_dialog.h" | 21 #include "ui/shell_dialogs/select_file_dialog.h" |
| 22 | 22 |
| 23 namespace device { |
| 24 class PowerSaveBlocker; |
| 25 } // namespace device |
| 26 |
| 23 namespace content { | 27 namespace content { |
| 24 | 28 |
| 25 class PowerSaveBlocker; | |
| 26 class WebContents; | 29 class WebContents; |
| 27 class WebRTCInternalsUIObserver; | 30 class WebRTCInternalsUIObserver; |
| 28 | 31 |
| 29 // This is a singleton class running in the browser UI thread. | 32 // This is a singleton class running in the browser UI thread. |
| 30 // It collects peer connection infomation from the renderers, | 33 // It collects peer connection infomation from the renderers, |
| 31 // forwards the data to WebRTCInternalsUIObserver and | 34 // forwards the data to WebRTCInternalsUIObserver and |
| 32 // sends data collecting commands to the renderers. | 35 // sends data collecting commands to the renderers. |
| 33 class CONTENT_EXPORT WebRTCInternals : public RenderProcessHostObserver, | 36 class CONTENT_EXPORT WebRTCInternals : public RenderProcessHostObserver, |
| 34 public ui::SelectFileDialog::Listener { | 37 public ui::SelectFileDialog::Listener { |
| 35 public: | 38 public: |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 base::FilePath audio_debug_recordings_file_path_; | 198 base::FilePath audio_debug_recordings_file_path_; |
| 196 | 199 |
| 197 // Diagnostic event log recording state. | 200 // Diagnostic event log recording state. |
| 198 bool event_log_recordings_; | 201 bool event_log_recordings_; |
| 199 bool selecting_event_log_; | 202 bool selecting_event_log_; |
| 200 base::FilePath event_log_recordings_file_path_; | 203 base::FilePath event_log_recordings_file_path_; |
| 201 | 204 |
| 202 // While |peer_connection_data_| is non-empty, hold an instance of | 205 // While |peer_connection_data_| is non-empty, hold an instance of |
| 203 // PowerSaveBlocker. This prevents the application from being suspended while | 206 // PowerSaveBlocker. This prevents the application from being suspended while |
| 204 // remoting. | 207 // remoting. |
| 205 std::unique_ptr<PowerSaveBlocker> power_save_blocker_; | 208 std::unique_ptr<device::PowerSaveBlocker> power_save_blocker_; |
| 206 | 209 |
| 207 // Set of render process hosts that |this| is registered as an observer on. | 210 // Set of render process hosts that |this| is registered as an observer on. |
| 208 base::hash_set<int> render_process_id_set_; | 211 base::hash_set<int> render_process_id_set_; |
| 209 | 212 |
| 210 // Used to bulk up updates that we send to javascript. | 213 // Used to bulk up updates that we send to javascript. |
| 211 // The class owns the value/dictionary and command name of an update. | 214 // The class owns the value/dictionary and command name of an update. |
| 212 // For each update, a PendingUpdate is stored in the |pending_updates_| queue | 215 // For each update, a PendingUpdate is stored in the |pending_updates_| queue |
| 213 // and deleted as soon as the update has been delivered. | 216 // and deleted as soon as the update has been delivered. |
| 214 // The class is moveble and not copyable to avoid copying while still allowing | 217 // The class is moveble and not copyable to avoid copying while still allowing |
| 215 // us to use an stl container without needing scoped_ptr or similar. | 218 // us to use an stl container without needing scoped_ptr or similar. |
| (...skipping 19 matching lines...) Expand all Loading... |
| 235 std::queue<PendingUpdate> pending_updates_; | 238 std::queue<PendingUpdate> pending_updates_; |
| 236 const int aggregate_updates_ms_; | 239 const int aggregate_updates_ms_; |
| 237 | 240 |
| 238 // Weak factory for this object that we use for bulking up updates. | 241 // Weak factory for this object that we use for bulking up updates. |
| 239 base::WeakPtrFactory<WebRTCInternals> weak_factory_; | 242 base::WeakPtrFactory<WebRTCInternals> weak_factory_; |
| 240 }; | 243 }; |
| 241 | 244 |
| 242 } // namespace content | 245 } // namespace content |
| 243 | 246 |
| 244 #endif // CONTENT_BROWSER_MEDIA_WEBRTC_WEBRTC_INTERNALS_H_ | 247 #endif // CONTENT_BROWSER_MEDIA_WEBRTC_WEBRTC_INTERNALS_H_ |
| OLD | NEW |