| 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 28 matching lines...) Expand all Loading... |
| 39 | 39 |
| 40 namespace blink { | 40 namespace blink { |
| 41 | 41 |
| 42 class WorkerObjectProxy; | 42 class WorkerObjectProxy; |
| 43 class DedicatedWorkerThread; | 43 class DedicatedWorkerThread; |
| 44 class ExecutionContext; | 44 class ExecutionContext; |
| 45 class Worker; | 45 class Worker; |
| 46 class WorkerClients; | 46 class WorkerClients; |
| 47 class WorkerInspectorProxy; | 47 class WorkerInspectorProxy; |
| 48 | 48 |
| 49 class WorkerMessagingProxy final | 49 class WorkerMessagingProxy |
| 50 : public WorkerGlobalScopeProxy | 50 : public WorkerGlobalScopeProxy |
| 51 , private WorkerLoaderProxyProvider { | 51 , private WorkerLoaderProxyProvider { |
| 52 WTF_MAKE_NONCOPYABLE(WorkerMessagingProxy); | 52 WTF_MAKE_NONCOPYABLE(WorkerMessagingProxy); |
| 53 WTF_MAKE_FAST_ALLOCATED; | 53 WTF_MAKE_FAST_ALLOCATED; |
| 54 public: | 54 public: |
| 55 WorkerMessagingProxy(Worker*, PassOwnPtrWillBeRawPtr<WorkerClients>); | 55 WorkerMessagingProxy(Worker*, PassOwnPtrWillBeRawPtr<WorkerClients>); |
| 56 | 56 |
| 57 // Implementations of WorkerGlobalScopeProxy. | 57 // Implementations of WorkerGlobalScopeProxy. |
| 58 // (Only use these methods in the worker object thread.) | 58 // (Only use these methods in the worker object thread.) |
| 59 virtual void startWorkerGlobalScope(const KURL& scriptURL, const String& use
rAgent, const String& sourceCode, WorkerThreadStartMode) override; | 59 virtual void startWorkerGlobalScope(const KURL& scriptURL, const String& use
rAgent, const String& sourceCode, WorkerThreadStartMode) override; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 73 void confirmMessageFromWorkerObject(bool hasPendingActivity); | 73 void confirmMessageFromWorkerObject(bool hasPendingActivity); |
| 74 void reportPendingActivity(bool hasPendingActivity); | 74 void reportPendingActivity(bool hasPendingActivity); |
| 75 void workerGlobalScopeClosed(); | 75 void workerGlobalScopeClosed(); |
| 76 void workerThreadTerminated(); | 76 void workerThreadTerminated(); |
| 77 | 77 |
| 78 void workerThreadCreated(PassRefPtr<DedicatedWorkerThread>); | 78 void workerThreadCreated(PassRefPtr<DedicatedWorkerThread>); |
| 79 | 79 |
| 80 protected: | 80 protected: |
| 81 virtual ~WorkerMessagingProxy(); | 81 virtual ~WorkerMessagingProxy(); |
| 82 | 82 |
| 83 virtual PassRefPtr<DedicatedWorkerThread> createWorkerThread(double originTi
me, PassOwnPtrWillBeRawPtr<WorkerThreadStartupData>); |
| 84 |
| 85 PassRefPtr<WorkerLoaderProxy> loaderProxy() { return m_loaderProxy; } |
| 86 WorkerObjectProxy& workerObjectProxy() { return *m_workerObjectProxy.get();
} |
| 87 |
| 83 private: | 88 private: |
| 84 static void workerObjectDestroyedInternal(ExecutionContext*, WorkerMessaging
Proxy*); | 89 static void workerObjectDestroyedInternal(ExecutionContext*, WorkerMessaging
Proxy*); |
| 85 void terminateInternally(); | 90 void terminateInternally(); |
| 86 | 91 |
| 87 // WorkerLoaderProxyProvider | 92 // WorkerLoaderProxyProvider |
| 88 // These methods are called on different threads to schedule loading | 93 // These methods are called on different threads to schedule loading |
| 89 // requests and to send callbacks back to WorkerGlobalScope. | 94 // requests and to send callbacks back to WorkerGlobalScope. |
| 90 virtual void postTaskToLoader(PassOwnPtr<ExecutionContextTask>) override; | 95 virtual void postTaskToLoader(PassOwnPtr<ExecutionContextTask>) override; |
| 91 virtual bool postTaskToWorkerGlobalScope(PassOwnPtr<ExecutionContextTask>) o
verride; | 96 virtual bool postTaskToWorkerGlobalScope(PassOwnPtr<ExecutionContextTask>) o
verride; |
| 92 | 97 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 105 OwnPtr<WorkerInspectorProxy> m_workerInspectorProxy; | 110 OwnPtr<WorkerInspectorProxy> m_workerInspectorProxy; |
| 106 | 111 |
| 107 OwnPtrWillBePersistent<WorkerClients> m_workerClients; | 112 OwnPtrWillBePersistent<WorkerClients> m_workerClients; |
| 108 | 113 |
| 109 RefPtr<WorkerLoaderProxy> m_loaderProxy; | 114 RefPtr<WorkerLoaderProxy> m_loaderProxy; |
| 110 }; | 115 }; |
| 111 | 116 |
| 112 } // namespace blink | 117 } // namespace blink |
| 113 | 118 |
| 114 #endif // WorkerMessagingProxy_h | 119 #endif // WorkerMessagingProxy_h |
| OLD | NEW |