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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 virtual void postExceptionToWorkerObject( | 66 virtual void postExceptionToWorkerObject( |
67 const WebCore::String&, int, const WebCore::String&); | 67 const WebCore::String&, int, const WebCore::String&); |
68 virtual void postConsoleMessageToWorkerObject( | 68 virtual void postConsoleMessageToWorkerObject( |
69 WebCore::MessageDestination, WebCore::MessageSource, WebCore::MessageType, | 69 WebCore::MessageDestination, WebCore::MessageSource, WebCore::MessageType, |
70 WebCore::MessageLevel, const WebCore::String&, int, const WebCore::String&); | 70 WebCore::MessageLevel, const WebCore::String&, int, const WebCore::String&); |
71 virtual void confirmMessageFromWorkerObject(bool); | 71 virtual void confirmMessageFromWorkerObject(bool); |
72 virtual void reportPendingActivity(bool); | 72 virtual void reportPendingActivity(bool); |
73 virtual void workerContextDestroyed(); | 73 virtual void workerContextDestroyed(); |
74 | 74 |
75 // WebCore::WorkerLoaderProxy methods: | 75 // WebCore::WorkerLoaderProxy methods: |
76 virtual void postTaskToLoader(PassRefPtr<WebCore::ScriptExecutionContext::Task>); | 76 virtual void postTaskToLoader(PassOwnPtr<WebCore::ScriptExecutionContext::Task>); |
77 virtual void postTaskForModeToWorkerContext( | 77 virtual void postTaskForModeToWorkerContext( |
78 PassRefPtr<WebCore::ScriptExecutionContext::Task>, const WebCore::String& mode); | 78 PassOwnPtr<WebCore::ScriptExecutionContext::Task>, const WebCore::String& mode); |
79 | 79 |
80 // WebWorker methods: | 80 // WebWorker methods: |
81 virtual void startWorkerContext(const WebURL&, const WebString&, const WebString&); | 81 virtual void startWorkerContext(const WebURL&, const WebString&, const WebString&); |
82 virtual void terminateWorkerContext(); | 82 virtual void terminateWorkerContext(); |
83 virtual void postMessageToWorkerContext(const WebString&, const WebMessagePortChannelArray&); | 83 virtual void postMessageToWorkerContext(const WebString&, const WebMessagePortChannelArray&); |
84 virtual void workerObjectDestroyed(); | 84 virtual void workerObjectDestroyed(); |
85 virtual void clientDestroyed(); | 85 virtual void clientDestroyed(); |
86 | 86 |
87 WebWorkerClient* client() {return m_client;} | 87 WebWorkerClient* client() {return m_client;} |
88 | 88 |
89 // Executes the given task on the main thread. | 89 // Executes the given task on the main thread. |
90 static void dispatchTaskToMainThread(PassRefPtr<WebCore::ScriptExecutionContext::Task>); | 90 static void dispatchTaskToMainThread(PassOwnPtr<WebCore::ScriptExecutionContext::Task>); |
91 | 91 |
92 private: | 92 private: |
93 virtual ~WebWorkerImpl(); | 93 virtual ~WebWorkerImpl(); |
94 | 94 |
95 // Tasks that are run on the worker thread. | 95 // Tasks that are run on the worker thread. |
96 static void postMessageToWorkerContextTask( | 96 static void postMessageToWorkerContextTask( |
97 WebCore::ScriptExecutionContext* context, | 97 WebCore::ScriptExecutionContext* context, |
98 WebWorkerImpl* thisPtr, | 98 WebWorkerImpl* thisPtr, |
99 const WebCore::String& message, | 99 const WebCore::String& message, |
100 PassOwnPtr<WebCore::MessagePortChannelArray> channels); | 100 PassOwnPtr<WebCore::MessagePortChannelArray> channels); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 bool m_askedToTerminate; | 144 bool m_askedToTerminate; |
145 | 145 |
146 RefPtr<WebCore::WorkerThread> m_workerThread; | 146 RefPtr<WebCore::WorkerThread> m_workerThread; |
147 }; | 147 }; |
148 | 148 |
149 } // namespace WebKit | 149 } // namespace WebKit |
150 | 150 |
151 #endif // ENABLE(WORKERS) | 151 #endif // ENABLE(WORKERS) |
152 | 152 |
153 #endif | 153 #endif |
OLD | NEW |