| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 public: | 51 public: |
| 52 explicit WorkerMessagingProxy(Worker*); | 52 explicit WorkerMessagingProxy(Worker*); |
| 53 | 53 |
| 54 // Implementations of WorkerContextProxy. | 54 // Implementations of WorkerContextProxy. |
| 55 // (Only use these methods in the worker object thread.) | 55 // (Only use these methods in the worker object thread.) |
| 56 virtual void startWorkerContext(const KURL& scriptURL, const String& use
rAgent, const String& sourceCode, WorkerThreadStartMode) OVERRIDE; | 56 virtual void startWorkerContext(const KURL& scriptURL, const String& use
rAgent, const String& sourceCode, WorkerThreadStartMode) OVERRIDE; |
| 57 virtual void terminateWorkerContext() OVERRIDE; | 57 virtual void terminateWorkerContext() OVERRIDE; |
| 58 virtual void postMessageToWorkerContext(PassRefPtr<SerializedScriptValue
>, PassOwnPtr<MessagePortChannelArray>) OVERRIDE; | 58 virtual void postMessageToWorkerContext(PassRefPtr<SerializedScriptValue
>, PassOwnPtr<MessagePortChannelArray>) OVERRIDE; |
| 59 virtual bool hasPendingActivity() const OVERRIDE; | 59 virtual bool hasPendingActivity() const OVERRIDE; |
| 60 virtual void workerObjectDestroyed() OVERRIDE; | 60 virtual void workerObjectDestroyed() OVERRIDE; |
| 61 #if ENABLE(INSPECTOR) | |
| 62 virtual void connectToInspector(WorkerContextProxy::PageInspector*) OVER
RIDE; | 61 virtual void connectToInspector(WorkerContextProxy::PageInspector*) OVER
RIDE; |
| 63 virtual void disconnectFromInspector() OVERRIDE; | 62 virtual void disconnectFromInspector() OVERRIDE; |
| 64 virtual void sendMessageToInspector(const String&) OVERRIDE; | 63 virtual void sendMessageToInspector(const String&) OVERRIDE; |
| 65 #endif | |
| 66 | 64 |
| 67 // Implementations of WorkerObjectProxy. | 65 // Implementations of WorkerObjectProxy. |
| 68 // (Only use these methods in the worker context thread.) | 66 // (Only use these methods in the worker context thread.) |
| 69 virtual void postMessageToWorkerObject(PassRefPtr<SerializedScriptValue>
, PassOwnPtr<MessagePortChannelArray>) OVERRIDE; | 67 virtual void postMessageToWorkerObject(PassRefPtr<SerializedScriptValue>
, PassOwnPtr<MessagePortChannelArray>) OVERRIDE; |
| 70 virtual void postExceptionToWorkerObject(const String& errorMessage, int
lineNumber, const String& sourceURL) OVERRIDE; | 68 virtual void postExceptionToWorkerObject(const String& errorMessage, int
lineNumber, const String& sourceURL) OVERRIDE; |
| 71 virtual void postConsoleMessageToWorkerObject(MessageSource, MessageLeve
l, const String& message, int lineNumber, const String& sourceURL) OVERRIDE; | 69 virtual void postConsoleMessageToWorkerObject(MessageSource, MessageLeve
l, const String& message, int lineNumber, const String& sourceURL) OVERRIDE; |
| 72 #if ENABLE(INSPECTOR) | |
| 73 virtual void postMessageToPageInspector(const String&) OVERRIDE; | 70 virtual void postMessageToPageInspector(const String&) OVERRIDE; |
| 74 virtual void updateInspectorStateCookie(const String&) OVERRIDE; | 71 virtual void updateInspectorStateCookie(const String&) OVERRIDE; |
| 75 #endif | |
| 76 virtual void confirmMessageFromWorkerObject(bool hasPendingActivity) OVE
RRIDE; | 72 virtual void confirmMessageFromWorkerObject(bool hasPendingActivity) OVE
RRIDE; |
| 77 virtual void reportPendingActivity(bool hasPendingActivity) OVERRIDE; | 73 virtual void reportPendingActivity(bool hasPendingActivity) OVERRIDE; |
| 78 virtual void workerContextClosed() OVERRIDE; | 74 virtual void workerContextClosed() OVERRIDE; |
| 79 virtual void workerContextDestroyed() OVERRIDE; | 75 virtual void workerContextDestroyed() OVERRIDE; |
| 80 | 76 |
| 81 // Implementation of WorkerLoaderProxy. | 77 // Implementation of WorkerLoaderProxy. |
| 82 // These methods are called on different threads to schedule loading | 78 // These methods are called on different threads to schedule loading |
| 83 // requests and to send callbacks back to WorkerContext. | 79 // requests and to send callbacks back to WorkerContext. |
| 84 virtual void postTaskToLoader(PassOwnPtr<ScriptExecutionContext::Task>)
OVERRIDE; | 80 virtual void postTaskToLoader(PassOwnPtr<ScriptExecutionContext::Task>)
OVERRIDE; |
| 85 virtual bool postTaskForModeToWorkerContext(PassOwnPtr<ScriptExecutionCo
ntext::Task>, const String& mode) OVERRIDE; | 81 virtual bool postTaskForModeToWorkerContext(PassOwnPtr<ScriptExecutionCo
ntext::Task>, const String& mode) OVERRIDE; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 108 Worker* m_workerObject; | 104 Worker* m_workerObject; |
| 109 bool m_mayBeDestroyed; | 105 bool m_mayBeDestroyed; |
| 110 RefPtr<DedicatedWorkerThread> m_workerThread; | 106 RefPtr<DedicatedWorkerThread> m_workerThread; |
| 111 | 107 |
| 112 unsigned m_unconfirmedMessageCount; // Unconfirmed messages from worker
object to worker thread. | 108 unsigned m_unconfirmedMessageCount; // Unconfirmed messages from worker
object to worker thread. |
| 113 bool m_workerThreadHadPendingActivity; // The latest confirmation from w
orker thread reported that it was still active. | 109 bool m_workerThreadHadPendingActivity; // The latest confirmation from w
orker thread reported that it was still active. |
| 114 | 110 |
| 115 bool m_askedToTerminate; | 111 bool m_askedToTerminate; |
| 116 | 112 |
| 117 Vector<OwnPtr<ScriptExecutionContext::Task> > m_queuedEarlyTasks; // Tas
ks are queued here until there's a thread object created. | 113 Vector<OwnPtr<ScriptExecutionContext::Task> > m_queuedEarlyTasks; // Tas
ks are queued here until there's a thread object created. |
| 118 #if ENABLE(INSPECTOR) | |
| 119 WorkerContextProxy::PageInspector* m_pageInspector; | 114 WorkerContextProxy::PageInspector* m_pageInspector; |
| 120 #endif | |
| 121 }; | 115 }; |
| 122 | 116 |
| 123 } // namespace WebCore | 117 } // namespace WebCore |
| 124 | 118 |
| 125 #endif // ENABLE(WORKERS) | 119 #endif // ENABLE(WORKERS) |
| 126 | 120 |
| 127 #endif // WorkerMessagingProxy_h | 121 #endif // WorkerMessagingProxy_h |
| OLD | NEW |