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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 #include "modules/serviceworkers/Request.h" | 44 #include "modules/serviceworkers/Request.h" |
45 #include "modules/serviceworkers/ServiceWorkerClients.h" | 45 #include "modules/serviceworkers/ServiceWorkerClients.h" |
46 #include "modules/serviceworkers/ServiceWorkerGlobalScopeClient.h" | 46 #include "modules/serviceworkers/ServiceWorkerGlobalScopeClient.h" |
47 #include "modules/serviceworkers/ServiceWorkerThread.h" | 47 #include "modules/serviceworkers/ServiceWorkerThread.h" |
48 #include "platform/network/ResourceRequest.h" | 48 #include "platform/network/ResourceRequest.h" |
49 #include "platform/weborigin/KURL.h" | 49 #include "platform/weborigin/KURL.h" |
50 #include "public/platform/WebURL.h" | 50 #include "public/platform/WebURL.h" |
51 #include "public/platform/WebURLRequest.h" | 51 #include "public/platform/WebURLRequest.h" |
52 #include "wtf/CurrentTime.h" | 52 #include "wtf/CurrentTime.h" |
53 | 53 |
54 namespace WebCore { | 54 namespace blink { |
55 | 55 |
56 PassRefPtrWillBeRawPtr<ServiceWorkerGlobalScope> ServiceWorkerGlobalScope::creat
e(ServiceWorkerThread* thread, PassOwnPtrWillBeRawPtr<WorkerThreadStartupData> s
tartupData) | 56 PassRefPtrWillBeRawPtr<ServiceWorkerGlobalScope> ServiceWorkerGlobalScope::creat
e(ServiceWorkerThread* thread, PassOwnPtrWillBeRawPtr<WorkerThreadStartupData> s
tartupData) |
57 { | 57 { |
58 RefPtrWillBeRawPtr<ServiceWorkerGlobalScope> context = adoptRefWillBeRefCoun
tedGarbageCollected(new ServiceWorkerGlobalScope(startupData->m_scriptURL, start
upData->m_userAgent, thread, monotonicallyIncreasingTime(), startupData->m_worke
rClients.release())); | 58 RefPtrWillBeRawPtr<ServiceWorkerGlobalScope> context = adoptRefWillBeRefCoun
tedGarbageCollected(new ServiceWorkerGlobalScope(startupData->m_scriptURL, start
upData->m_userAgent, thread, monotonicallyIncreasingTime(), startupData->m_worke
rClients.release())); |
59 | 59 |
60 context->applyContentSecurityPolicyFromString(startupData->m_contentSecurity
Policy, startupData->m_contentSecurityPolicyType); | 60 context->applyContentSecurityPolicyFromString(startupData->m_contentSecurity
Policy, startupData->m_contentSecurityPolicyType); |
61 | 61 |
62 context->script()->evaluate(String(fetchPolyfillJs, sizeof(fetchPolyfillJs))
); | 62 context->script()->evaluate(String(fetchPolyfillJs, sizeof(fetchPolyfillJs))
); |
63 context->script()->evaluate(String(cachePolyfillJs, sizeof(cachePolyfillJs))
); | 63 context->script()->evaluate(String(cachePolyfillJs, sizeof(cachePolyfillJs))
); |
64 context->script()->evaluate(String(cacheStoragePolyfillJs, sizeof(cacheStora
gePolyfillJs))); | 64 context->script()->evaluate(String(cacheStoragePolyfillJs, sizeof(cacheStora
gePolyfillJs))); |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 visitor->trace(m_clients); | 122 visitor->trace(m_clients); |
123 WorkerGlobalScope::trace(visitor); | 123 WorkerGlobalScope::trace(visitor); |
124 } | 124 } |
125 | 125 |
126 void ServiceWorkerGlobalScope::logExceptionToConsole(const String& errorMessage,
const String& sourceURL, int lineNumber, int columnNumber, PassRefPtrWillBeRawP
tr<ScriptCallStack> callStack) | 126 void ServiceWorkerGlobalScope::logExceptionToConsole(const String& errorMessage,
const String& sourceURL, int lineNumber, int columnNumber, PassRefPtrWillBeRawP
tr<ScriptCallStack> callStack) |
127 { | 127 { |
128 WorkerGlobalScope::logExceptionToConsole(errorMessage, sourceURL, lineNumber
, columnNumber, callStack); | 128 WorkerGlobalScope::logExceptionToConsole(errorMessage, sourceURL, lineNumber
, columnNumber, callStack); |
129 addMessageToWorkerConsole(JSMessageSource, ErrorMessageLevel, errorMessage,
sourceURL, lineNumber, callStack, 0); | 129 addMessageToWorkerConsole(JSMessageSource, ErrorMessageLevel, errorMessage,
sourceURL, lineNumber, callStack, 0); |
130 } | 130 } |
131 | 131 |
132 } // namespace WebCore | 132 } // namespace blink |
OLD | NEW |