OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "chrome/browser/media/webrtc_logging_handler_host.h" | 5 #include "chrome/browser/media/webrtc_logging_handler_host.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
11 #include "base/cpu.h" | 11 #include "base/cpu.h" |
12 #include "base/files/file_util.h" | 12 #include "base/files/file_util.h" |
13 #include "base/logging.h" | 13 #include "base/logging.h" |
14 #include "base/prefs/pref_service.h" | 14 #include "base/prefs/pref_service.h" |
15 #include "base/strings/string_number_conversions.h" | 15 #include "base/strings/string_number_conversions.h" |
16 #include "base/sys_info.h" | 16 #include "base/sys_info.h" |
17 #include "base/time/time.h" | 17 #include "base/time/time.h" |
| 18 #include "chrome/browser/bad_message.h" |
18 #include "chrome/browser/browser_process.h" | 19 #include "chrome/browser/browser_process.h" |
19 #include "chrome/browser/chromeos/settings/cros_settings.h" | 20 #include "chrome/browser/chromeos/settings/cros_settings.h" |
20 #include "chrome/browser/media/webrtc_log_list.h" | 21 #include "chrome/browser/media/webrtc_log_list.h" |
21 #include "chrome/browser/media/webrtc_log_uploader.h" | 22 #include "chrome/browser/media/webrtc_log_uploader.h" |
22 #include "chrome/browser/media/webrtc_rtp_dump_handler.h" | 23 #include "chrome/browser/media/webrtc_rtp_dump_handler.h" |
23 #include "chrome/browser/profiles/profile.h" | 24 #include "chrome/browser/profiles/profile.h" |
24 #include "chrome/common/chrome_switches.h" | 25 #include "chrome/common/chrome_switches.h" |
25 #include "chrome/common/chrome_version_info.h" | 26 #include "chrome/common/chrome_version_info.h" |
26 #include "chrome/common/media/webrtc_logging_messages.h" | 27 #include "chrome/common/media/webrtc_logging_messages.h" |
27 #include "chromeos/settings/cros_settings_names.h" | 28 #include "chromeos/settings/cros_settings_names.h" |
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
482 } | 483 } |
483 } | 484 } |
484 | 485 |
485 void WebRtcLoggingHandlerHost::OnLoggingStoppedInRenderer() { | 486 void WebRtcLoggingHandlerHost::OnLoggingStoppedInRenderer() { |
486 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 487 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
487 if (logging_state_ != STOPPING) { | 488 if (logging_state_ != STOPPING) { |
488 // If an out-of-order response is received, stop_callback_ may be invalid, | 489 // If an out-of-order response is received, stop_callback_ may be invalid, |
489 // and must not be invoked. | 490 // and must not be invoked. |
490 DLOG(ERROR) << "OnLoggingStoppedInRenderer invoked in state " | 491 DLOG(ERROR) << "OnLoggingStoppedInRenderer invoked in state " |
491 << logging_state_; | 492 << logging_state_; |
492 BadMessageReceived(); | 493 bad_message::ReceivedBadMessage( |
| 494 this, bad_message::WRLHH_LOGGING_STOPPED_BAD_STATE); |
493 return; | 495 return; |
494 } | 496 } |
495 logging_started_time_ = base::Time(); | 497 logging_started_time_ = base::Time(); |
496 logging_state_ = STOPPED; | 498 logging_state_ = STOPPED; |
497 FireAndResetGenericDoneCallback(&stop_callback_, true, ""); | 499 FireAndResetGenericDoneCallback(&stop_callback_, true, ""); |
498 } | 500 } |
499 | 501 |
500 void WebRtcLoggingHandlerHost::StartLoggingIfAllowed( | 502 void WebRtcLoggingHandlerHost::StartLoggingIfAllowed( |
501 const GenericDoneCallback& callback) { | 503 const GenericDoneCallback& callback) { |
502 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 504 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
760 WebRtcRtpDumpHandler::ReleasedDumps rtp_dumps( | 762 WebRtcRtpDumpHandler::ReleasedDumps rtp_dumps( |
761 rtp_dump_handler_->ReleaseDumps()); | 763 rtp_dump_handler_->ReleaseDumps()); |
762 log_paths->incoming_rtp_dump = rtp_dumps.incoming_dump_path; | 764 log_paths->incoming_rtp_dump = rtp_dumps.incoming_dump_path; |
763 log_paths->outgoing_rtp_dump = rtp_dumps.outgoing_dump_path; | 765 log_paths->outgoing_rtp_dump = rtp_dumps.outgoing_dump_path; |
764 | 766 |
765 rtp_dump_handler_.reset(); | 767 rtp_dump_handler_.reset(); |
766 stop_rtp_dump_callback_.Reset(); | 768 stop_rtp_dump_callback_.Reset(); |
767 | 769 |
768 return true; | 770 return true; |
769 } | 771 } |
OLD | NEW |