| 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" |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 g_browser_process->webrtc_log_uploader()->LoggingStoppedDontUpload(); | 255 g_browser_process->webrtc_log_uploader()->LoggingStoppedDontUpload(); |
| 256 } | 256 } |
| 257 } | 257 } |
| 258 content::BrowserMessageFilter::OnChannelClosing(); | 258 content::BrowserMessageFilter::OnChannelClosing(); |
| 259 } | 259 } |
| 260 | 260 |
| 261 void WebRtcLoggingHandlerHost::OnDestruct() const { | 261 void WebRtcLoggingHandlerHost::OnDestruct() const { |
| 262 BrowserThread::DeleteOnIOThread::Destruct(this); | 262 BrowserThread::DeleteOnIOThread::Destruct(this); |
| 263 } | 263 } |
| 264 | 264 |
| 265 bool WebRtcLoggingHandlerHost::OnMessageReceived(const IPC::Message& message, | 265 bool WebRtcLoggingHandlerHost::OnMessageReceived(const IPC::Message& message) { |
| 266 bool* message_was_ok) { | |
| 267 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 266 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 268 bool handled = true; | 267 bool handled = true; |
| 269 IPC_BEGIN_MESSAGE_MAP_EX(WebRtcLoggingHandlerHost, message, *message_was_ok) | 268 IPC_BEGIN_MESSAGE_MAP(WebRtcLoggingHandlerHost, message) |
| 270 IPC_MESSAGE_HANDLER(WebRtcLoggingMsg_AddLogMessages, OnAddLogMessages) | 269 IPC_MESSAGE_HANDLER(WebRtcLoggingMsg_AddLogMessages, OnAddLogMessages) |
| 271 IPC_MESSAGE_HANDLER(WebRtcLoggingMsg_LoggingStopped, | 270 IPC_MESSAGE_HANDLER(WebRtcLoggingMsg_LoggingStopped, |
| 272 OnLoggingStoppedInRenderer) | 271 OnLoggingStoppedInRenderer) |
| 273 IPC_MESSAGE_UNHANDLED(handled = false) | 272 IPC_MESSAGE_UNHANDLED(handled = false) |
| 274 IPC_END_MESSAGE_MAP_EX() | 273 IPC_END_MESSAGE_MAP() |
| 275 | 274 |
| 276 return handled; | 275 return handled; |
| 277 } | 276 } |
| 278 | 277 |
| 279 void WebRtcLoggingHandlerHost::AddLogMessageFromBrowser( | 278 void WebRtcLoggingHandlerHost::AddLogMessageFromBrowser( |
| 280 const WebRtcLoggingMessageData& message) { | 279 const WebRtcLoggingMessageData& message) { |
| 281 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 280 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 282 if (logging_state_ == STARTED) | 281 if (logging_state_ == STARTED) |
| 283 LogToCircularBuffer(message.Format(logging_started_time_)); | 282 LogToCircularBuffer(message.Format(logging_started_time_)); |
| 284 } | 283 } |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 void WebRtcLoggingHandlerHost::FireGenericDoneCallback( | 477 void WebRtcLoggingHandlerHost::FireGenericDoneCallback( |
| 479 GenericDoneCallback* callback, bool success, | 478 GenericDoneCallback* callback, bool success, |
| 480 const std::string& error_message) { | 479 const std::string& error_message) { |
| 481 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 480 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 482 DCHECK(!(*callback).is_null()); | 481 DCHECK(!(*callback).is_null()); |
| 483 content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE, | 482 content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE, |
| 484 base::Bind(*callback, success, | 483 base::Bind(*callback, success, |
| 485 error_message)); | 484 error_message)); |
| 486 (*callback).Reset(); | 485 (*callback).Reset(); |
| 487 } | 486 } |
| OLD | NEW |