|
Lines 79-88
unsigned WorkerThread::workerThreadCount()
a/Source/WebCore/workers/WorkerThread.cpp_sec1
|
| 79 |
struct WorkerThreadStartupData { |
79 |
struct WorkerThreadStartupData { |
| 80 |
WTF_MAKE_NONCOPYABLE(WorkerThreadStartupData); WTF_MAKE_FAST_ALLOCATED; |
80 |
WTF_MAKE_NONCOPYABLE(WorkerThreadStartupData); WTF_MAKE_FAST_ALLOCATED; |
| 81 |
public: |
81 |
public: |
| 82 |
static PassOwnPtr<WorkerThreadStartupData> create(const URL& scriptURL, const String& userAgent, const GroupSettings* settings, const String& sourceCode, WorkerThreadStartMode startMode, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType, const SecurityOrigin* topOrigin) |
82 |
WorkerThreadStartupData(const URL& scriptURL, const String& userAgent, const GroupSettings*, const String& sourceCode, WorkerThreadStartMode, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType, const SecurityOrigin* topOrigin); |
| 83 |
{ |
|
|
| 84 |
return adoptPtr(new WorkerThreadStartupData(scriptURL, userAgent, settings, sourceCode, startMode, contentSecurityPolicy, contentSecurityPolicyType, topOrigin)); |
| 85 |
} |
| 86 |
|
83 |
|
| 87 |
URL m_scriptURL; |
84 |
URL m_scriptURL; |
| 88 |
String m_userAgent; |
85 |
String m_userAgent; |
|
Lines 92-99
public:
a/Source/WebCore/workers/WorkerThread.cpp_sec2
|
| 92 |
String m_contentSecurityPolicy; |
89 |
String m_contentSecurityPolicy; |
| 93 |
ContentSecurityPolicy::HeaderType m_contentSecurityPolicyType; |
90 |
ContentSecurityPolicy::HeaderType m_contentSecurityPolicyType; |
| 94 |
RefPtr<SecurityOrigin> m_topOrigin; |
91 |
RefPtr<SecurityOrigin> m_topOrigin; |
| 95 |
private: |
|
|
| 96 |
WorkerThreadStartupData(const URL& scriptURL, const String& userAgent, const GroupSettings*, const String& sourceCode, WorkerThreadStartMode, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType, const SecurityOrigin* topOrigin); |
| 97 |
}; |
92 |
}; |
| 98 |
|
93 |
|
| 99 |
WorkerThreadStartupData::WorkerThreadStartupData(const URL& scriptURL, const String& userAgent, const GroupSettings* settings, const String& sourceCode, WorkerThreadStartMode startMode, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType, const SecurityOrigin* topOrigin) |
94 |
WorkerThreadStartupData::WorkerThreadStartupData(const URL& scriptURL, const String& userAgent, const GroupSettings* settings, const String& sourceCode, WorkerThreadStartMode startMode, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType, const SecurityOrigin* topOrigin) |
|
Lines 118-124
WorkerThread::WorkerThread(const URL& scriptURL, const String& userAgent, const
a/Source/WebCore/workers/WorkerThread.cpp_sec3
|
| 118 |
: m_threadID(0) |
113 |
: m_threadID(0) |
| 119 |
, m_workerLoaderProxy(workerLoaderProxy) |
114 |
, m_workerLoaderProxy(workerLoaderProxy) |
| 120 |
, m_workerReportingProxy(workerReportingProxy) |
115 |
, m_workerReportingProxy(workerReportingProxy) |
| 121 |
, m_startupData(WorkerThreadStartupData::create(scriptURL, userAgent, settings, sourceCode, startMode, contentSecurityPolicy, contentSecurityPolicyType, topOrigin)) |
116 |
, m_startupData(std::make_unique<WorkerThreadStartupData>(scriptURL, userAgent, settings, sourceCode, startMode, contentSecurityPolicy, contentSecurityPolicyType, topOrigin)) |
| 122 |
#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) |
117 |
#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) |
| 123 |
, m_notificationClient(0) |
118 |
, m_notificationClient(0) |
| 124 |
#endif |
119 |
#endif |
|
Lines 180-186
void WorkerThread::workerThread()
a/Source/WebCore/workers/WorkerThread.cpp_sec4
|
| 180 |
// Free the startup data to cause its member variable deref's happen on the worker's thread (since |
175 |
// Free the startup data to cause its member variable deref's happen on the worker's thread (since |
| 181 |
// all ref/derefs of these objects are happening on the thread at this point). Note that |
176 |
// all ref/derefs of these objects are happening on the thread at this point). Note that |
| 182 |
// WorkerThread::~WorkerThread happens on a different thread where it was created. |
177 |
// WorkerThread::~WorkerThread happens on a different thread where it was created. |
| 183 |
m_startupData.clear(); |
178 |
m_startupData = nullptr; |
| 184 |
|
179 |
|
| 185 |
runEventLoop(); |
180 |
runEventLoop(); |
| 186 |
|
181 |
|