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

Side by Side Diff: content/common/inter_process_time_ticks_converter.cc

Issue 11419224: Add missing (and remove superfluous) 'explicit' from constructors. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase + remove non-straightforward changes Created 7 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 | Annotate | Revision Log
« no previous file with comments | « content/common/inter_process_time_ticks_converter.h ('k') | content/common/quota_dispatcher.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/common/inter_process_time_ticks_converter.h" 5 #include "content/common/inter_process_time_ticks_converter.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 8
9 namespace content { 9 namespace content {
10 10
(...skipping 19 matching lines...) Expand all
30 denominator_ = source_range; 30 denominator_ = source_range;
31 // Find out what we need to shift by to make this really work. 31 // Find out what we need to shift by to make this really work.
32 offset_ = local_lower_bound.value_ - Convert(remote_lower_bound.value_); 32 offset_ = local_lower_bound.value_ - Convert(remote_lower_bound.value_);
33 DCHECK_GE(local_upper_bound.value_, Convert(remote_upper_bound.value_)); 33 DCHECK_GE(local_upper_bound.value_, Convert(remote_upper_bound.value_));
34 } 34 }
35 35
36 LocalTimeTicks InterProcessTimeTicksConverter::ToLocalTimeTicks( 36 LocalTimeTicks InterProcessTimeTicksConverter::ToLocalTimeTicks(
37 const RemoteTimeTicks& remote_ms) { 37 const RemoteTimeTicks& remote_ms) {
38 DCHECK_LE(remote_lower_bound_, remote_ms.value_); 38 DCHECK_LE(remote_lower_bound_, remote_ms.value_);
39 DCHECK_GE(remote_upper_bound_, remote_ms.value_); 39 DCHECK_GE(remote_upper_bound_, remote_ms.value_);
40 RemoteTimeDelta remote_delta = remote_ms - remote_lower_bound_; 40 RemoteTimeDelta remote_delta = remote_ms -
41 RemoteTimeTicks(remote_lower_bound_);
41 return LocalTimeTicks(remote_lower_bound_ + offset_ + 42 return LocalTimeTicks(remote_lower_bound_ + offset_ +
42 ToLocalTimeDelta(remote_delta).value_); 43 ToLocalTimeDelta(remote_delta).value_);
43 } 44 }
44 45
45 LocalTimeDelta InterProcessTimeTicksConverter::ToLocalTimeDelta( 46 LocalTimeDelta InterProcessTimeTicksConverter::ToLocalTimeDelta(
46 const RemoteTimeDelta& remote_delta) { 47 const RemoteTimeDelta& remote_delta) {
47 DCHECK_GE(remote_upper_bound_, remote_lower_bound_ + remote_delta.value_); 48 DCHECK_GE(remote_upper_bound_, remote_lower_bound_ + remote_delta.value_);
48 return LocalTimeDelta(Convert(remote_delta.value_)); 49 return LocalTimeDelta(Convert(remote_delta.value_));
49 } 50 }
50 51
51 int64 InterProcessTimeTicksConverter::Convert(int64 value) { 52 int64 InterProcessTimeTicksConverter::Convert(int64 value) {
52 if (value <= 0) { 53 if (value <= 0) {
53 return value; 54 return value;
54 } 55 }
55 return numerator_ * value / denominator_; 56 return numerator_ * value / denominator_;
56 } 57 }
57 58
58 } // namespace content 59 } // namespace content
OLDNEW
« no previous file with comments | « content/common/inter_process_time_ticks_converter.h ('k') | content/common/quota_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698