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

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

Issue 956333002: Refactor TimeBase to post tasks. Workers to use real Idle tasks. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Changed the idle implementation Created 5 years, 8 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 422 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 virtual double currentTime() { return 0; } 433 virtual double currentTime() { return 0; }
434 434
435 // Monotonically increasing time in seconds from an arbitrary fixed point in the past. 435 // Monotonically increasing time in seconds from an arbitrary fixed point in the past.
436 // This function is expected to return at least millisecond-precision values . For this reason, 436 // This function is expected to return at least millisecond-precision values . For this reason,
437 // it is recommended that the fixed point be no further in the past than the epoch. 437 // it is recommended that the fixed point be no further in the past than the epoch.
438 virtual double monotonicallyIncreasingTime() { return 0; } 438 virtual double monotonicallyIncreasingTime() { return 0; }
439 439
440 // WebKit clients must implement this funcion if they use cryptographic rand omness. 440 // WebKit clients must implement this funcion if they use cryptographic rand omness.
441 virtual void cryptographicallyRandomValues(unsigned char* buffer, size_t len gth) = 0; 441 virtual void cryptographicallyRandomValues(unsigned char* buffer, size_t len gth) = 0;
442 442
443 // Delayed work is driven by a shared timer.
444 typedef void (*SharedTimerFunction)();
445 virtual void setSharedTimerFiredFunction(SharedTimerFunction timerFunction) { }
446 virtual void setSharedTimerFireInterval(double) { }
447 virtual void stopSharedTimer() { }
448
449 // Returns an interface to the main thread. Can be null if blink was initial ized on a thread without a message loop. 443 // Returns an interface to the main thread. Can be null if blink was initial ized on a thread without a message loop.
450 BLINK_PLATFORM_EXPORT WebThread* mainThread() const; 444 BLINK_PLATFORM_EXPORT WebThread* mainThread() const;
451 445
452 // Vibration ----------------------------------------------------------- 446 // Vibration -----------------------------------------------------------
453 447
454 // Starts a vibration for the given duration in milliseconds. If there is cu rrently an active 448 // Starts a vibration for the given duration in milliseconds. If there is cu rrently an active
455 // vibration it will be cancelled before the new one is started. 449 // vibration it will be cancelled before the new one is started.
456 virtual void vibrate(unsigned time) { } 450 virtual void vibrate(unsigned time) { }
457 451
458 // Cancels the current vibration, if there is one. 452 // Cancels the current vibration, if there is one.
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
698 protected: 692 protected:
699 BLINK_PLATFORM_EXPORT Platform(); 693 BLINK_PLATFORM_EXPORT Platform();
700 virtual ~Platform() { } 694 virtual ~Platform() { }
701 695
702 WebThread* m_mainThread; 696 WebThread* m_mainThread;
703 }; 697 };
704 698
705 } // namespace blink 699 } // namespace blink
706 700
707 #endif 701 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698