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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 | 70 |
71 void onSuccess() override | 71 void onSuccess() override |
72 { | 72 { |
73 m_resolver->resolve(); | 73 m_resolver->resolve(); |
74 } | 74 } |
75 | 75 |
76 private: | 76 private: |
77 RefPtrWillBePersistent<ScriptPromiseResolver> m_resolver; | 77 RefPtrWillBePersistent<ScriptPromiseResolver> m_resolver; |
78 }; | 78 }; |
79 | 79 |
80 PassRefPtrWillBeRawPtr<ServiceWorkerGlobalScope> ServiceWorkerGlobalScope::creat
e(ServiceWorkerThread* thread, PassOwnPtrWillBeRawPtr<WorkerThreadStartupData> s
tartupData) | 80 PassRefPtrWillBeRawPtr<ServiceWorkerGlobalScope> ServiceWorkerGlobalScope::creat
e(ServiceWorkerThread* thread, PassOwnPtr<WorkerThreadStartupData> startupData) |
81 { | 81 { |
| 82 // Note: startupData is finalized on return. After the relevant parts has be
en |
| 83 // passed along to the created 'context'. |
82 RefPtrWillBeRawPtr<ServiceWorkerGlobalScope> context = adoptRefWillBeNoop(ne
w ServiceWorkerGlobalScope(startupData->m_scriptURL, startupData->m_userAgent, t
hread, monotonicallyIncreasingTime(), startupData->m_starterOrigin, startupData-
>m_workerClients.release())); | 84 RefPtrWillBeRawPtr<ServiceWorkerGlobalScope> context = adoptRefWillBeNoop(ne
w ServiceWorkerGlobalScope(startupData->m_scriptURL, startupData->m_userAgent, t
hread, monotonicallyIncreasingTime(), startupData->m_starterOrigin, startupData-
>m_workerClients.release())); |
83 | 85 |
84 context->setV8CacheOptions(startupData->m_v8CacheOptions); | 86 context->setV8CacheOptions(startupData->m_v8CacheOptions); |
85 context->applyContentSecurityPolicyFromString(startupData->m_contentSecurity
Policy, startupData->m_contentSecurityPolicyType); | 87 context->applyContentSecurityPolicyFromString(startupData->m_contentSecurity
Policy, startupData->m_contentSecurityPolicyType); |
86 | 88 |
87 return context.release(); | 89 return context.release(); |
88 } | 90 } |
89 | 91 |
90 ServiceWorkerGlobalScope::ServiceWorkerGlobalScope(const KURL& url, const String
& userAgent, ServiceWorkerThread* thread, double timeOrigin, const SecurityOrigi
n* starterOrigin, PassOwnPtrWillBeRawPtr<WorkerClients> workerClients) | 92 ServiceWorkerGlobalScope::ServiceWorkerGlobalScope(const KURL& url, const String
& userAgent, ServiceWorkerThread* thread, double timeOrigin, const SecurityOrigi
n* starterOrigin, PassOwnPtrWillBeRawPtr<WorkerClients> workerClients) |
91 : WorkerGlobalScope(url, userAgent, thread, timeOrigin, starterOrigin, worke
rClients) | 93 : WorkerGlobalScope(url, userAgent, thread, timeOrigin, starterOrigin, worke
rClients) |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 void ServiceWorkerGlobalScope::logExceptionToConsole(const String& errorMessage,
int scriptId, const String& sourceURL, int lineNumber, int columnNumber, PassRe
fPtrWillBeRawPtr<ScriptCallStack> callStack) | 229 void ServiceWorkerGlobalScope::logExceptionToConsole(const String& errorMessage,
int scriptId, const String& sourceURL, int lineNumber, int columnNumber, PassRe
fPtrWillBeRawPtr<ScriptCallStack> callStack) |
228 { | 230 { |
229 WorkerGlobalScope::logExceptionToConsole(errorMessage, scriptId, sourceURL,
lineNumber, columnNumber, callStack); | 231 WorkerGlobalScope::logExceptionToConsole(errorMessage, scriptId, sourceURL,
lineNumber, columnNumber, callStack); |
230 RefPtrWillBeRawPtr<ConsoleMessage> consoleMessage = ConsoleMessage::create(J
SMessageSource, ErrorMessageLevel, errorMessage, sourceURL, lineNumber); | 232 RefPtrWillBeRawPtr<ConsoleMessage> consoleMessage = ConsoleMessage::create(J
SMessageSource, ErrorMessageLevel, errorMessage, sourceURL, lineNumber); |
231 consoleMessage->setScriptId(scriptId); | 233 consoleMessage->setScriptId(scriptId); |
232 consoleMessage->setCallStack(callStack); | 234 consoleMessage->setCallStack(callStack); |
233 addMessageToWorkerConsole(consoleMessage.release()); | 235 addMessageToWorkerConsole(consoleMessage.release()); |
234 } | 236 } |
235 | 237 |
236 } // namespace blink | 238 } // namespace blink |
OLD | NEW |