| 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 18 matching lines...) Expand all Loading... |
| 29 #include "bindings/core/v8/ExceptionMessages.h" | 29 #include "bindings/core/v8/ExceptionMessages.h" |
| 30 #include "bindings/core/v8/ExceptionState.h" | 30 #include "bindings/core/v8/ExceptionState.h" |
| 31 #include "bindings/core/v8/ExceptionStatePlaceholder.h" | 31 #include "bindings/core/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 blink; | 35 using namespace blink; |
| 36 | 36 |
| 37 TimeRanges::TimeRanges(double start, double end) | 37 TimeRanges::TimeRanges(double start, double end) |
| 38 { | 38 { |
| 39 ScriptWrappable::init(this); | |
| 40 add(start, end); | 39 add(start, end); |
| 41 } | 40 } |
| 42 | 41 |
| 43 PassRefPtrWillBeRawPtr<TimeRanges> TimeRanges::create(const blink::WebTimeRanges
& webRanges) | 42 PassRefPtrWillBeRawPtr<TimeRanges> TimeRanges::create(const blink::WebTimeRanges
& webRanges) |
| 44 { | 43 { |
| 45 RefPtrWillBeRawPtr<TimeRanges> ranges = TimeRanges::create(); | 44 RefPtrWillBeRawPtr<TimeRanges> ranges = TimeRanges::create(); |
| 46 | 45 |
| 47 unsigned size = webRanges.size(); | 46 unsigned size = webRanges.size(); |
| 48 for (unsigned i = 0; i < size; ++i) | 47 for (unsigned i = 0; i < size; ++i) |
| 49 ranges->add(webRanges[i].start, webRanges[i].end); | 48 ranges->add(webRanges[i].start, webRanges[i].end); |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 else if (fabs(endTime - time) < closest) | 196 else if (fabs(endTime - time) < closest) |
| 198 closest = fabs(endTime - time); | 197 closest = fabs(endTime - time); |
| 199 } | 198 } |
| 200 return closest; | 199 return closest; |
| 201 } | 200 } |
| 202 | 201 |
| 203 void TimeRanges::trace(Visitor* visitor) | 202 void TimeRanges::trace(Visitor* visitor) |
| 204 { | 203 { |
| 205 visitor->trace(m_ranges); | 204 visitor->trace(m_ranges); |
| 206 } | 205 } |
| OLD | NEW |