Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_LIBPLATFORM_LIBPLATFORM_H_ | 5 #ifndef V8_LIBPLATFORM_LIBPLATFORM_H_ |
| 6 #define V8_LIBPLATFORM_LIBPLATFORM_H_ | 6 #define V8_LIBPLATFORM_LIBPLATFORM_H_ |
| 7 | 7 |
| 8 #include "libplatform/libplatform-export.h" | 8 #include "libplatform/libplatform-export.h" |
| 9 #include "libplatform/v8-tracing.h" | 9 #include "libplatform/v8-tracing.h" |
| 10 #include "v8-platform.h" // NOLINT(build/include) | 10 #include "v8-platform.h" // NOLINT(build/include) |
| 11 | 11 |
| 12 namespace v8 { | 12 namespace v8 { |
| 13 namespace platform { | 13 namespace platform { |
| 14 | 14 |
| 15 enum class IdleTaskSupport { kDisabled, kEnabled }; | 15 enum class IdleTaskSupport { kDisabled, kEnabled }; |
| 16 | 16 |
| 17 /** | 17 /** |
| 18 * Returns a new instance of the default v8::Platform implementation. | 18 * Returns a new instance of the default v8::Platform implementation. |
| 19 * | 19 * |
| 20 * The caller will take ownership of the returned pointer. |thread_pool_size| | 20 * The caller will take ownership of the returned pointer. |thread_pool_size| |
| 21 * is the number of worker threads to allocate for background jobs. If a value | 21 * is the number of worker threads to allocate for background jobs. If a value |
| 22 * of zero is passed, a suitable default based on the current number of | 22 * of zero is passed, a suitable default based on the current number of |
| 23 * processors online will be chosen. | 23 * processors online will be chosen. |
| 24 * If |idle_task_support| is enabled then the platform will accept idle | 24 * If |idle_task_support| is enabled then the platform will accept idle |
| 25 * tasks (IdleTasksEnabled will return true) and will rely on the embedder | 25 * tasks (IdleTasksEnabled will return true) and will rely on the embedder |
| 26 * calling v8::platform::RunIdleTasks to process the idle tasks. | 26 * calling v8::platform::RunIdleTasks to process the idle tasks. |
| 27 */ | 27 */ |
| 28 V8_PLATFORM_EXPORT v8::Platform* CreateDefaultPlatform( | 28 V8_PLATFORM_EXPORT v8::Platform* CreateDefaultPlatform( |
| 29 int thread_pool_size = 0, | 29 int thread_pool_size = 0, |
| 30 IdleTaskSupport idle_task_support = IdleTaskSupport::kDisabled); | 30 IdleTaskSupport idle_task_support = IdleTaskSupport::kDisabled, |
| 31 bool in_process_stack_dumping = true); | |
|
jochen (gone - plz use gerrit)
2017/05/03 10:42:08
please make this an enum class instead of a bool
Oliver Chang
2017/05/03 16:25:19
Done.
| |
| 31 | 32 |
| 32 /** | 33 /** |
| 33 * Pumps the message loop for the given isolate. | 34 * Pumps the message loop for the given isolate. |
| 34 * | 35 * |
| 35 * The caller has to make sure that this is called from the right thread. | 36 * The caller has to make sure that this is called from the right thread. |
| 36 * Returns true if a task was executed, and false otherwise. This call does | 37 * Returns true if a task was executed, and false otherwise. This call does |
| 37 * not block if no task is pending. The |platform| has to be created using | 38 * not block if no task is pending. The |platform| has to be created using |
| 38 * |CreateDefaultPlatform|. | 39 * |CreateDefaultPlatform|. |
| 39 */ | 40 */ |
| 40 V8_PLATFORM_EXPORT bool PumpMessageLoop(v8::Platform* platform, | 41 V8_PLATFORM_EXPORT bool PumpMessageLoop(v8::Platform* platform, |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 57 * The |platform| has to be created using |CreateDefaultPlatform|. | 58 * The |platform| has to be created using |CreateDefaultPlatform|. |
| 58 */ | 59 */ |
| 59 V8_PLATFORM_EXPORT void SetTracingController( | 60 V8_PLATFORM_EXPORT void SetTracingController( |
| 60 v8::Platform* platform, | 61 v8::Platform* platform, |
| 61 v8::platform::tracing::TracingController* tracing_controller); | 62 v8::platform::tracing::TracingController* tracing_controller); |
| 62 | 63 |
| 63 } // namespace platform | 64 } // namespace platform |
| 64 } // namespace v8 | 65 } // namespace v8 |
| 65 | 66 |
| 66 #endif // V8_LIBPLATFORM_LIBPLATFORM_H_ | 67 #endif // V8_LIBPLATFORM_LIBPLATFORM_H_ |
| OLD | NEW |