| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/audio_input_sync_writer.h" | 5 #include "content/browser/renderer_host/media/audio_input_sync_writer.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/memory/shared_memory.h" | 9 #include "base/memory/shared_memory.h" |
| 10 #include "content/browser/renderer_host/media/media_stream_manager.h" | 10 #include "content/browser/renderer_host/media/media_stream_manager.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 double volume, | 53 double volume, |
| 54 bool key_pressed) { | 54 bool key_pressed) { |
| 55 #if !defined(OS_ANDROID) | 55 #if !defined(OS_ANDROID) |
| 56 static const base::TimeDelta kLogDelayThreadhold = | 56 static const base::TimeDelta kLogDelayThreadhold = |
| 57 base::TimeDelta::FromMilliseconds(500); | 57 base::TimeDelta::FromMilliseconds(500); |
| 58 | 58 |
| 59 std::ostringstream oss; | 59 std::ostringstream oss; |
| 60 if (last_write_time_.is_null()) { | 60 if (last_write_time_.is_null()) { |
| 61 // This is the first time Write is called. | 61 // This is the first time Write is called. |
| 62 base::TimeDelta interval = base::Time::Now() - creation_time_; | 62 base::TimeDelta interval = base::Time::Now() - creation_time_; |
| 63 oss << "AISW::Write => audio input data received for the first time: delay " | 63 oss << "AISW::Write: audio input data received for the first time: delay " |
| 64 "= " << interval.InMilliseconds() << "ms"; | 64 "= " << interval.InMilliseconds() << "ms"; |
| 65 | 65 |
| 66 } else { | 66 } else { |
| 67 base::TimeDelta interval = base::Time::Now() - last_write_time_; | 67 base::TimeDelta interval = base::Time::Now() - last_write_time_; |
| 68 if (interval > kLogDelayThreadhold) { | 68 if (interval > kLogDelayThreadhold) { |
| 69 oss << "AISW::Write => audio input data delay unexpectedly long: delay = " | 69 oss << "AISW::Write: audio input data delay unexpectedly long: delay = " |
| 70 << interval.InMilliseconds() << "ms"; | 70 << interval.InMilliseconds() << "ms"; |
| 71 } | 71 } |
| 72 } | 72 } |
| 73 if (!oss.str().empty()) { | 73 if (!oss.str().empty()) { |
| 74 MediaStreamManager::SendMessageToNativeLog(oss.str()); | 74 MediaStreamManager::SendMessageToNativeLog(oss.str()); |
| 75 DVLOG(1) << oss.str(); | 75 DVLOG(1) << oss.str(); |
| 76 } | 76 } |
| 77 | 77 |
| 78 last_write_time_ = base::Time::Now(); | 78 last_write_time_ = base::Time::Now(); |
| 79 #endif | 79 #endif |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 base::ProcessHandle process_handle, | 124 base::ProcessHandle process_handle, |
| 125 base::FileDescriptor* foreign_handle) { | 125 base::FileDescriptor* foreign_handle) { |
| 126 foreign_handle->fd = foreign_socket_->handle(); | 126 foreign_handle->fd = foreign_socket_->handle(); |
| 127 foreign_handle->auto_close = false; | 127 foreign_handle->auto_close = false; |
| 128 return (foreign_handle->fd != -1); | 128 return (foreign_handle->fd != -1); |
| 129 } | 129 } |
| 130 | 130 |
| 131 #endif | 131 #endif |
| 132 | 132 |
| 133 } // namespace content | 133 } // namespace content |
| OLD | NEW |