1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef V8_LIBPLATFORM_DEFAULT_PLATFORM_H_
6 #define V8_LIBPLATFORM_DEFAULT_PLATFORM_H_
10 #include "include/v8-platform.h"
11 #include "src/base/macros.h"
12 #include "src/platform/mutex.h"
13 #include "src/libplatform/task-queue.h"
22 class DefaultPlatform : public Platform {
25 virtual ~DefaultPlatform();
27 void SetThreadPoolSize(int thread_pool_size);
29 void EnsureInitialized();
31 // v8::Platform implementation.
32 virtual void CallOnBackgroundThread(
33 Task *task, ExpectedRuntime expected_runtime) V8_OVERRIDE;
34 virtual void CallOnForegroundThread(v8::Isolate *isolate,
35 Task *task) V8_OVERRIDE;
38 static const int kMaxThreadPoolSize;
42 int thread_pool_size_;
43 std::vector<WorkerThread*> thread_pool_;
46 DISALLOW_COPY_AND_ASSIGN(DefaultPlatform);
50 } } // namespace v8::internal
53 #endif // V8_LIBPLATFORM_DEFAULT_PLATFORM_H_