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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 | 155 |
156 void ServiceWorkerGlobalScope::setRegistration(WebServiceWorkerRegistration* reg
istration) | 156 void ServiceWorkerGlobalScope::setRegistration(WebServiceWorkerRegistration* reg
istration) |
157 { | 157 { |
158 if (!executionContext()) { | 158 if (!executionContext()) { |
159 ServiceWorkerRegistration::dispose(registration); | 159 ServiceWorkerRegistration::dispose(registration); |
160 return; | 160 return; |
161 } | 161 } |
162 m_registration = ServiceWorkerRegistration::from(executionContext(), registr
ation); | 162 m_registration = ServiceWorkerRegistration::from(executionContext(), registr
ation); |
163 } | 163 } |
164 | 164 |
165 bool ServiceWorkerGlobalScope::addEventListener(const AtomicString& eventType, P
assRefPtr<EventListener> listener, bool useCapture) | 165 bool ServiceWorkerGlobalScope::addEventListener(const AtomicString& eventType, P
assRefPtrWillBeRawPtr<EventListener> listener, bool useCapture) |
166 { | 166 { |
167 if (m_didEvaluateScript) { | 167 if (m_didEvaluateScript) { |
168 if (eventType == EventTypeNames::install) { | 168 if (eventType == EventTypeNames::install) { |
169 RefPtrWillBeRawPtr<ConsoleMessage> consoleMessage = ConsoleMessage::
create(JSMessageSource, WarningMessageLevel, "Event handler of 'install' event m
ust be added on the initial evaluation of worker script."); | 169 RefPtrWillBeRawPtr<ConsoleMessage> consoleMessage = ConsoleMessage::
create(JSMessageSource, WarningMessageLevel, "Event handler of 'install' event m
ust be added on the initial evaluation of worker script."); |
170 addMessageToWorkerConsole(consoleMessage.release()); | 170 addMessageToWorkerConsole(consoleMessage.release()); |
171 } else if (eventType == EventTypeNames::activate) { | 171 } else if (eventType == EventTypeNames::activate) { |
172 RefPtrWillBeRawPtr<ConsoleMessage> consoleMessage = ConsoleMessage::
create(JSMessageSource, WarningMessageLevel, "Event handler of 'activate' event
must be added on the initial evaluation of worker script."); | 172 RefPtrWillBeRawPtr<ConsoleMessage> consoleMessage = ConsoleMessage::
create(JSMessageSource, WarningMessageLevel, "Event handler of 'activate' event
must be added on the initial evaluation of worker script."); |
173 addMessageToWorkerConsole(consoleMessage.release()); | 173 addMessageToWorkerConsole(consoleMessage.release()); |
174 } | 174 } |
175 } | 175 } |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 } | 235 } |
236 | 236 |
237 void ServiceWorkerGlobalScope::scriptLoaded(size_t scriptSize, size_t cachedMeta
dataSize) | 237 void ServiceWorkerGlobalScope::scriptLoaded(size_t scriptSize, size_t cachedMeta
dataSize) |
238 { | 238 { |
239 ++m_scriptCount; | 239 ++m_scriptCount; |
240 m_scriptTotalSize += scriptSize; | 240 m_scriptTotalSize += scriptSize; |
241 m_scriptCachedMetadataTotalSize += cachedMetadataSize; | 241 m_scriptCachedMetadataTotalSize += cachedMetadataSize; |
242 } | 242 } |
243 | 243 |
244 } // namespace blink | 244 } // namespace blink |
OLD | NEW |