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

Side by Side Diff: third_party/WebKit/Source/modules/webaudio/AbstractAudioContext.cpp

Issue 1820403002: Implement Automations for PannerNode and AutioListener (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase UseCounter.h Created 4 years, 7 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 unified diff | Download patch
OLDNEW
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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 ASSERT(!m_isResolvingResumePromises); 131 ASSERT(!m_isResolvingResumePromises);
132 ASSERT(!m_resumeResolvers.size()); 132 ASSERT(!m_resumeResolvers.size());
133 } 133 }
134 134
135 void AbstractAudioContext::initialize() 135 void AbstractAudioContext::initialize()
136 { 136 {
137 if (isDestinationInitialized()) 137 if (isDestinationInitialized())
138 return; 138 return;
139 139
140 FFTFrame::initialize(); 140 FFTFrame::initialize();
141 m_listener = AudioListener::create(); 141 m_listener = AudioListener::create(*this);
142 142
143 if (m_destinationNode.get()) { 143 if (m_destinationNode.get()) {
144 m_destinationNode->handler().initialize(); 144 m_destinationNode->handler().initialize();
145 } 145 }
146 } 146 }
147 147
148 void AbstractAudioContext::clear() 148 void AbstractAudioContext::clear()
149 { 149 {
150 m_destinationNode.clear(); 150 m_destinationNode.clear();
151 // The audio rendering thread is dead. Nobody will schedule AudioHandler 151 // The audio rendering thread is dead. Nobody will schedule AudioHandler
(...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after
826 // At the beginning of every render quantum, try to update the internal rend ering graph state (from main thread changes). 826 // At the beginning of every render quantum, try to update the internal rend ering graph state (from main thread changes).
827 // It's OK if the tryLock() fails, we'll just take slightly longer to pick u p the changes. 827 // It's OK if the tryLock() fails, we'll just take slightly longer to pick u p the changes.
828 if (tryLock()) { 828 if (tryLock()) {
829 deferredTaskHandler().handleDeferredTasks(); 829 deferredTaskHandler().handleDeferredTasks();
830 830
831 resolvePromisesForResume(); 831 resolvePromisesForResume();
832 832
833 // Check to see if source nodes can be stopped because the end time has passed. 833 // Check to see if source nodes can be stopped because the end time has passed.
834 handleStoppableSourceNodes(); 834 handleStoppableSourceNodes();
835 835
836 // Update the dirty state of the listener.
837 listener()->updateState();
838
836 unlock(); 839 unlock();
837 } 840 }
838 } 841 }
839 842
840 void AbstractAudioContext::handlePostRenderTasks() 843 void AbstractAudioContext::handlePostRenderTasks()
841 { 844 {
842 ASSERT(isAudioThread()); 845 ASSERT(isAudioThread());
843 846
844 // Must use a tryLock() here too. Don't worry, the lock will very rarely be contended and this method is called frequently. 847 // Must use a tryLock() here too. Don't worry, the lock will very rarely be contended and this method is called frequently.
845 // The worst that can happen is that there will be some nodes which will tak e slightly longer than usual to be deleted or removed 848 // The worst that can happen is that there will be some nodes which will tak e slightly longer than usual to be deleted or removed
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
957 SecurityOrigin* AbstractAudioContext::getSecurityOrigin() const 960 SecurityOrigin* AbstractAudioContext::getSecurityOrigin() const
958 { 961 {
959 if (getExecutionContext()) 962 if (getExecutionContext())
960 return getExecutionContext()->getSecurityOrigin(); 963 return getExecutionContext()->getSecurityOrigin();
961 964
962 return nullptr; 965 return nullptr;
963 } 966 }
964 967
965 } // namespace blink 968 } // namespace blink
966 969
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698