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

Side by Side Diff: Source/core/html/TimeRanges.cpp

Issue 207783002: Omit "int" when using "unsigned" modifier (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 9 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
« no previous file with comments | « Source/core/html/HTMLObjectElement.cpp ('k') | Source/core/html/canvas/WebGLFramebuffer.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 if (index >= length()) { 128 if (index >= length()) {
129 exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::inde xExceedsMaximumBound("index", index, length())); 129 exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::inde xExceedsMaximumBound("index", index, length()));
130 return 0; 130 return 0;
131 } 131 }
132 return m_ranges[index].m_end; 132 return m_ranges[index].m_end;
133 } 133 }
134 134
135 void TimeRanges::add(double start, double end) 135 void TimeRanges::add(double start, double end)
136 { 136 {
137 ASSERT(start <= end); 137 ASSERT(start <= end);
138 unsigned int overlappingArcIndex; 138 unsigned overlappingArcIndex;
139 Range addedRange(start, end); 139 Range addedRange(start, end);
140 140
141 // For each present range check if we need to: 141 // For each present range check if we need to:
142 // - merge with the added range, in case we are overlapping or contiguous 142 // - merge with the added range, in case we are overlapping or contiguous
143 // - Need to insert in place, we we are completely, not overlapping and not contiguous 143 // - Need to insert in place, we we are completely, not overlapping and not contiguous
144 // in between two ranges. 144 // in between two ranges.
145 // 145 //
146 // TODO: Given that we assume that ranges are correctly ordered, this could be optimized. 146 // TODO: Given that we assume that ranges are correctly ordered, this could be optimized.
147 147
148 for (overlappingArcIndex = 0; overlappingArcIndex < m_ranges.size(); overlap pingArcIndex++) { 148 for (overlappingArcIndex = 0; overlappingArcIndex < m_ranges.size(); overlap pingArcIndex++) {
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 double endTime = end(ndx, IGNORE_EXCEPTION); 193 double endTime = end(ndx, IGNORE_EXCEPTION);
194 if (time >= startTime && time <= endTime) 194 if (time >= startTime && time <= endTime)
195 return time; 195 return time;
196 if (fabs(startTime - time) < closest) 196 if (fabs(startTime - time) < closest)
197 closest = fabs(startTime - time); 197 closest = fabs(startTime - time);
198 else if (fabs(endTime - time) < closest) 198 else if (fabs(endTime - time) < closest)
199 closest = fabs(endTime - time); 199 closest = fabs(endTime - time);
200 } 200 }
201 return closest; 201 return closest;
202 } 202 }
OLDNEW
« no previous file with comments | « Source/core/html/HTMLObjectElement.cpp ('k') | Source/core/html/canvas/WebGLFramebuffer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698