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

Side by Side Diff: Source/core/rendering/RenderMediaControls.cpp

Issue 101763008: Fix some problems reported by clang static analyzer (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 11 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/rendering/RenderLayer.cpp ('k') | Source/core/rendering/svg/SVGInlineTextBox.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) 2009 Apple Inc. 2 * Copyright (C) 2009 Apple Inc.
3 * Copyright (C) 2009 Google Inc. 3 * Copyright (C) 2009 Google Inc.
4 * All rights reserved. 4 * All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 int startOffset = startPosition; 149 int startOffset = startPosition;
150 int endOffset = rect.width() - endPosition; 150 int endOffset = rect.width() - endPosition;
151 int rangeWidth = endPosition - startPosition; 151 int rangeWidth = endPosition - startPosition;
152 152
153 if (rangeWidth <= 0) 153 if (rangeWidth <= 0)
154 return; 154 return;
155 155
156 // Make sure the range width is bigger than border radius at the edges to re tain rounded corners. 156 // Make sure the range width is bigger than border radius at the edges to re tain rounded corners.
157 if (startOffset < borderRadius && rangeWidth < borderRadius) 157 if (startOffset < borderRadius && rangeWidth < borderRadius)
158 rangeWidth = borderRadius; 158 rangeWidth = borderRadius;
159 if (endOffset < borderRadius && rangeWidth < borderRadius) { 159 if (endOffset < borderRadius && rangeWidth < borderRadius)
160 startPosition -= borderRadius - rangeWidth;
161 rangeWidth = borderRadius; 160 rangeWidth = borderRadius;
162 }
163 161
164 // Set rectangle to highlight range. 162 // Set rectangle to highlight range.
165 IntRect highlightRect = rect; 163 IntRect highlightRect = rect;
166 highlightRect.move(startOffset, 0); 164 highlightRect.move(startOffset, 0);
167 highlightRect.setWidth(rangeWidth); 165 highlightRect.setWidth(rangeWidth);
168 166
169 // Don't bother drawing an empty area. 167 // Don't bother drawing an empty area.
170 if (highlightRect.isEmpty()) 168 if (highlightRect.isEmpty())
171 return; 169 return;
172 170
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 { 441 {
444 return formatChromiumMediaControlsTime(time, time); 442 return formatChromiumMediaControlsTime(time, time);
445 } 443 }
446 444
447 String RenderMediaControls::formatMediaControlsCurrentTime(float currentTime, fl oat duration) 445 String RenderMediaControls::formatMediaControlsCurrentTime(float currentTime, fl oat duration)
448 { 446 {
449 return formatChromiumMediaControlsTime(currentTime, duration); 447 return formatChromiumMediaControlsTime(currentTime, duration);
450 } 448 }
451 449
452 } // namespace WebCore 450 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderLayer.cpp ('k') | Source/core/rendering/svg/SVGInlineTextBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698