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 728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
739 } | 739 } |
740 | 740 |
741 if (newState == m_contextState) { | 741 if (newState == m_contextState) { |
742 // ASSERTs above failed; just return. | 742 // ASSERTs above failed; just return. |
743 return; | 743 return; |
744 } | 744 } |
745 | 745 |
746 m_contextState = newState; | 746 m_contextState = newState; |
747 | 747 |
748 // Notify context that state changed | 748 // Notify context that state changed |
749 if (executionContext()) | 749 if (getExecutionContext()) |
750 executionContext()->postTask(BLINK_FROM_HERE, createSameThreadTask(&Abst
ractAudioContext::notifyStateChange, this)); | 750 getExecutionContext()->postTask(BLINK_FROM_HERE, createSameThreadTask(&A
bstractAudioContext::notifyStateChange, this)); |
751 } | 751 } |
752 | 752 |
753 void AbstractAudioContext::notifyStateChange() | 753 void AbstractAudioContext::notifyStateChange() |
754 { | 754 { |
755 dispatchEvent(Event::create(EventTypeNames::statechange)); | 755 dispatchEvent(Event::create(EventTypeNames::statechange)); |
756 } | 756 } |
757 | 757 |
758 void AbstractAudioContext::notifySourceNodeFinishedProcessing(AudioHandler* hand
ler) | 758 void AbstractAudioContext::notifySourceNodeFinishedProcessing(AudioHandler* hand
ler) |
759 { | 759 { |
760 ASSERT(isAudioThread()); | 760 ASSERT(isAudioThread()); |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
897 for (auto& resolver : m_decodeAudioResolvers) | 897 for (auto& resolver : m_decodeAudioResolvers) |
898 resolver->reject(DOMException::create(InvalidStateError, "Audio context
is going away")); | 898 resolver->reject(DOMException::create(InvalidStateError, "Audio context
is going away")); |
899 m_decodeAudioResolvers.clear(); | 899 m_decodeAudioResolvers.clear(); |
900 } | 900 } |
901 | 901 |
902 const AtomicString& AbstractAudioContext::interfaceName() const | 902 const AtomicString& AbstractAudioContext::interfaceName() const |
903 { | 903 { |
904 return EventTargetNames::AudioContext; | 904 return EventTargetNames::AudioContext; |
905 } | 905 } |
906 | 906 |
907 ExecutionContext* AbstractAudioContext::executionContext() const | 907 ExecutionContext* AbstractAudioContext::getExecutionContext() const |
908 { | 908 { |
909 return ActiveDOMObject::executionContext(); | 909 return ActiveDOMObject::getExecutionContext(); |
910 } | 910 } |
911 | 911 |
912 void AbstractAudioContext::startRendering() | 912 void AbstractAudioContext::startRendering() |
913 { | 913 { |
914 // This is called for both online and offline contexts. | 914 // This is called for both online and offline contexts. |
915 ASSERT(isMainThread()); | 915 ASSERT(isMainThread()); |
916 ASSERT(m_destinationNode); | 916 ASSERT(m_destinationNode); |
917 | 917 |
918 if (m_contextState == Suspended) { | 918 if (m_contextState == Suspended) { |
919 destination()->audioDestinationHandler().startRendering(); | 919 destination()->audioDestinationHandler().startRendering(); |
(...skipping 17 matching lines...) Expand all Loading... |
937 visitor->trace(m_decodeAudioResolvers); | 937 visitor->trace(m_decodeAudioResolvers); |
938 | 938 |
939 visitor->trace(m_periodicWaveSine); | 939 visitor->trace(m_periodicWaveSine); |
940 visitor->trace(m_periodicWaveSquare); | 940 visitor->trace(m_periodicWaveSquare); |
941 visitor->trace(m_periodicWaveSawtooth); | 941 visitor->trace(m_periodicWaveSawtooth); |
942 visitor->trace(m_periodicWaveTriangle); | 942 visitor->trace(m_periodicWaveTriangle); |
943 RefCountedGarbageCollectedEventTargetWithInlineData<AbstractAudioContext>::t
race(visitor); | 943 RefCountedGarbageCollectedEventTargetWithInlineData<AbstractAudioContext>::t
race(visitor); |
944 ActiveDOMObject::trace(visitor); | 944 ActiveDOMObject::trace(visitor); |
945 } | 945 } |
946 | 946 |
947 SecurityOrigin* AbstractAudioContext::securityOrigin() const | 947 SecurityOrigin* AbstractAudioContext::getSecurityOrigin() const |
948 { | 948 { |
949 if (executionContext()) | 949 if (getExecutionContext()) |
950 return executionContext()->securityOrigin(); | 950 return getExecutionContext()->getSecurityOrigin(); |
951 | 951 |
952 return nullptr; | 952 return nullptr; |
953 } | 953 } |
954 | 954 |
955 } // namespace blink | 955 } // namespace blink |
956 | 956 |
OLD | NEW |