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

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

Issue 2807313002: Allow Panner.refDistance to be 0 (Closed)
Patch Set: Adjust test to support cases where 0 is allowed (or not) Created 3 years, 8 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
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 730 matching lines...) Expand 10 before | Expand all | Expand 10 after
741 void PannerNode::setDistanceModel(const String& model) { 741 void PannerNode::setDistanceModel(const String& model) {
742 GetPannerHandler().SetDistanceModel(model); 742 GetPannerHandler().SetDistanceModel(model);
743 } 743 }
744 744
745 double PannerNode::refDistance() const { 745 double PannerNode::refDistance() const {
746 return GetPannerHandler().RefDistance(); 746 return GetPannerHandler().RefDistance();
747 } 747 }
748 748
749 void PannerNode::setRefDistance(double distance, 749 void PannerNode::setRefDistance(double distance,
750 ExceptionState& exception_state) { 750 ExceptionState& exception_state) {
751 if (distance <= 0) { 751 if (distance < 0) {
752 exception_state.ThrowDOMException( 752 exception_state.ThrowDOMException(
753 kV8RangeError, ExceptionMessages::IndexExceedsMinimumBound<double>( 753 kV8RangeError, ExceptionMessages::IndexExceedsMinimumBound<double>(
754 "refDistance", distance, 0)); 754 "refDistance", distance, 0));
755 return; 755 return;
756 } 756 }
757 757
758 GetPannerHandler().SetRefDistance(distance); 758 GetPannerHandler().SetRefDistance(distance);
759 } 759 }
760 760
761 double PannerNode::maxDistance() const { 761 double PannerNode::maxDistance() const {
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
812 visitor->Trace(position_z_); 812 visitor->Trace(position_z_);
813 813
814 visitor->Trace(orientation_x_); 814 visitor->Trace(orientation_x_);
815 visitor->Trace(orientation_y_); 815 visitor->Trace(orientation_y_);
816 visitor->Trace(orientation_z_); 816 visitor->Trace(orientation_z_);
817 817
818 AudioNode::Trace(visitor); 818 AudioNode::Trace(visitor);
819 } 819 }
820 820
821 } // namespace blink 821 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698