mirror of
https://github.com/nodejs/node.git
synced 2025-05-17 02:30:33 +00:00

Pick up latest commit from the 5.4-lkgr branch. deps: edit V8 gitignore to allow trace event copy deps: update V8 trace event to 315bf1e2d45be7d53346c31cfcc37424a32c30c8 deps: edit V8 gitignore to allow gtest_prod.h copy deps: update V8 gtest to 6f8a66431cb592dad629028a50b3dd418a408c87 PR-URL: https://github.com/nodejs/node/pull/8317 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
48 lines
1.5 KiB
C++
48 lines
1.5 KiB
C++
// Copyright 2014 the V8 project authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
#ifndef V8_LIBPLATFORM_LIBPLATFORM_H_
|
|
#define V8_LIBPLATFORM_LIBPLATFORM_H_
|
|
|
|
#include "libplatform/v8-tracing.h"
|
|
#include "v8-platform.h" // NOLINT(build/include)
|
|
|
|
namespace v8 {
|
|
namespace platform {
|
|
|
|
/**
|
|
* Returns a new instance of the default v8::Platform implementation.
|
|
*
|
|
* The caller will take ownership of the returned pointer. |thread_pool_size|
|
|
* is the number of worker threads to allocate for background jobs. If a value
|
|
* of zero is passed, a suitable default based on the current number of
|
|
* processors online will be chosen.
|
|
*/
|
|
v8::Platform* CreateDefaultPlatform(int thread_pool_size = 0);
|
|
|
|
|
|
/**
|
|
* Pumps the message loop for the given isolate.
|
|
*
|
|
* The caller has to make sure that this is called from the right thread.
|
|
* Returns true if a task was executed, and false otherwise. This call does
|
|
* not block if no task is pending. The |platform| has to be created using
|
|
* |CreateDefaultPlatform|.
|
|
*/
|
|
bool PumpMessageLoop(v8::Platform* platform, v8::Isolate* isolate);
|
|
|
|
/**
|
|
* Attempts to set the tracing controller for the given platform.
|
|
*
|
|
* The |platform| has to be created using |CreateDefaultPlatform|.
|
|
*/
|
|
void SetTracingController(
|
|
v8::Platform* platform,
|
|
v8::platform::tracing::TracingController* tracing_controller);
|
|
|
|
} // namespace platform
|
|
} // namespace v8
|
|
|
|
#endif // V8_LIBPLATFORM_LIBPLATFORM_H_
|