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 #include "content/browser/media/webrtc_internals.h" | 5 #include "content/browser/media/webrtc_internals.h" |
6 | 6 |
7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
9 #include "content/browser/media/webrtc_internals_ui_observer.h" | 9 #include "content/browser/media/webrtc_internals_ui_observer.h" |
10 #include "content/browser/web_contents/web_contents_view.h" | 10 #include "content/browser/web_contents/web_contents_view.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
54 aec_dump_file_path_ = | 54 aec_dump_file_path_ = |
55 aec_dump_file_path_.Append(FILE_PATH_LITERAL("audio.aecdump")); | 55 aec_dump_file_path_.Append(FILE_PATH_LITERAL("audio.aecdump")); |
56 } | 56 } |
57 #endif // defined(ENABLE_WEBRTC) | 57 #endif // defined(ENABLE_WEBRTC) |
58 } | 58 } |
59 | 59 |
60 WebRTCInternals::~WebRTCInternals() { | 60 WebRTCInternals::~WebRTCInternals() { |
61 } | 61 } |
62 | 62 |
63 WebRTCInternals* WebRTCInternals::GetInstance() { | 63 WebRTCInternals* WebRTCInternals::GetInstance() { |
64 return Singleton<WebRTCInternals>::get(); | 64 return Singleton<WebRTCInternals, |
DaleCurtis
2014/09/19 01:05:55
Hmm, this seems like it should be a leaky LazyInst
tommi (sloooow) - chröme
2014/09/19 01:28:42
Do you mean to create a static variable instead?
(
DaleCurtis
2014/09/19 02:27:57
We typically prefer LazyInstance to Singleton. Or
| |
65 LeakySingletonTraits<WebRTCInternals> >::get(); | |
65 } | 66 } |
66 | 67 |
67 void WebRTCInternals::OnAddPeerConnection(int render_process_id, | 68 void WebRTCInternals::OnAddPeerConnection(int render_process_id, |
68 ProcessId pid, | 69 ProcessId pid, |
69 int lid, | 70 int lid, |
70 const string& url, | 71 const string& url, |
71 const string& rtc_configuration, | 72 const string& rtc_configuration, |
72 const string& constraints) { | 73 const string& constraints) { |
73 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 74 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
74 | 75 |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
374 } else if (!peer_connection_data_.empty() && !power_save_blocker_) { | 375 } else if (!peer_connection_data_.empty() && !power_save_blocker_) { |
375 DVLOG(1) << ("Preventing the application from being suspended while one or " | 376 DVLOG(1) << ("Preventing the application from being suspended while one or " |
376 "more PeerConnections are active."); | 377 "more PeerConnections are active."); |
377 power_save_blocker_ = content::PowerSaveBlocker::Create( | 378 power_save_blocker_ = content::PowerSaveBlocker::Create( |
378 content::PowerSaveBlocker::kPowerSaveBlockPreventAppSuspension, | 379 content::PowerSaveBlocker::kPowerSaveBlockPreventAppSuspension, |
379 "WebRTC has active PeerConnections.").Pass(); | 380 "WebRTC has active PeerConnections.").Pass(); |
380 } | 381 } |
381 } | 382 } |
382 | 383 |
383 } // namespace content | 384 } // namespace content |
OLD | NEW |