| 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/renderer_host/media/webrtc_logging_handler_host.h" | 5 #include "chrome/browser/media/webrtc_logging_handler_host.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "content/common/media/webrtc_logging_messages.h" | 9 #include "chrome/common/media/webrtc_logging_messages.h" |
| 10 | 10 |
| 11 namespace content { | 11 using content::BrowserThread; |
| 12 |
| 13 namespace chrome { |
| 12 | 14 |
| 13 #if defined(OS_ANDROID) | 15 #if defined(OS_ANDROID) |
| 14 const size_t kWebRtcLogSize = 1 * 1024 * 1024; // 1 MB | 16 const size_t kWebRtcLogSize = 1 * 1024 * 1024; // 1 MB |
| 15 #else | 17 #else |
| 16 const size_t kWebRtcLogSize = 6 * 1024 * 1024; // 6 MB | 18 const size_t kWebRtcLogSize = 6 * 1024 * 1024; // 6 MB |
| 17 #endif | 19 #endif |
| 18 | 20 |
| 19 WebRtcLoggingHandlerHost::WebRtcLoggingHandlerHost() { | 21 WebRtcLoggingHandlerHost::WebRtcLoggingHandlerHost() { |
| 20 } | 22 } |
| 21 | 23 |
| 22 WebRtcLoggingHandlerHost::~WebRtcLoggingHandlerHost() { | 24 WebRtcLoggingHandlerHost::~WebRtcLoggingHandlerHost() { |
| 23 } | 25 } |
| 24 | 26 |
| 25 void WebRtcLoggingHandlerHost::OnChannelClosing() { | 27 void WebRtcLoggingHandlerHost::OnChannelClosing() { |
| 26 BrowserMessageFilter::OnChannelClosing(); | 28 content::BrowserMessageFilter::OnChannelClosing(); |
| 27 } | 29 } |
| 28 | 30 |
| 29 void WebRtcLoggingHandlerHost::OnDestruct() const { | 31 void WebRtcLoggingHandlerHost::OnDestruct() const { |
| 30 BrowserThread::DeleteOnIOThread::Destruct(this); | 32 BrowserThread::DeleteOnIOThread::Destruct(this); |
| 31 } | 33 } |
| 32 | 34 |
| 33 bool WebRtcLoggingHandlerHost::OnMessageReceived(const IPC::Message& message, | 35 bool WebRtcLoggingHandlerHost::OnMessageReceived(const IPC::Message& message, |
| 34 bool* message_was_ok) { | 36 bool* message_was_ok) { |
| 35 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 37 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 36 bool handled = true; | 38 bool handled = true; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 58 &foreign_memory_handle)) { | 60 &foreign_memory_handle)) { |
| 59 Send(new WebRtcLoggingMsg_OpenLogFailed()); | 61 Send(new WebRtcLoggingMsg_OpenLogFailed()); |
| 60 return; | 62 return; |
| 61 } | 63 } |
| 62 | 64 |
| 63 app_session_id_ = app_session_id; | 65 app_session_id_ = app_session_id; |
| 64 app_url_ = app_url; | 66 app_url_ = app_url; |
| 65 Send(new WebRtcLoggingMsg_LogOpened(foreign_memory_handle, kWebRtcLogSize)); | 67 Send(new WebRtcLoggingMsg_LogOpened(foreign_memory_handle, kWebRtcLogSize)); |
| 66 } | 68 } |
| 67 | 69 |
| 68 } // namespace content | 70 } // namespace chrome |
| OLD | NEW |