OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 17 matching lines...) Expand all Loading... |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #ifndef WorkerThreadStartupData_h | 31 #ifndef WorkerThreadStartupData_h |
32 #define WorkerThreadStartupData_h | 32 #define WorkerThreadStartupData_h |
33 | 33 |
34 #include "bindings/core/v8/V8CacheOptions.h" | 34 #include "bindings/core/v8/V8CacheOptions.h" |
35 #include "core/CoreExport.h" | 35 #include "core/CoreExport.h" |
36 #include "core/frame/csp/ContentSecurityPolicy.h" | 36 #include "core/frame/csp/ContentSecurityPolicy.h" |
37 #include "core/workers/WorkerClients.h" | 37 #include "core/workers/WorkerClients.h" |
| 38 #include "core/workers/WorkerSettings.h" |
38 #include "core/workers/WorkerThread.h" | 39 #include "core/workers/WorkerThread.h" |
39 #include "platform/network/ContentSecurityPolicyParsers.h" | 40 #include "platform/network/ContentSecurityPolicyParsers.h" |
40 #include "platform/weborigin/KURL.h" | 41 #include "platform/weborigin/KURL.h" |
41 #include "public/platform/WebAddressSpace.h" | 42 #include "public/platform/WebAddressSpace.h" |
42 #include "wtf/Forward.h" | 43 #include "wtf/Forward.h" |
43 #include "wtf/Noncopyable.h" | 44 #include "wtf/Noncopyable.h" |
44 #include "wtf/PtrUtil.h" | 45 #include "wtf/PtrUtil.h" |
45 #include <memory> | 46 #include <memory> |
46 | 47 |
47 namespace blink { | 48 namespace blink { |
48 | 49 |
49 class WorkerClients; | 50 class WorkerClients; |
50 | 51 |
51 class CORE_EXPORT WorkerThreadStartupData final { | 52 class CORE_EXPORT WorkerThreadStartupData final { |
52 WTF_MAKE_NONCOPYABLE(WorkerThreadStartupData); | 53 WTF_MAKE_NONCOPYABLE(WorkerThreadStartupData); |
53 USING_FAST_MALLOC(WorkerThreadStartupData); | 54 USING_FAST_MALLOC(WorkerThreadStartupData); |
54 public: | 55 public: |
55 static std::unique_ptr<WorkerThreadStartupData> create(const KURL& scriptURL
, const String& userAgent, const String& sourceCode, std::unique_ptr<Vector<char
>> cachedMetaData, WorkerThreadStartMode startMode, const Vector<CSPHeaderAndTyp
e>* contentSecurityPolicyHeaders, const String& referrerPolicy, const SecurityOr
igin* starterOrigin, WorkerClients* workerClients, WebAddressSpace addressSpace,
const Vector<String>* originTrialTokens, V8CacheOptions v8CacheOptions = V8Cach
eOptionsDefault) | 56 static std::unique_ptr<WorkerThreadStartupData> create(const KURL& scriptURL
, const String& userAgent, const String& sourceCode, std::unique_ptr<Vector<char
>> cachedMetaData, WorkerThreadStartMode startMode, const Vector<CSPHeaderAndTyp
e>* contentSecurityPolicyHeaders, const String& referrerPolicy, const SecurityOr
igin* starterOrigin, WorkerClients* workerClients, WebAddressSpace addressSpace,
const Vector<String>* originTrialTokens, std::unique_ptr<WorkerSettings> worker
Settings, V8CacheOptions v8CacheOptions = V8CacheOptionsDefault) |
56 { | 57 { |
57 return wrapUnique(new WorkerThreadStartupData(scriptURL, userAgent, sour
ceCode, std::move(cachedMetaData), startMode, contentSecurityPolicyHeaders, refe
rrerPolicy, starterOrigin, workerClients, addressSpace, originTrialTokens, v8Cac
heOptions)); | 58 return wrapUnique(new WorkerThreadStartupData(scriptURL, userAgent, sour
ceCode, std::move(cachedMetaData), startMode, contentSecurityPolicyHeaders, refe
rrerPolicy, starterOrigin, workerClients, addressSpace, originTrialTokens, std::
move(workerSettings), v8CacheOptions)); |
58 } | 59 } |
59 | 60 |
60 ~WorkerThreadStartupData(); | 61 ~WorkerThreadStartupData(); |
61 | 62 |
62 KURL m_scriptURL; | 63 KURL m_scriptURL; |
63 String m_userAgent; | 64 String m_userAgent; |
64 String m_sourceCode; | 65 String m_sourceCode; |
65 std::unique_ptr<Vector<char>> m_cachedMetaData; | 66 std::unique_ptr<Vector<char>> m_cachedMetaData; |
66 WorkerThreadStartMode m_startMode; | 67 WorkerThreadStartMode m_startMode; |
67 std::unique_ptr<Vector<CSPHeaderAndType>> m_contentSecurityPolicyHeaders; | 68 std::unique_ptr<Vector<CSPHeaderAndType>> m_contentSecurityPolicyHeaders; |
(...skipping 17 matching lines...) Expand all Loading... |
85 // structure is passed along to the new worker thread, where it is finalized
. | 86 // structure is passed along to the new worker thread, where it is finalized
. |
86 // | 87 // |
87 // Hence, CrossThreadPersistent<> is required to allow finalization | 88 // Hence, CrossThreadPersistent<> is required to allow finalization |
88 // to happen on a thread different than the thread creating the | 89 // to happen on a thread different than the thread creating the |
89 // persistent reference. If the worker thread creation context | 90 // persistent reference. If the worker thread creation context |
90 // supplies no extra 'clients', m_workerClients can be left as empty/null. | 91 // supplies no extra 'clients', m_workerClients can be left as empty/null. |
91 CrossThreadPersistent<WorkerClients> m_workerClients; | 92 CrossThreadPersistent<WorkerClients> m_workerClients; |
92 | 93 |
93 WebAddressSpace m_addressSpace; | 94 WebAddressSpace m_addressSpace; |
94 | 95 |
| 96 std::unique_ptr<WorkerSettings> m_workerSettings; |
| 97 |
95 V8CacheOptions m_v8CacheOptions; | 98 V8CacheOptions m_v8CacheOptions; |
96 | 99 |
97 private: | 100 private: |
98 WorkerThreadStartupData(const KURL& scriptURL, const String& userAgent, cons
t String& sourceCode, std::unique_ptr<Vector<char>> cachedMetaData, WorkerThread
StartMode, const Vector<CSPHeaderAndType>* contentSecurityPolicyHeaders, const S
tring& referrerPolicy, const SecurityOrigin*, WorkerClients*, WebAddressSpace, c
onst Vector<String>* originTrialTokens, V8CacheOptions); | 101 WorkerThreadStartupData(const KURL& scriptURL, const String& userAgent, cons
t String& sourceCode, std::unique_ptr<Vector<char>> cachedMetaData, WorkerThread
StartMode, const Vector<CSPHeaderAndType>* contentSecurityPolicyHeaders, const S
tring& referrerPolicy, const SecurityOrigin*, WorkerClients*, WebAddressSpace, c
onst Vector<String>* originTrialTokens, std::unique_ptr<WorkerSettings>, V8Cache
Options); |
99 }; | 102 }; |
100 | 103 |
101 } // namespace blink | 104 } // namespace blink |
102 | 105 |
103 #endif // WorkerThreadStartupData_h | 106 #endif // WorkerThreadStartupData_h |
OLD | NEW |