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

Unified Diff: src/libplatform/default-platform.h

Issue 2609833003: Add support for idle tasks to the default platform (Closed)
Patch Set: updates Created 3 years, 12 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/d8.cc ('k') | src/libplatform/default-platform.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/libplatform/default-platform.h
diff --git a/src/libplatform/default-platform.h b/src/libplatform/default-platform.h
index 4b52c28129efcea60585bc2debd48bd2d781d0f8..0ab8e33ee5574ee55085accffda5011da00e990a 100644
--- a/src/libplatform/default-platform.h
+++ b/src/libplatform/default-platform.h
@@ -41,6 +41,8 @@ class V8_PLATFORM_EXPORT DefaultPlatform : public NON_EXPORTED_BASE(Platform) {
bool PumpMessageLoop(v8::Isolate* isolate);
+ void RunIdleTasks(v8::Isolate* isolate, double idle_time_in_seconds);
+
// v8::Platform implementation.
size_t NumberOfAvailableBackgroundThreads() override;
void CallOnBackgroundThread(Task* task,
@@ -74,13 +76,15 @@ class V8_PLATFORM_EXPORT DefaultPlatform : public NON_EXPORTED_BASE(Platform) {
Task* PopTaskInMainThreadQueue(v8::Isolate* isolate);
Task* PopTaskInMainThreadDelayedQueue(v8::Isolate* isolate);
+ IdleTask* PopTaskInMainThreadIdleQueue(v8::Isolate* isolate);
base::Mutex lock_;
bool initialized_;
int thread_pool_size_;
std::vector<WorkerThread*> thread_pool_;
TaskQueue queue_;
- std::map<v8::Isolate*, std::queue<Task*> > main_thread_queue_;
+ std::map<v8::Isolate*, std::queue<Task*>> main_thread_queue_;
+ std::map<v8::Isolate*, std::queue<IdleTask*>> main_thread_idle_queue_;
typedef std::pair<double, Task*> DelayedEntry;
std::map<v8::Isolate*,
« no previous file with comments | « src/d8.cc ('k') | src/libplatform/default-platform.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698