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

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

Issue 1951903003: Assert destination handler exists in AudioParam (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « third_party/WebKit/Source/modules/webaudio/AudioParam.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012, Google Inc. All rights reserved. 2 * Copyright (C) 2012, 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 : AbstractAudioContext(document, numberOfChannels, numberOfFrames, sampleRat e) 97 : AbstractAudioContext(document, numberOfChannels, numberOfFrames, sampleRat e)
98 , m_isRenderingStarted(false) 98 , m_isRenderingStarted(false)
99 , m_totalRenderFrames(numberOfFrames) 99 , m_totalRenderFrames(numberOfFrames)
100 { 100 {
101 // Create a new destination for offline rendering. 101 // Create a new destination for offline rendering.
102 m_renderTarget = AudioBuffer::create(numberOfChannels, numberOfFrames, sampl eRate); 102 m_renderTarget = AudioBuffer::create(numberOfChannels, numberOfFrames, sampl eRate);
103 103
104 // Throw an exception if the render target is not ready. 104 // Throw an exception if the render target is not ready.
105 if (m_renderTarget) { 105 if (m_renderTarget) {
106 m_destinationNode = OfflineAudioDestinationNode::create(this, m_renderTa rget.get()); 106 m_destinationNode = OfflineAudioDestinationNode::create(this, m_renderTa rget.get());
107 initialize();
107 } else { 108 } else {
108 exceptionState.throwRangeError(ExceptionMessages::failedToConstruct( 109 exceptionState.throwRangeError(ExceptionMessages::failedToConstruct(
109 "OfflineAudioContext", 110 "OfflineAudioContext",
110 "failed to create OfflineAudioContext(" + 111 "failed to create OfflineAudioContext(" +
111 String::number(numberOfChannels) + ", " + 112 String::number(numberOfChannels) + ", " +
112 String::number(numberOfFrames) + ", " + 113 String::number(numberOfFrames) + ", " +
113 String::number(sampleRate) + ")")); 114 String::number(sampleRate) + ")"));
114 } 115 }
115
116 initialize();
117 } 116 }
118 117
119 OfflineAudioContext::~OfflineAudioContext() 118 OfflineAudioContext::~OfflineAudioContext()
120 { 119 {
121 } 120 }
122 121
123 DEFINE_TRACE(OfflineAudioContext) 122 DEFINE_TRACE(OfflineAudioContext)
124 { 123 {
125 visitor->trace(m_renderTarget); 124 visitor->trace(m_renderTarget);
126 visitor->trace(m_completeResolver); 125 visitor->trace(m_completeResolver);
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 // Note that the GraphLock is required before this check. Since this needs 412 // Note that the GraphLock is required before this check. Since this needs
414 // to run on the audio thread, OfflineGraphAutoLocker must be used. 413 // to run on the audio thread, OfflineGraphAutoLocker must be used.
415 if (m_scheduledSuspends.contains(currentSampleFrame())) 414 if (m_scheduledSuspends.contains(currentSampleFrame()))
416 return true; 415 return true;
417 416
418 return false; 417 return false;
419 } 418 }
420 419
421 } // namespace blink 420 } // namespace blink
422 421
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/webaudio/AudioParam.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698