Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(358)

Unified Diff: chrome/browser/renderer_host/audio_renderer_host.cc

Issue 155372: Fix a bug in AudioRendererHost and add hooks for test (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/renderer_host/audio_renderer_host.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/renderer_host/audio_renderer_host.cc
===================================================================
--- chrome/browser/renderer_host/audio_renderer_host.cc (revision 20328)
+++ chrome/browser/renderer_host/audio_renderer_host.cc (working copy)
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -70,10 +70,12 @@
buffer_capacity_(buffer_capacity),
state_(AudioOutputStream::STATE_CREATED),
push_source_(hardware_packet_size),
- outstanding_request_(false) {
+ outstanding_request_(false),
+ last_copied_bytes_(0) {
}
AudioRendererHost::IPCAudioSource::~IPCAudioSource() {
+ DCHECK_EQ(AudioOutputStream::STATE_STOPPED, state_);
}
// static
@@ -253,7 +255,7 @@
AutoLock auto_lock(lock_);
outstanding_request_ = false;
#ifdef IPC_MESSAGE_LOG_ENABLED
- if (IPC::Logging::current()->Enabled()) {
+ if (IPC::Logging::current() && IPC::Logging::current()->Enabled()) {
RecordRoundTripLatency(base::Time::Now() - outstanding_request_time_);
}
#endif
@@ -339,6 +341,7 @@
}
AudioRendererHost::~AudioRendererHost() {
+ DCHECK(sources_.empty());
}
void AudioRendererHost::Destroy() {
@@ -491,7 +494,7 @@
SendErrorMessage(msg.routing_id(), stream_id, 0);
}
#ifdef IPC_MESSAGE_LOG_ENABLED
- if (IPC::Logging::current()->Enabled()) {
+ if (IPC::Logging::current() && IPC::Logging::current()->Enabled()) {
RecordReceiveLatency(base::Time::FromInternalValue(msg.received_time()) -
base::Time::FromInternalValue(msg.sent_time()));
RecordProcessTime(base::Time::Now() -
« no previous file with comments | « chrome/browser/renderer_host/audio_renderer_host.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698