OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Neither the name of Google Inc. nor the names of its | 10 * * Neither the name of Google Inc. nor the names of its |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 USING_FAST_MALLOC(MainThreadTaskRunner); | 47 USING_FAST_MALLOC(MainThreadTaskRunner); |
48 WTF_MAKE_NONCOPYABLE(MainThreadTaskRunner); | 48 WTF_MAKE_NONCOPYABLE(MainThreadTaskRunner); |
49 | 49 |
50 public: | 50 public: |
51 static std::unique_ptr<MainThreadTaskRunner> create(ExecutionContext*); | 51 static std::unique_ptr<MainThreadTaskRunner> create(ExecutionContext*); |
52 | 52 |
53 ~MainThreadTaskRunner(); | 53 ~MainThreadTaskRunner(); |
54 | 54 |
55 DECLARE_TRACE(); | 55 DECLARE_TRACE(); |
56 | 56 |
57 void postTask( | 57 // Executes the task on context's thread asynchronously. |
58 const WebTraceLocation&, | 58 void postTask(const WebTraceLocation&, |
59 std::unique_ptr<ExecutionContextTask>, | 59 std::unique_ptr<ExecutionContextTask>, |
60 const String& taskNameForInstrumentation = | 60 const String& taskNameForInstrumentation = emptyString()); |
61 emptyString()); // Executes the task on context's thread asynchronous
ly. | 61 |
62 void postInspectorTask(const WebTraceLocation&, | 62 void postInspectorTask(const WebTraceLocation&, |
63 std::unique_ptr<ExecutionContextTask>); | 63 std::unique_ptr<ExecutionContextTask>); |
64 void perform(std::unique_ptr<ExecutionContextTask>, | 64 void perform(std::unique_ptr<ExecutionContextTask>, |
65 bool isInspectorTask, | 65 bool isInspectorTask, |
66 bool instrumenting); | 66 bool instrumenting); |
67 | 67 |
68 void suspend(); | 68 void suspend(); |
69 void resume(); | 69 void resume(); |
70 | 70 |
71 private: | 71 private: |
(...skipping 19 matching lines...) Expand all Loading... |
91 }; | 91 }; |
92 | 92 |
93 inline std::unique_ptr<MainThreadTaskRunner> MainThreadTaskRunner::create( | 93 inline std::unique_ptr<MainThreadTaskRunner> MainThreadTaskRunner::create( |
94 ExecutionContext* context) { | 94 ExecutionContext* context) { |
95 return wrapUnique(new MainThreadTaskRunner(context)); | 95 return wrapUnique(new MainThreadTaskRunner(context)); |
96 } | 96 } |
97 | 97 |
98 } // namespace blink | 98 } // namespace blink |
99 | 99 |
100 #endif | 100 #endif |
OLD | NEW |