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

Side by Side Diff: content/renderer/media/webmediaplayer_util.cc

Issue 119043002: Replacing post-increment with pre-increment for consistency (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years 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 | « AUTHORS ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/media/webmediaplayer_util.h" 5 #include "content/renderer/media/webmediaplayer_util.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 8
9 #include "media/base/media_keys.h" 9 #include "media/base/media_keys.h"
10 #include "third_party/WebKit/public/platform/WebMediaPlayerClient.h" 10 #include "third_party/WebKit/public/platform/WebMediaPlayerClient.h"
(...skipping 13 matching lines...) Expand all
24 24
25 base::TimeDelta ConvertSecondsToTimestamp(double seconds) { 25 base::TimeDelta ConvertSecondsToTimestamp(double seconds) {
26 double microseconds = seconds * base::Time::kMicrosecondsPerSecond; 26 double microseconds = seconds * base::Time::kMicrosecondsPerSecond;
27 return base::TimeDelta::FromMicroseconds( 27 return base::TimeDelta::FromMicroseconds(
28 microseconds > 0 ? microseconds + 0.5 : ceil(microseconds - 0.5)); 28 microseconds > 0 ? microseconds + 0.5 : ceil(microseconds - 0.5));
29 } 29 }
30 30
31 blink::WebTimeRanges ConvertToWebTimeRanges( 31 blink::WebTimeRanges ConvertToWebTimeRanges(
32 const media::Ranges<base::TimeDelta>& ranges) { 32 const media::Ranges<base::TimeDelta>& ranges) {
33 blink::WebTimeRanges result(ranges.size()); 33 blink::WebTimeRanges result(ranges.size());
34 for (size_t i = 0; i < ranges.size(); i++) { 34 for (size_t i = 0; i < ranges.size(); ++i) {
Ami GONE FROM CHROMIUM 2013/12/19 21:21:01 CL description says "to improve efficiency" but AF
35 result[i].start = ranges.start(i).InSecondsF(); 35 result[i].start = ranges.start(i).InSecondsF();
36 result[i].end = ranges.end(i).InSecondsF(); 36 result[i].end = ranges.end(i).InSecondsF();
37 } 37 }
38 return result; 38 return result;
39 } 39 }
40 40
41 blink::WebMediaPlayer::NetworkState PipelineErrorToNetworkState( 41 blink::WebMediaPlayer::NetworkState PipelineErrorToNetworkState(
42 media::PipelineStatus error) { 42 media::PipelineStatus error) {
43 DCHECK_NE(error, media::PIPELINE_OK); 43 DCHECK_NE(error, media::PIPELINE_OK);
44 44
(...skipping 26 matching lines...) Expand all
71 return blink::WebMediaPlayer::NetworkStateDecodeError; 71 return blink::WebMediaPlayer::NetworkStateDecodeError;
72 72
73 case media::PIPELINE_OK: 73 case media::PIPELINE_OK:
74 case media::PIPELINE_STATUS_MAX: 74 case media::PIPELINE_STATUS_MAX:
75 NOTREACHED() << "Unexpected status! " << error; 75 NOTREACHED() << "Unexpected status! " << error;
76 } 76 }
77 return blink::WebMediaPlayer::NetworkStateFormatError; 77 return blink::WebMediaPlayer::NetworkStateFormatError;
78 } 78 }
79 79
80 } // namespace content 80 } // namespace content
OLDNEW
« no previous file with comments | « AUTHORS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698