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

Side by Side Diff: content/browser/media/webrtc_internals.cc

Issue 575283004: Change WebRTCInternals::GetInstance() to use a leaky LazyInstance. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 | no next file » | 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 #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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698