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

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

Issue 363303002: Add an API to pump the message loop to libplatform (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
Index: src/libplatform/default-platform.h
diff --git a/src/libplatform/default-platform.h b/src/libplatform/default-platform.h
index c5f6fae3abaf79a97d405f5837774af1fd408b7f..fcbb14c36c436084a3be43f2e23258532cd64e60 100644
--- a/src/libplatform/default-platform.h
+++ b/src/libplatform/default-platform.h
@@ -5,6 +5,8 @@
#ifndef V8_LIBPLATFORM_DEFAULT_PLATFORM_H_
#define V8_LIBPLATFORM_DEFAULT_PLATFORM_H_
+#include <map>
+#include <queue>
#include <vector>
#include "include/v8-platform.h"
@@ -28,11 +30,13 @@ class DefaultPlatform : public Platform {
void EnsureInitialized();
+ bool PumpMessageLoop(v8::Isolate* isolate);
+
// v8::Platform implementation.
virtual void CallOnBackgroundThread(
- Task *task, ExpectedRuntime expected_runtime) V8_OVERRIDE;
- virtual void CallOnForegroundThread(v8::Isolate *isolate,
- Task *task) V8_OVERRIDE;
+ Task* task, ExpectedRuntime expected_runtime) V8_OVERRIDE;
+ virtual void CallOnForegroundThread(v8::Isolate* isolate,
+ Task* task) V8_OVERRIDE;
private:
static const int kMaxThreadPoolSize;
@@ -42,6 +46,7 @@ class DefaultPlatform : public Platform {
int thread_pool_size_;
std::vector<WorkerThread*> thread_pool_;
TaskQueue queue_;
+ std::map<v8::Isolate*, std::queue<Task*> > main_thread_queue_;
DISALLOW_COPY_AND_ASSIGN(DefaultPlatform);
};

Powered by Google App Engine
This is Rietveld 408576698