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

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

Issue 1180613007: Allow larger arrays up to size 8192 for PeriodicWave (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 5 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 | Annotate | Revision Log
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 559 matching lines...) Expand 10 before | Expand all | Expand 10 after
570 return nullptr; 570 return nullptr;
571 } 571 }
572 572
573 if (!imag) { 573 if (!imag) {
574 exceptionState.throwDOMException( 574 exceptionState.throwDOMException(
575 SyntaxError, 575 SyntaxError,
576 "invalid imaginary array"); 576 "invalid imaginary array");
577 return nullptr; 577 return nullptr;
578 } 578 }
579 579
580 if (real->length() > PeriodicWave::kMaxPeriodicWaveArraySize) {
581 exceptionState.throwDOMException(
582 IndexSizeError,
583 ExceptionMessages::indexOutsideRange(
584 "length of the real part array",
585 real->length(),
586 1u,
587 ExceptionMessages::InclusiveBound,
588 PeriodicWave::kMaxPeriodicWaveArraySize,
589 ExceptionMessages::InclusiveBound));
590 return nullptr;
591 }
592
593 if (imag->length() > PeriodicWave::kMaxPeriodicWaveArraySize) {
594 exceptionState.throwDOMException(
595 IndexSizeError,
596 ExceptionMessages::indexOutsideRange(
597 "length of the imaginary part array",
598 imag->length(),
599 1u,
600 ExceptionMessages::InclusiveBound,
601 PeriodicWave::kMaxPeriodicWaveArraySize,
602 ExceptionMessages::InclusiveBound));
603 return nullptr;
604 }
605
606 if (real->length() != imag->length()) { 580 if (real->length() != imag->length()) {
607 exceptionState.throwDOMException( 581 exceptionState.throwDOMException(
608 IndexSizeError, 582 IndexSizeError,
609 "length of real array (" + String::number(real->length()) 583 "length of real array (" + String::number(real->length())
610 + ") and length of imaginary array (" + String::number(imag->length ()) 584 + ") and length of imaginary array (" + String::number(imag->length ())
611 + ") must match."); 585 + ") must match.");
612 return nullptr; 586 return nullptr;
613 } 587 }
614 588
615 return PeriodicWave::create(sampleRate(), real, imag); 589 return PeriodicWave::create(sampleRate(), real, imag);
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
873 { 847 {
874 if (executionContext()) 848 if (executionContext())
875 return executionContext()->securityOrigin(); 849 return executionContext()->securityOrigin();
876 850
877 return nullptr; 851 return nullptr;
878 } 852 }
879 853
880 } // namespace blink 854 } // namespace blink
881 855
882 #endif // ENABLE(WEB_AUDIO) 856 #endif // ENABLE(WEB_AUDIO)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698