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

Side by Side Diff: sky/viewer/platform/platform_impl.cc

Issue 691483005: Remove Platform::cryptographicallyRandomValues (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 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 | « sky/viewer/platform/platform_impl.h ('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 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 "sky/viewer/platform/platform_impl.h" 5 #include "sky/viewer/platform/platform_impl.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 8
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/rand_util.h" 10 #include "base/rand_util.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 69
70 double PlatformImpl::currentTime() { 70 double PlatformImpl::currentTime() {
71 return base::Time::Now().ToDoubleT(); 71 return base::Time::Now().ToDoubleT();
72 } 72 }
73 73
74 double PlatformImpl::monotonicallyIncreasingTime() { 74 double PlatformImpl::monotonicallyIncreasingTime() {
75 return base::TimeTicks::Now().ToInternalValue() / 75 return base::TimeTicks::Now().ToInternalValue() /
76 static_cast<double>(base::Time::kMicrosecondsPerSecond); 76 static_cast<double>(base::Time::kMicrosecondsPerSecond);
77 } 77 }
78 78
79 void PlatformImpl::cryptographicallyRandomValues(unsigned char* buffer,
80 size_t length) {
81 base::RandBytes(buffer, length);
82 }
83
84 void PlatformImpl::setSharedTimerFiredFunction(void (*func)()) { 79 void PlatformImpl::setSharedTimerFiredFunction(void (*func)()) {
85 shared_timer_func_ = func; 80 shared_timer_func_ = func;
86 } 81 }
87 82
88 void PlatformImpl::setSharedTimerFireInterval( 83 void PlatformImpl::setSharedTimerFireInterval(
89 double interval_seconds) { 84 double interval_seconds) {
90 shared_timer_fire_time_ = interval_seconds + monotonicallyIncreasingTime(); 85 shared_timer_fire_time_ = interval_seconds + monotonicallyIncreasingTime();
91 if (shared_timer_suspended_) { 86 if (shared_timer_suspended_) {
92 shared_timer_fire_time_was_set_while_suspended_ = true; 87 shared_timer_fire_time_was_set_while_suspended_ = true;
93 return; 88 return;
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 const unsigned char* category_group_enabled, 253 const unsigned char* category_group_enabled,
259 const char* name, 254 const char* name,
260 TraceEventHandle handle) { 255 TraceEventHandle handle) {
261 base::debug::TraceEventHandle traceEventHandle; 256 base::debug::TraceEventHandle traceEventHandle;
262 memcpy(&traceEventHandle, &handle, sizeof(handle)); 257 memcpy(&traceEventHandle, &handle, sizeof(handle));
263 TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION( 258 TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION(
264 category_group_enabled, name, traceEventHandle); 259 category_group_enabled, name, traceEventHandle);
265 } 260 }
266 261
267 } // namespace sky 262 } // namespace sky
OLDNEW
« no previous file with comments | « sky/viewer/platform/platform_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698