| 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 BaseAudioContext* BaseAudioContext::create(Document& document, | 82 BaseAudioContext* BaseAudioContext::create(Document& document, |
| 83 ExceptionState& exceptionState) { | 83 ExceptionState& exceptionState) { |
| 84 return AudioContext::create(document, exceptionState); | 84 return AudioContext::create(document, exceptionState); |
| 85 } | 85 } |
| 86 | 86 |
| 87 // FIXME(dominicc): Devolve these constructors to AudioContext | 87 // FIXME(dominicc): Devolve these constructors to AudioContext |
| 88 // and OfflineAudioContext respectively. | 88 // and OfflineAudioContext respectively. |
| 89 | 89 |
| 90 // Constructor for rendering to the audio hardware. | 90 // Constructor for rendering to the audio hardware. |
| 91 BaseAudioContext::BaseAudioContext(Document* document) | 91 BaseAudioContext::BaseAudioContext(Document* document) |
| 92 : ActiveScriptWrappable<BaseAudioContext>(this), | 92 : SuspendableObject(document), |
| 93 SuspendableObject(document), | |
| 94 m_destinationNode(nullptr), | 93 m_destinationNode(nullptr), |
| 95 m_isCleared(false), | 94 m_isCleared(false), |
| 96 m_isResolvingResumePromises(false), | 95 m_isResolvingResumePromises(false), |
| 97 m_userGestureRequired(false), | 96 m_userGestureRequired(false), |
| 98 m_connectionCount(0), | 97 m_connectionCount(0), |
| 99 m_deferredTaskHandler(DeferredTaskHandler::create()), | 98 m_deferredTaskHandler(DeferredTaskHandler::create()), |
| 100 m_contextState(Suspended), | 99 m_contextState(Suspended), |
| 101 m_closedContextSampleRate(-1), | 100 m_closedContextSampleRate(-1), |
| 102 m_periodicWaveSine(nullptr), | 101 m_periodicWaveSine(nullptr), |
| 103 m_periodicWaveSquare(nullptr), | 102 m_periodicWaveSquare(nullptr), |
| (...skipping 11 matching lines...) Expand all Loading... |
| 115 m_destinationNode = DefaultAudioDestinationNode::create(this); | 114 m_destinationNode = DefaultAudioDestinationNode::create(this); |
| 116 | 115 |
| 117 initialize(); | 116 initialize(); |
| 118 } | 117 } |
| 119 | 118 |
| 120 // Constructor for offline (non-realtime) rendering. | 119 // Constructor for offline (non-realtime) rendering. |
| 121 BaseAudioContext::BaseAudioContext(Document* document, | 120 BaseAudioContext::BaseAudioContext(Document* document, |
| 122 unsigned numberOfChannels, | 121 unsigned numberOfChannels, |
| 123 size_t numberOfFrames, | 122 size_t numberOfFrames, |
| 124 float sampleRate) | 123 float sampleRate) |
| 125 : ActiveScriptWrappable(this), | 124 : SuspendableObject(document), |
| 126 SuspendableObject(document), | |
| 127 m_destinationNode(nullptr), | 125 m_destinationNode(nullptr), |
| 128 m_isCleared(false), | 126 m_isCleared(false), |
| 129 m_isResolvingResumePromises(false), | 127 m_isResolvingResumePromises(false), |
| 130 m_userGestureRequired(false), | 128 m_userGestureRequired(false), |
| 131 m_connectionCount(0), | 129 m_connectionCount(0), |
| 132 m_deferredTaskHandler(DeferredTaskHandler::create()), | 130 m_deferredTaskHandler(DeferredTaskHandler::create()), |
| 133 m_contextState(Suspended), | 131 m_contextState(Suspended), |
| 134 m_closedContextSampleRate(-1), | 132 m_closedContextSampleRate(-1), |
| 135 m_periodicWaveSine(nullptr), | 133 m_periodicWaveSine(nullptr), |
| 136 m_periodicWaveSquare(nullptr), | 134 m_periodicWaveSquare(nullptr), |
| (...skipping 744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 881 } | 879 } |
| 882 | 880 |
| 883 SecurityOrigin* BaseAudioContext::getSecurityOrigin() const { | 881 SecurityOrigin* BaseAudioContext::getSecurityOrigin() const { |
| 884 if (getExecutionContext()) | 882 if (getExecutionContext()) |
| 885 return getExecutionContext()->getSecurityOrigin(); | 883 return getExecutionContext()->getSecurityOrigin(); |
| 886 | 884 |
| 887 return nullptr; | 885 return nullptr; |
| 888 } | 886 } |
| 889 | 887 |
| 890 } // namespace blink | 888 } // namespace blink |
| OLD | NEW |