OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 | 54 |
55 enum WaitMode { WaitForMessage, DontWaitForMessage }; | 55 enum WaitMode { WaitForMessage, DontWaitForMessage }; |
56 | 56 |
57 // Waits for a single task and returns. | 57 // Waits for a single task and returns. |
58 MessageQueueWaitResult runInMode(WorkerContext*, const String& mode, Wai
tMode = WaitForMessage); | 58 MessageQueueWaitResult runInMode(WorkerContext*, const String& mode, Wai
tMode = WaitForMessage); |
59 | 59 |
60 void terminate(); | 60 void terminate(); |
61 bool terminated() const { return m_messageQueue.killed(); } | 61 bool terminated() const { return m_messageQueue.killed(); } |
62 | 62 |
63 void postTask(PassOwnPtr<ScriptExecutionContext::Task>); | 63 void postTask(PassOwnPtr<ScriptExecutionContext::Task>); |
| 64 void postTaskAndTerminate(PassOwnPtr<ScriptExecutionContext::Task>); |
64 void postTaskForMode(PassOwnPtr<ScriptExecutionContext::Task>, const Str
ing& mode); | 65 void postTaskForMode(PassOwnPtr<ScriptExecutionContext::Task>, const Str
ing& mode); |
65 | 66 |
66 unsigned long createUniqueId() { return ++m_uniqueId; } | 67 unsigned long createUniqueId() { return ++m_uniqueId; } |
67 | 68 |
68 static String defaultMode(); | 69 static String defaultMode(); |
69 | 70 |
70 class Task { | 71 class Task { |
71 WTF_MAKE_NONCOPYABLE(Task); WTF_MAKE_FAST_ALLOCATED; | 72 WTF_MAKE_NONCOPYABLE(Task); WTF_MAKE_FAST_ALLOCATED; |
72 public: | 73 public: |
73 static PassOwnPtr<Task> create(PassOwnPtr<ScriptExecutionContext::Ta
sk> task, const String& mode); | 74 static PassOwnPtr<Task> create(PassOwnPtr<ScriptExecutionContext::Ta
sk> task, const String& mode); |
(...skipping 20 matching lines...) Expand all Loading... |
94 OwnPtr<WorkerSharedTimer> m_sharedTimer; | 95 OwnPtr<WorkerSharedTimer> m_sharedTimer; |
95 int m_nestedCount; | 96 int m_nestedCount; |
96 unsigned long m_uniqueId; | 97 unsigned long m_uniqueId; |
97 }; | 98 }; |
98 | 99 |
99 } // namespace WebCore | 100 } // namespace WebCore |
100 | 101 |
101 #endif // ENABLE(WORKERS) | 102 #endif // ENABLE(WORKERS) |
102 | 103 |
103 #endif // WorkerRunLoop_h | 104 #endif // WorkerRunLoop_h |
OLD | NEW |