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

Side by Side Diff: cc/test/test_now_source.cc

Issue 935333002: Update from https://crrev.com/316786 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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 | « cc/test/test_now_source.h ('k') | cc/trees/draw_property_utils.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <limits> 5 #include <limits>
6 #include <string> 6 #include <string>
7 7
8 #include "cc/test/test_now_source.h" 8 #include "cc/test/test_now_source.h"
9 9
10 namespace cc { 10 namespace cc {
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 86
87 // TestNowSource::Convenience functions 87 // TestNowSource::Convenience functions
88 void TestNowSource::AdvanceNowMicroseconds(int64_t period_in_microseconds) { 88 void TestNowSource::AdvanceNowMicroseconds(int64_t period_in_microseconds) {
89 AdvanceNow(base::TimeDelta::FromMicroseconds(period_in_microseconds)); 89 AdvanceNow(base::TimeDelta::FromMicroseconds(period_in_microseconds));
90 } 90 }
91 void TestNowSource::SetNowMicroseconds(int64_t time_in_microseconds) { 91 void TestNowSource::SetNowMicroseconds(int64_t time_in_microseconds) {
92 SetNow(base::TimeTicks::FromInternalValue(time_in_microseconds)); 92 SetNow(base::TimeTicks::FromInternalValue(time_in_microseconds));
93 } 93 }
94 94
95 // TestNowSource::Tracing functions 95 // TestNowSource::Tracing functions
96 void TestNowSource::AsValueInto(base::debug::TracedValue* state) const { 96 void TestNowSource::AsValueInto(base::trace_event::TracedValue* state) const {
97 state->SetInteger("now_in_microseconds", now_.ToInternalValue()); 97 state->SetInteger("now_in_microseconds", now_.ToInternalValue());
98 } 98 }
99 99
100 scoped_refptr<base::debug::ConvertableToTraceFormat> TestNowSource::AsValue() 100 scoped_refptr<base::trace_event::ConvertableToTraceFormat>
101 const { 101 TestNowSource::AsValue() const {
102 scoped_refptr<base::debug::TracedValue> state = 102 scoped_refptr<base::trace_event::TracedValue> state =
103 new base::debug::TracedValue(); 103 new base::trace_event::TracedValue();
104 AsValueInto(state.get()); 104 AsValueInto(state.get());
105 return state; 105 return state;
106 } 106 }
107 107
108 // TestNowSource::Pretty printing functions 108 // TestNowSource::Pretty printing functions
109 std::string TestNowSource::ToString() const { 109 std::string TestNowSource::ToString() const {
110 std::string output("TestNowSource("); 110 std::string output("TestNowSource(");
111 AsValue()->AppendAsTraceFormat(&output); 111 AsValue()->AppendAsTraceFormat(&output);
112 output += ")"; 112 output += ")";
113 return output; 113 return output;
114 } 114 }
115 115
116 ::std::ostream& operator<<(::std::ostream& os, 116 ::std::ostream& operator<<(::std::ostream& os,
117 const scoped_refptr<TestNowSource>& src) { 117 const scoped_refptr<TestNowSource>& src) {
118 os << src->ToString(); 118 os << src->ToString();
119 return os; 119 return os;
120 } 120 }
121 void PrintTo(const scoped_refptr<TestNowSource>& src, ::std::ostream* os) { 121 void PrintTo(const scoped_refptr<TestNowSource>& src, ::std::ostream* os) {
122 *os << src; 122 *os << src;
123 } 123 }
124 124
125 } // namespace cc 125 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/test_now_source.h ('k') | cc/trees/draw_property_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698