OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2009, 2010 Apple 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 15 matching lines...) Expand all Loading... |
26 #include "config.h" | 26 #include "config.h" |
27 #include "core/html/TimeRanges.h" | 27 #include "core/html/TimeRanges.h" |
28 | 28 |
29 #include "bindings/v8/ExceptionMessages.h" | 29 #include "bindings/v8/ExceptionMessages.h" |
30 #include "bindings/v8/ExceptionState.h" | 30 #include "bindings/v8/ExceptionState.h" |
31 #include "bindings/v8/ExceptionStatePlaceholder.h" | 31 #include "bindings/v8/ExceptionStatePlaceholder.h" |
32 #include "core/dom/ExceptionCode.h" | 32 #include "core/dom/ExceptionCode.h" |
33 #include <math.h> | 33 #include <math.h> |
34 | 34 |
35 using namespace WebCore; | 35 using namespace WebCore; |
36 using namespace std; | |
37 | 36 |
38 TimeRanges::TimeRanges(double start, double end) | 37 TimeRanges::TimeRanges(double start, double end) |
39 { | 38 { |
40 ScriptWrappable::init(this); | 39 ScriptWrappable::init(this); |
41 add(start, end); | 40 add(start, end); |
42 } | 41 } |
43 | 42 |
44 PassRefPtr<TimeRanges> TimeRanges::create(const blink::WebTimeRanges& webRanges) | 43 PassRefPtr<TimeRanges> TimeRanges::create(const blink::WebTimeRanges& webRanges) |
45 { | 44 { |
46 RefPtr<TimeRanges> ranges = TimeRanges::create(); | 45 RefPtr<TimeRanges> ranges = TimeRanges::create(); |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 double endTime = end(ndx, IGNORE_EXCEPTION); | 192 double endTime = end(ndx, IGNORE_EXCEPTION); |
194 if (time >= startTime && time <= endTime) | 193 if (time >= startTime && time <= endTime) |
195 return time; | 194 return time; |
196 if (fabs(startTime - time) < closest) | 195 if (fabs(startTime - time) < closest) |
197 closest = fabs(startTime - time); | 196 closest = fabs(startTime - time); |
198 else if (fabs(endTime - time) < closest) | 197 else if (fabs(endTime - time) < closest) |
199 closest = fabs(endTime - time); | 198 closest = fabs(endTime - time); |
200 } | 199 } |
201 return closest; | 200 return closest; |
202 } | 201 } |
OLD | NEW |