OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010, Google Inc. All rights reserved. | 2 * Copyright (C) 2010, Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 21 matching lines...) Expand all Loading... |
32 | 32 |
33 namespace blink { | 33 namespace blink { |
34 class AudioBus : public ThreadSafeRefCounted<AudioBus> { | 34 class AudioBus : public ThreadSafeRefCounted<AudioBus> { |
35 }; | 35 }; |
36 } // namespace blink | 36 } // namespace blink |
37 #endif | 37 #endif |
38 | 38 |
39 #include "wtf/PassRefPtr.h" | 39 #include "wtf/PassRefPtr.h" |
40 #include "wtf/RefPtr.h" | 40 #include "wtf/RefPtr.h" |
41 | 41 |
42 using namespace blink; | |
43 | |
44 namespace blink { | 42 namespace blink { |
45 | 43 |
46 class WebAudioBusPrivate : public AudioBus { | 44 class WebAudioBusPrivate : public AudioBus { |
47 }; | 45 }; |
48 | 46 |
49 void WebAudioBus::initialize(unsigned numberOfChannels, size_t length, double sa
mpleRate) | 47 void WebAudioBus::initialize(unsigned numberOfChannels, size_t length, double sa
mpleRate) |
50 { | 48 { |
51 #if ENABLE(WEB_AUDIO) | 49 #if ENABLE(WEB_AUDIO) |
52 RefPtr<AudioBus> audioBus = AudioBus::create(numberOfChannels, length); | 50 RefPtr<AudioBus> audioBus = AudioBus::create(numberOfChannels, length); |
53 audioBus->setSampleRate(sampleRate); | 51 audioBus->setSampleRate(sampleRate); |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 RefPtr<AudioBus> audioBus(adoptRef(static_cast<AudioBus*>(m_private))); | 140 RefPtr<AudioBus> audioBus(adoptRef(static_cast<AudioBus*>(m_private))); |
143 m_private = 0; | 141 m_private = 0; |
144 return audioBus; | 142 return audioBus; |
145 #else | 143 #else |
146 ASSERT_NOT_REACHED(); | 144 ASSERT_NOT_REACHED(); |
147 return nullptr; | 145 return nullptr; |
148 #endif | 146 #endif |
149 } | 147 } |
150 | 148 |
151 } // namespace blink | 149 } // namespace blink |
OLD | NEW |