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

Side by Side Diff: Source/modules/webaudio/AudioBufferSourceNode.cpp

Issue 50363005: Check that buffer exists before trying to get its duration. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « LayoutTests/webaudio/dom-exceptions-expected.txt ('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) 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 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 m_buffer = buffer; 376 m_buffer = buffer;
377 } 377 }
378 378
379 unsigned AudioBufferSourceNode::numberOfChannels() 379 unsigned AudioBufferSourceNode::numberOfChannels()
380 { 380 {
381 return output(0)->numberOfChannels(); 381 return output(0)->numberOfChannels();
382 } 382 }
383 383
384 void AudioBufferSourceNode::start(double when) 384 void AudioBufferSourceNode::start(double when)
385 { 385 {
386 startPlaying(false, when, 0, buffer()->duration()); 386 startPlaying(false, when, 0, buffer() ? buffer()->duration() : 0);
387 } 387 }
388 388
389 void AudioBufferSourceNode::start(double when, double grainOffset) 389 void AudioBufferSourceNode::start(double when, double grainOffset)
390 { 390 {
391 startPlaying(true, when, grainOffset, buffer()->duration()); 391 startPlaying(true, when, grainOffset, buffer() ? buffer()->duration() : 0);
392 } 392 }
393 393
394 void AudioBufferSourceNode::start(double when, double grainOffset, double grainD uration) 394 void AudioBufferSourceNode::start(double when, double grainOffset, double grainD uration)
395 { 395 {
396 startPlaying(true, when, grainOffset, grainDuration); 396 startPlaying(true, when, grainOffset, grainDuration);
397 } 397 }
398 398
399 void AudioBufferSourceNode::startPlaying(bool isGrain, double when, double grain Offset, double grainDuration) 399 void AudioBufferSourceNode::startPlaying(bool isGrain, double when, double grain Offset, double grainDuration)
400 { 400 {
401 ASSERT(isMainThread()); 401 ASSERT(isMainThread());
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 void AudioBufferSourceNode::finish() 505 void AudioBufferSourceNode::finish()
506 { 506 {
507 clearPannerNode(); 507 clearPannerNode();
508 ASSERT(!m_pannerNode); 508 ASSERT(!m_pannerNode);
509 AudioScheduledSourceNode::finish(); 509 AudioScheduledSourceNode::finish();
510 } 510 }
511 511
512 } // namespace WebCore 512 } // namespace WebCore
513 513
514 #endif // ENABLE(WEB_AUDIO) 514 #endif // ENABLE(WEB_AUDIO)
OLDNEW
« no previous file with comments | « LayoutTests/webaudio/dom-exceptions-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698