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

Side by Side Diff: include/libplatform/libplatform.h

Issue 2372983003: Turn libplatform into a component (Closed)
Patch Set: rebase Created 4 years, 2 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 unified diff | Download patch
« no previous file with comments | « include/libplatform/DEPS ('k') | include/libplatform/libplatform-export.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/v8-tracing.h" 9 #include "libplatform/v8-tracing.h"
9 #include "v8-platform.h" // NOLINT(build/include) 10 #include "v8-platform.h" // NOLINT(build/include)
10 11
11 namespace v8 { 12 namespace v8 {
12 namespace platform { 13 namespace platform {
13 14
14 /** 15 /**
15 * Returns a new instance of the default v8::Platform implementation. 16 * Returns a new instance of the default v8::Platform implementation.
16 * 17 *
17 * The caller will take ownership of the returned pointer. |thread_pool_size| 18 * The caller will take ownership of the returned pointer. |thread_pool_size|
18 * is the number of worker threads to allocate for background jobs. If a value 19 * is the number of worker threads to allocate for background jobs. If a value
19 * of zero is passed, a suitable default based on the current number of 20 * of zero is passed, a suitable default based on the current number of
20 * processors online will be chosen. 21 * processors online will be chosen.
21 */ 22 */
22 v8::Platform* CreateDefaultPlatform(int thread_pool_size = 0); 23 V8_PLATFORM_EXPORT v8::Platform* CreateDefaultPlatform(
23 24 int thread_pool_size = 0);
24 25
25 /** 26 /**
26 * Pumps the message loop for the given isolate. 27 * Pumps the message loop for the given isolate.
27 * 28 *
28 * The caller has to make sure that this is called from the right thread. 29 * The caller has to make sure that this is called from the right thread.
29 * Returns true if a task was executed, and false otherwise. This call does 30 * Returns true if a task was executed, and false otherwise. This call does
30 * not block if no task is pending. The |platform| has to be created using 31 * not block if no task is pending. The |platform| has to be created using
31 * |CreateDefaultPlatform|. 32 * |CreateDefaultPlatform|.
32 */ 33 */
33 bool PumpMessageLoop(v8::Platform* platform, v8::Isolate* isolate); 34 V8_PLATFORM_EXPORT bool PumpMessageLoop(v8::Platform* platform,
35 v8::Isolate* isolate);
34 36
35 /** 37 /**
36 * Attempts to set the tracing controller for the given platform. 38 * Attempts to set the tracing controller for the given platform.
37 * 39 *
38 * The |platform| has to be created using |CreateDefaultPlatform|. 40 * The |platform| has to be created using |CreateDefaultPlatform|.
39 */ 41 */
40 void SetTracingController( 42 V8_PLATFORM_EXPORT void SetTracingController(
41 v8::Platform* platform, 43 v8::Platform* platform,
42 v8::platform::tracing::TracingController* tracing_controller); 44 v8::platform::tracing::TracingController* tracing_controller);
43 45
44 } // namespace platform 46 } // namespace platform
45 } // namespace v8 47 } // namespace v8
46 48
47 #endif // V8_LIBPLATFORM_LIBPLATFORM_H_ 49 #endif // V8_LIBPLATFORM_LIBPLATFORM_H_
OLDNEW
« no previous file with comments | « include/libplatform/DEPS ('k') | include/libplatform/libplatform-export.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698