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

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

Issue 1411843008: Make blink platform time consistent with the timer virtual time (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix CachingCorrectnessTest Created 5 years, 1 month 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 | « content/child/blink_platform_impl.h ('k') | content/renderer/renderer_blink_platform_impl.h » ('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 "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 1056 matching lines...) Expand 10 before | Expand all | Expand 10 after
1067 if (message_id < 0) 1067 if (message_id < 0)
1068 return WebString(); 1068 return WebString();
1069 std::vector<base::string16> values; 1069 std::vector<base::string16> values;
1070 values.reserve(2); 1070 values.reserve(2);
1071 values.push_back(value1); 1071 values.push_back(value1);
1072 values.push_back(value2); 1072 values.push_back(value2);
1073 return base::ReplaceStringPlaceholders( 1073 return base::ReplaceStringPlaceholders(
1074 GetContentClient()->GetLocalizedString(message_id), values, NULL); 1074 GetContentClient()->GetLocalizedString(message_id), values, NULL);
1075 } 1075 }
1076 1076
1077 double BlinkPlatformImpl::currentTime() { 1077 double BlinkPlatformImpl::currentTimeSeconds() {
1078 return base::Time::Now().ToDoubleT(); 1078 return base::Time::Now().ToDoubleT();
1079 } 1079 }
1080 1080
1081 double BlinkPlatformImpl::monotonicallyIncreasingTime() { 1081 double BlinkPlatformImpl::monotonicallyIncreasingTimeSeconds() {
1082 return base::TimeTicks::Now().ToInternalValue() / 1082 return base::TimeTicks::Now().ToInternalValue() /
1083 static_cast<double>(base::Time::kMicrosecondsPerSecond); 1083 static_cast<double>(base::Time::kMicrosecondsPerSecond);
1084 } 1084 }
1085 1085
1086 double BlinkPlatformImpl::systemTraceTime() { 1086 double BlinkPlatformImpl::systemTraceTime() {
1087 return (base::TimeTicks::Now() - base::TimeTicks()).InSecondsF(); 1087 return (base::TimeTicks::Now() - base::TimeTicks()).InSecondsF();
1088 } 1088 }
1089 1089
1090 void BlinkPlatformImpl::cryptographicallyRandomValues( 1090 void BlinkPlatformImpl::cryptographicallyRandomValues(
1091 unsigned char* buffer, size_t length) { 1091 unsigned char* buffer, size_t length) {
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
1325 return WebString::fromUTF8(ui::KeycodeConverter::DomKeyToKeyString( 1325 return WebString::fromUTF8(ui::KeycodeConverter::DomKeyToKeyString(
1326 static_cast<ui::DomKey>(dom_key))); 1326 static_cast<ui::DomKey>(dom_key)));
1327 } 1327 }
1328 1328
1329 int BlinkPlatformImpl::domKeyEnumFromString(const WebString& key_string) { 1329 int BlinkPlatformImpl::domKeyEnumFromString(const WebString& key_string) {
1330 return static_cast<int>( 1330 return static_cast<int>(
1331 ui::KeycodeConverter::KeyStringToDomKey(key_string.utf8())); 1331 ui::KeycodeConverter::KeyStringToDomKey(key_string.utf8()));
1332 } 1332 }
1333 1333
1334 } // namespace content 1334 } // namespace content
OLDNEW
« no previous file with comments | « content/child/blink_platform_impl.h ('k') | content/renderer/renderer_blink_platform_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698