| 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/webrtc_internals.h" | 5 #include "content/browser/media/webrtc/webrtc_internals.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 } | 271 } |
| 272 | 272 |
| 273 void WebRTCInternals::EnableAudioDebugRecordings( | 273 void WebRTCInternals::EnableAudioDebugRecordings( |
| 274 content::WebContents* web_contents) { | 274 content::WebContents* web_contents) { |
| 275 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 275 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 276 #if defined(ENABLE_WEBRTC) | 276 #if defined(ENABLE_WEBRTC) |
| 277 #if defined(OS_ANDROID) | 277 #if defined(OS_ANDROID) |
| 278 EnableAudioDebugRecordingsOnAllRenderProcessHosts(); | 278 EnableAudioDebugRecordingsOnAllRenderProcessHosts(); |
| 279 #else | 279 #else |
| 280 selecting_event_log_ = false; | 280 selecting_event_log_ = false; |
| 281 DCHECK(select_file_dialog_ == nullptr); | 281 DCHECK(!select_file_dialog_); |
| 282 select_file_dialog_ = ui::SelectFileDialog::Create(this, NULL); | 282 select_file_dialog_ = ui::SelectFileDialog::Create(this, NULL); |
| 283 select_file_dialog_->SelectFile( | 283 select_file_dialog_->SelectFile( |
| 284 ui::SelectFileDialog::SELECT_SAVEAS_FILE, | 284 ui::SelectFileDialog::SELECT_SAVEAS_FILE, |
| 285 base::string16(), | 285 base::string16(), |
| 286 audio_debug_recordings_file_path_, | 286 audio_debug_recordings_file_path_, |
| 287 NULL, | 287 NULL, |
| 288 0, | 288 0, |
| 289 FILE_PATH_LITERAL(""), | 289 FILE_PATH_LITERAL(""), |
| 290 web_contents->GetTopLevelNativeWindow(), | 290 web_contents->GetTopLevelNativeWindow(), |
| 291 NULL); | 291 NULL); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 void WebRTCInternals::SetEventLogRecordings( | 323 void WebRTCInternals::SetEventLogRecordings( |
| 324 bool enable, | 324 bool enable, |
| 325 content::WebContents* web_contents) { | 325 content::WebContents* web_contents) { |
| 326 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 326 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 327 #if defined(ENABLE_WEBRTC) | 327 #if defined(ENABLE_WEBRTC) |
| 328 if (enable) { | 328 if (enable) { |
| 329 #if defined(OS_ANDROID) | 329 #if defined(OS_ANDROID) |
| 330 EnableEventLogRecordingsOnAllRenderProcessHosts(); | 330 EnableEventLogRecordingsOnAllRenderProcessHosts(); |
| 331 #else | 331 #else |
| 332 DCHECK(web_contents); | 332 DCHECK(web_contents); |
| 333 DCHECK(select_file_dialog_ == nullptr); | 333 DCHECK(!select_file_dialog_); |
| 334 selecting_event_log_ = true; | 334 selecting_event_log_ = true; |
| 335 select_file_dialog_ = ui::SelectFileDialog::Create(this, nullptr); | 335 select_file_dialog_ = ui::SelectFileDialog::Create(this, nullptr); |
| 336 select_file_dialog_->SelectFile( | 336 select_file_dialog_->SelectFile( |
| 337 ui::SelectFileDialog::SELECT_SAVEAS_FILE, base::string16(), | 337 ui::SelectFileDialog::SELECT_SAVEAS_FILE, base::string16(), |
| 338 event_log_recordings_file_path_, nullptr, 0, FILE_PATH_LITERAL(""), | 338 event_log_recordings_file_path_, nullptr, 0, FILE_PATH_LITERAL(""), |
| 339 web_contents->GetTopLevelNativeWindow(), nullptr); | 339 web_contents->GetTopLevelNativeWindow(), nullptr); |
| 340 #endif | 340 #endif |
| 341 } else { | 341 } else { |
| 342 event_log_recordings_ = false; | 342 event_log_recordings_ = false; |
| 343 // Tear down the dialog since the user has unchecked the audio debug | 343 // Tear down the dialog since the user has unchecked the audio debug |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 513 while (!pending_updates_.empty()) { | 513 while (!pending_updates_.empty()) { |
| 514 const auto& update = pending_updates_.front(); | 514 const auto& update = pending_updates_.front(); |
| 515 FOR_EACH_OBSERVER(WebRTCInternalsUIObserver, | 515 FOR_EACH_OBSERVER(WebRTCInternalsUIObserver, |
| 516 observers_, | 516 observers_, |
| 517 OnUpdate(update.command(), update.value())); | 517 OnUpdate(update.command(), update.value())); |
| 518 pending_updates_.pop(); | 518 pending_updates_.pop(); |
| 519 } | 519 } |
| 520 } | 520 } |
| 521 | 521 |
| 522 } // namespace content | 522 } // namespace content |
| OLD | NEW |