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

Side by Side Diff: content/child/blink_platform_impl.cc

Issue 1550563002: Blink Platform: Remove time functions from Platform. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 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
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 "content/child/blink_platform_impl.h" 5 #include "content/child/blink_platform_impl.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 1060 matching lines...) Expand 10 before | Expand all | Expand 10 after
1071 if (message_id < 0) 1071 if (message_id < 0)
1072 return WebString(); 1072 return WebString();
1073 std::vector<base::string16> values; 1073 std::vector<base::string16> values;
1074 values.reserve(2); 1074 values.reserve(2);
1075 values.push_back(value1); 1075 values.push_back(value1);
1076 values.push_back(value2); 1076 values.push_back(value2);
1077 return base::ReplaceStringPlaceholders( 1077 return base::ReplaceStringPlaceholders(
1078 GetContentClient()->GetLocalizedString(message_id), values, NULL); 1078 GetContentClient()->GetLocalizedString(message_id), values, NULL);
1079 } 1079 }
1080 1080
1081 double BlinkPlatformImpl::currentTimeSeconds() {
1082 return base::Time::Now().ToDoubleT();
1083 }
1084
1085 double BlinkPlatformImpl::monotonicallyIncreasingTimeSeconds() {
1086 return base::TimeTicks::Now().ToInternalValue() /
1087 static_cast<double>(base::Time::kMicrosecondsPerSecond);
1088 }
1089
1090 double BlinkPlatformImpl::systemTraceTime() {
1091 return (base::TimeTicks::Now() - base::TimeTicks()).InSecondsF();
1092 }
1093
1094 void BlinkPlatformImpl::cryptographicallyRandomValues( 1081 void BlinkPlatformImpl::cryptographicallyRandomValues(
1095 unsigned char* buffer, size_t length) { 1082 unsigned char* buffer, size_t length) {
1096 base::RandBytes(buffer, length); 1083 base::RandBytes(buffer, length);
1097 } 1084 }
1098 1085
1099 blink::WebThread* BlinkPlatformImpl::compositorThread() const { 1086 blink::WebThread* BlinkPlatformImpl::compositorThread() const {
1100 return compositor_thread_; 1087 return compositor_thread_;
1101 } 1088 }
1102 1089
1103 blink::WebGestureCurve* BlinkPlatformImpl::createFlingAnimationCurve( 1090 blink::WebGestureCurve* BlinkPlatformImpl::createFlingAnimationCurve(
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
1308 return WebString::fromUTF8(ui::KeycodeConverter::DomKeyToKeyString( 1295 return WebString::fromUTF8(ui::KeycodeConverter::DomKeyToKeyString(
1309 static_cast<ui::DomKey>(dom_key))); 1296 static_cast<ui::DomKey>(dom_key)));
1310 } 1297 }
1311 1298
1312 int BlinkPlatformImpl::domKeyEnumFromString(const WebString& key_string) { 1299 int BlinkPlatformImpl::domKeyEnumFromString(const WebString& key_string) {
1313 return static_cast<int>( 1300 return static_cast<int>(
1314 ui::KeycodeConverter::KeyStringToDomKey(key_string.utf8())); 1301 ui::KeycodeConverter::KeyStringToDomKey(key_string.utf8()));
1315 } 1302 }
1316 1303
1317 } // namespace content 1304 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698