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

Side by Side Diff: third_party/WebKit/public/platform/Platform.h

Issue 1646583002: [Reland] Per WebViewScheduler virtual time (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Try to fix the broken tests Created 4 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 virtual WebString defaultLocale() { return WebString(); } 413 virtual WebString defaultLocale() { return WebString(); }
414 414
415 // Wall clock time in seconds since the epoch. 415 // Wall clock time in seconds since the epoch.
416 virtual double currentTimeSeconds() { return 0; } 416 virtual double currentTimeSeconds() { return 0; }
417 417
418 // Monotonically increasing time in seconds from an arbitrary fixed point in the past. 418 // Monotonically increasing time in seconds from an arbitrary fixed point in the past.
419 // This function is expected to return at least millisecond-precision values . For this reason, 419 // This function is expected to return at least millisecond-precision values . For this reason,
420 // it is recommended that the fixed point be no further in the past than the epoch. 420 // it is recommended that the fixed point be no further in the past than the epoch.
421 virtual double monotonicallyIncreasingTimeSeconds() { return 0; } 421 virtual double monotonicallyIncreasingTimeSeconds() { return 0; }
422 422
423 // Virtual time is used by Headless Chrome for determinism and performance ( fast forwarding
424 // of timers). New code should typically use |currentTimeSeconds| and
425 // |monotonicallyIncreasingTimeSeconds| as normal.
426 virtual double virtualTimeSeconds() { return currentTimeSeconds(); }
427 virtual double monotonicallyIncreasingVirtualTimeSeconds() { return monotoni callyIncreasingTimeSeconds(); }
428
423 // Returns an interface to the main thread. Can be null if blink was initial ized on a thread without a message loop. 429 // Returns an interface to the main thread. Can be null if blink was initial ized on a thread without a message loop.
424 BLINK_PLATFORM_EXPORT WebThread* mainThread() const; 430 BLINK_PLATFORM_EXPORT WebThread* mainThread() const;
425 431
426 // Returns an interface to the compositor thread. This can be null if the 432 // Returns an interface to the compositor thread. This can be null if the
427 // renderer was created with threaded rendering desabled. 433 // renderer was created with threaded rendering desabled.
428 virtual WebThread* compositorThread() const { return 0; } 434 virtual WebThread* compositorThread() const { return 0; }
429 435
430 // Vibration ----------------------------------------------------------- 436 // Vibration -----------------------------------------------------------
431 437
432 // Starts a vibration for the given duration in milliseconds. If there is cu rrently an active 438 // Starts a vibration for the given duration in milliseconds. If there is cu rrently an active
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
640 protected: 646 protected:
641 BLINK_PLATFORM_EXPORT Platform(); 647 BLINK_PLATFORM_EXPORT Platform();
642 virtual ~Platform() { } 648 virtual ~Platform() { }
643 649
644 WebThread* m_mainThread; 650 WebThread* m_mainThread;
645 }; 651 };
646 652
647 } // namespace blink 653 } // namespace blink
648 654
649 #endif 655 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698