OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
168 return TimeRanges::create(m_webSourceBuffer->buffered()); | 168 return TimeRanges::create(m_webSourceBuffer->buffered()); |
169 } | 169 } |
170 | 170 |
171 double SourceBuffer::timestampOffset() const | 171 double SourceBuffer::timestampOffset() const |
172 { | 172 { |
173 return m_timestampOffset; | 173 return m_timestampOffset; |
174 } | 174 } |
175 | 175 |
176 void SourceBuffer::setTimestampOffset(double offset, ExceptionState& exceptionSt ate) | 176 void SourceBuffer::setTimestampOffset(double offset, ExceptionState& exceptionSt ate) |
177 { | 177 { |
178 // Enforce throwing an exception on restricted double values. | |
179 if (!std::isfinite(offset)) { | |
180 exceptionState.throwDOMException(TypeMismatchError, ExceptionMessages::n otAFiniteNumber(offset)); | |
sof
2014/03/22 07:51:23
This isn't quite right per WebIDL, infinities and
| |
181 return; | |
182 } | |
183 | |
178 // Section 3.1 timestampOffset attribute setter steps. | 184 // Section 3.1 timestampOffset attribute setter steps. |
179 // 1. Let new timestamp offset equal the new value being assigned to this at tribute. | 185 // 1. Let new timestamp offset equal the new value being assigned to this at tribute. |
180 // 2. If this object has been removed from the sourceBuffers attribute of th e parent media source, then throw an | 186 // 2. If this object has been removed from the sourceBuffers attribute of th e parent media source, then throw an |
181 // InvalidStateError exception and abort these steps. | 187 // InvalidStateError exception and abort these steps. |
182 // 3. If the updating attribute equals true, then throw an InvalidStateError exception and abort these steps. | 188 // 3. If the updating attribute equals true, then throw an InvalidStateError exception and abort these steps. |
183 if (throwExceptionIfRemovedOrUpdating(isRemoved(), m_updating, exceptionStat e)) | 189 if (throwExceptionIfRemovedOrUpdating(isRemoved(), m_updating, exceptionStat e)) |
184 return; | 190 return; |
185 | 191 |
186 // 4. If the readyState attribute of the parent media source is in the "ende d" state then run the following steps: | 192 // 4. If the readyState attribute of the parent media source is in the "ende d" state then run the following steps: |
187 // 4.1 Set the readyState attribute of the parent media source to "open" | 193 // 4.1 Set the readyState attribute of the parent media source to "open" |
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
703 appendStreamDone(false); | 709 appendStreamDone(false); |
704 } | 710 } |
705 | 711 |
706 void SourceBuffer::trace(Visitor* visitor) | 712 void SourceBuffer::trace(Visitor* visitor) |
707 { | 713 { |
708 visitor->trace(m_source); | 714 visitor->trace(m_source); |
709 visitor->trace(m_stream); | 715 visitor->trace(m_stream); |
710 } | 716 } |
711 | 717 |
712 } // namespace WebCore | 718 } // namespace WebCore |
OLD | NEW |