OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "base/histogram.h" | 5 #include "base/histogram.h" |
6 #include "base/lock.h" | 6 #include "base/lock.h" |
7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
8 #include "base/process.h" | 8 #include "base/process.h" |
9 #include "base/shared_memory.h" | 9 #include "base/shared_memory.h" |
10 #include "base/waitable_event.h" | 10 #include "base/waitable_event.h" |
11 #include "chrome/browser/renderer_host/audio_renderer_host.h" | 11 #include "chrome/browser/renderer_host/audio_renderer_host.h" |
12 #include "chrome/common/ipc_logging.h" | |
13 #include "chrome/common/render_messages.h" | 12 #include "chrome/common/render_messages.h" |
| 13 #include "ipc/ipc_logging.h" |
14 | 14 |
15 namespace { | 15 namespace { |
16 | 16 |
17 void RecordRoundTripLatency(base::TimeDelta latency) { | 17 void RecordRoundTripLatency(base::TimeDelta latency) { |
18 static ThreadSafeHistogram histogram("Audio.IPC_RoundTripLatency", | 18 static ThreadSafeHistogram histogram("Audio.IPC_RoundTripLatency", |
19 1, 1000, 100); | 19 1, 1000, 100); |
20 histogram.AddTime(latency); | 20 histogram.AddTime(latency); |
21 } | 21 } |
22 | 22 |
23 void RecordReceiveLatency(base::TimeDelta latency) { | 23 void RecordReceiveLatency(base::TimeDelta latency) { |
(...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
580 if (MessageLoop::current() == io_loop_) { | 580 if (MessageLoop::current() == io_loop_) { |
581 OnDestroySource(source); | 581 OnDestroySource(source); |
582 } else { | 582 } else { |
583 // TODO(hclam): make sure it's always safe to post a task to IO loop. | 583 // TODO(hclam): make sure it's always safe to post a task to IO loop. |
584 // It is possible that IO message loop is destroyed but there's still some | 584 // It is possible that IO message loop is destroyed but there's still some |
585 // dangling audio hardware threads that try to call this method. | 585 // dangling audio hardware threads that try to call this method. |
586 io_loop_->PostTask(FROM_HERE, | 586 io_loop_->PostTask(FROM_HERE, |
587 NewRunnableMethod(this, &AudioRendererHost::OnDestroySource, source)); | 587 NewRunnableMethod(this, &AudioRendererHost::OnDestroySource, source)); |
588 } | 588 } |
589 } | 589 } |
OLD | NEW |