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/file_util.h" | 12 #include "base/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/browser_process.h" | 18 #include "chrome/browser/browser_process.h" |
19 #include "chrome/browser/chromeos/settings/cros_settings.h" | 19 #include "chrome/browser/chromeos/settings/cros_settings.h" |
20 #include "chrome/browser/media/webrtc_log_list.h" | 20 #include "chrome/browser/media/webrtc_log_list.h" |
21 #include "chrome/browser/media/webrtc_log_uploader.h" | 21 #include "chrome/browser/media/webrtc_log_uploader.h" |
22 #include "chrome/browser/media/webrtc_rtp_dump_handler.h" | |
22 #include "chrome/browser/profiles/profile.h" | 23 #include "chrome/browser/profiles/profile.h" |
23 #include "chrome/common/chrome_switches.h" | 24 #include "chrome/common/chrome_switches.h" |
24 #include "chrome/common/media/webrtc_logging_messages.h" | 25 #include "chrome/common/media/webrtc_logging_messages.h" |
25 #include "chrome/common/partial_circular_buffer.h" | 26 #include "chrome/common/partial_circular_buffer.h" |
26 #include "chrome/common/pref_names.h" | 27 #include "chrome/common/pref_names.h" |
27 #include "chromeos/settings/cros_settings_names.h" | 28 #include "chromeos/settings/cros_settings_names.h" |
28 #include "content/public/browser/browser_thread.h" | 29 #include "content/public/browser/browser_thread.h" |
29 #include "content/public/browser/content_browser_client.h" | 30 #include "content/public/browser/content_browser_client.h" |
30 #include "content/public/browser/gpu_data_manager.h" | 31 #include "content/public/browser/gpu_data_manager.h" |
31 #include "content/public/browser/render_process_host.h" | 32 #include "content/public/browser/render_process_host.h" |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
217 void WebRtcLoggingHandlerHost::LogMessage(const std::string& message) { | 218 void WebRtcLoggingHandlerHost::LogMessage(const std::string& message) { |
218 BrowserThread::PostTask( | 219 BrowserThread::PostTask( |
219 BrowserThread::IO, | 220 BrowserThread::IO, |
220 FROM_HERE, | 221 FROM_HERE, |
221 base::Bind( | 222 base::Bind( |
222 &WebRtcLoggingHandlerHost::AddLogMessageFromBrowser, | 223 &WebRtcLoggingHandlerHost::AddLogMessageFromBrowser, |
223 this, | 224 this, |
224 WebRtcLoggingMessageData(base::Time::Now(), message))); | 225 WebRtcLoggingMessageData(base::Time::Now(), message))); |
225 } | 226 } |
226 | 227 |
228 void WebRtcLoggingHandlerHost::OnRtpPacket(const uint8* packet, | |
Henrik Grunell
2014/05/07 09:38:19
Check thread.
| |
229 size_t length, | |
230 bool incoming) { | |
231 if (rtp_dump_handler_) | |
232 rtp_dump_handler_->OnRtpPacket(packet, length, incoming); | |
233 } | |
234 | |
227 void WebRtcLoggingHandlerHost::OnChannelClosing() { | 235 void WebRtcLoggingHandlerHost::OnChannelClosing() { |
228 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 236 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
229 if (logging_state_ == STARTED || logging_state_ == STOPPED) { | 237 if (logging_state_ == STARTED || logging_state_ == STOPPED) { |
230 if (upload_log_on_render_close_) { | 238 if (upload_log_on_render_close_) { |
231 logging_state_ = STOPPED; | 239 logging_state_ = STOPPED; |
232 logging_started_time_ = base::Time(); | 240 logging_started_time_ = base::Time(); |
233 content::BrowserThread::PostTaskAndReplyWithResult( | 241 content::BrowserThread::PostTaskAndReplyWithResult( |
234 content::BrowserThread::FILE, | 242 content::BrowserThread::FILE, |
235 FROM_HERE, | 243 FROM_HERE, |
236 base::Bind(&WebRtcLoggingHandlerHost::GetLogDirectoryAndEnsureExists, | 244 base::Bind(&WebRtcLoggingHandlerHost::GetLogDirectoryAndEnsureExists, |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
461 void WebRtcLoggingHandlerHost::FireGenericDoneCallback( | 469 void WebRtcLoggingHandlerHost::FireGenericDoneCallback( |
462 GenericDoneCallback* callback, bool success, | 470 GenericDoneCallback* callback, bool success, |
463 const std::string& error_message) { | 471 const std::string& error_message) { |
464 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 472 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
465 DCHECK(!(*callback).is_null()); | 473 DCHECK(!(*callback).is_null()); |
466 content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE, | 474 content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE, |
467 base::Bind(*callback, success, | 475 base::Bind(*callback, success, |
468 error_message)); | 476 error_message)); |
469 (*callback).Reset(); | 477 (*callback).Reset(); |
470 } | 478 } |
OLD | NEW |