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

Side by Side Diff: webkit/glue/webkitclient_impl.cc

Issue 7129047: Implement monotonically increasing time for WebKit. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 6 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 | « webkit/glue/webkitclient_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 (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 "webkit/glue/webkitclient_impl.h" 5 #include "webkit/glue/webkitclient_impl.h"
6 6
7 #if defined(OS_LINUX) 7 #if defined(OS_LINUX)
8 #include <malloc.h> 8 #include <malloc.h>
9 #endif 9 #endif
10 10
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 values.push_back(value1); 433 values.push_back(value1);
434 values.push_back(value2); 434 values.push_back(value2);
435 return ReplaceStringPlaceholders( 435 return ReplaceStringPlaceholders(
436 GetLocalizedString(message_id), values, NULL); 436 GetLocalizedString(message_id), values, NULL);
437 } 437 }
438 438
439 double WebKitClientImpl::currentTime() { 439 double WebKitClientImpl::currentTime() {
440 return base::Time::Now().ToDoubleT(); 440 return base::Time::Now().ToDoubleT();
441 } 441 }
442 442
443 double WebKitClientImpl::monotonicallyIncreasingTime() {
444 return base::TimeTicks::Now().ToInternalValue() /
445 static_cast<double>(base::Time::kMicrosecondsPerSecond);
446 }
447
443 void WebKitClientImpl::cryptographicallyRandomValues( 448 void WebKitClientImpl::cryptographicallyRandomValues(
444 unsigned char* buffer, size_t length) { 449 unsigned char* buffer, size_t length) {
445 base::RandBytes(buffer, length); 450 base::RandBytes(buffer, length);
446 } 451 }
447 452
448 void WebKitClientImpl::setSharedTimerFiredFunction(void (*func)()) { 453 void WebKitClientImpl::setSharedTimerFiredFunction(void (*func)()) {
449 shared_timer_func_ = func; 454 shared_timer_func_ = func;
450 } 455 }
451 456
452 void WebKitClientImpl::setSharedTimerFireTime(double fire_time) { 457 void WebKitClientImpl::setSharedTimerFireTime(double fire_time) {
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
586 ++shared_timer_suspended_; 591 ++shared_timer_suspended_;
587 } 592 }
588 593
589 void WebKitClientImpl::ResumeSharedTimer() { 594 void WebKitClientImpl::ResumeSharedTimer() {
590 // The shared timer may have fired or been adjusted while we were suspended. 595 // The shared timer may have fired or been adjusted while we were suspended.
591 if (--shared_timer_suspended_ == 0 && !shared_timer_.IsRunning()) 596 if (--shared_timer_suspended_ == 0 && !shared_timer_.IsRunning())
592 setSharedTimerFireTime(shared_timer_fire_time_); 597 setSharedTimerFireTime(shared_timer_fire_time_);
593 } 598 }
594 599
595 } // namespace webkit_glue 600 } // namespace webkit_glue
OLDNEW
« no previous file with comments | « webkit/glue/webkitclient_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698