OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef InProcessWorkerBase_h | 5 #ifndef InProcessWorkerBase_h |
6 #define InProcessWorkerBase_h | 6 #define InProcessWorkerBase_h |
7 | 7 |
8 #include "bindings/core/v8/ActiveScriptWrappable.h" | 8 #include "bindings/core/v8/ActiveScriptWrappable.h" |
9 #include "core/CoreExport.h" | 9 #include "core/CoreExport.h" |
10 #include "core/dom/ActiveDOMObject.h" | 10 #include "core/dom/ActiveDOMObject.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 String referrerPolicy(); | 49 String referrerPolicy(); |
50 | 50 |
51 DEFINE_ATTRIBUTE_EVENT_LISTENER(message); | 51 DEFINE_ATTRIBUTE_EVENT_LISTENER(message); |
52 | 52 |
53 DECLARE_VIRTUAL_TRACE(); | 53 DECLARE_VIRTUAL_TRACE(); |
54 | 54 |
55 protected: | 55 protected: |
56 explicit InProcessWorkerBase(ExecutionContext*); | 56 explicit InProcessWorkerBase(ExecutionContext*); |
57 bool initialize(ExecutionContext*, const String&, ExceptionState&); | 57 bool initialize(ExecutionContext*, const String&, ExceptionState&); |
58 | 58 |
59 // Creates a proxy to allow communicating with the worker's global scope. InPr
ocessWorkerBase does not take ownership of the | 59 // Creates a proxy to allow communicating with the worker's global scope. |
60 // created proxy. The proxy is expected to manage its own lifetime, and delete
itself in response to terminateWorkerGlobalScope(). | 60 // InProcessWorkerBase does not take ownership of the created proxy. The proxy |
| 61 // is expected to manage its own lifetime, and delete itself in response to |
| 62 // terminateWorkerGlobalScope(). |
61 virtual InProcessWorkerMessagingProxy* createInProcessWorkerMessagingProxy( | 63 virtual InProcessWorkerMessagingProxy* createInProcessWorkerMessagingProxy( |
62 ExecutionContext*) = 0; | 64 ExecutionContext*) = 0; |
63 | 65 |
64 private: | 66 private: |
65 // Callbacks for m_scriptLoader. | 67 // Callbacks for m_scriptLoader. |
66 void onResponse(); | 68 void onResponse(); |
67 void onFinished(); | 69 void onFinished(); |
68 | 70 |
69 RefPtr<WorkerScriptLoader> m_scriptLoader; | 71 RefPtr<WorkerScriptLoader> m_scriptLoader; |
70 Member<ContentSecurityPolicy> m_contentSecurityPolicy; | 72 Member<ContentSecurityPolicy> m_contentSecurityPolicy; |
71 String m_referrerPolicy; | 73 String m_referrerPolicy; |
72 InProcessWorkerMessagingProxy* | 74 |
73 m_contextProxy; // The proxy outlives the worker to perform thread shutdo
wn. | 75 // The proxy outlives the worker to perform thread shutdown. |
| 76 InProcessWorkerMessagingProxy* m_contextProxy; |
74 }; | 77 }; |
75 | 78 |
76 } // namespace blink | 79 } // namespace blink |
77 | 80 |
78 #endif // InProcessWorkerBase_h | 81 #endif // InProcessWorkerBase_h |
OLD | NEW |