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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 | 163 |
164 void ServiceWorkerGlobalScope::setRegistration(WebServiceWorkerRegistration* reg
istration) | 164 void ServiceWorkerGlobalScope::setRegistration(WebServiceWorkerRegistration* reg
istration) |
165 { | 165 { |
166 if (!executionContext()) { | 166 if (!executionContext()) { |
167 ServiceWorkerRegistration::dispose(registration); | 167 ServiceWorkerRegistration::dispose(registration); |
168 return; | 168 return; |
169 } | 169 } |
170 m_registration = ServiceWorkerRegistration::from(executionContext(), registr
ation); | 170 m_registration = ServiceWorkerRegistration::from(executionContext(), registr
ation); |
171 } | 171 } |
172 | 172 |
173 bool ServiceWorkerGlobalScope::addEventListener(const AtomicString& eventType, P
assRefPtr<EventListener> listener, bool useCapture) | 173 bool ServiceWorkerGlobalScope::addEventListener(const AtomicString& eventType, P
assRefPtrWillBeRawPtr<EventListener> listener, bool useCapture) |
174 { | 174 { |
175 if (m_didEvaluateScript) { | 175 if (m_didEvaluateScript) { |
176 if (eventType == EventTypeNames::install) { | 176 if (eventType == EventTypeNames::install) { |
177 RefPtrWillBeRawPtr<ConsoleMessage> consoleMessage = ConsoleMessage::
create(JSMessageSource, WarningMessageLevel, "Event handler of 'install' event m
ust be added on the initial evaluation of worker script."); | 177 RefPtrWillBeRawPtr<ConsoleMessage> consoleMessage = ConsoleMessage::
create(JSMessageSource, WarningMessageLevel, "Event handler of 'install' event m
ust be added on the initial evaluation of worker script."); |
178 addMessageToWorkerConsole(consoleMessage.release()); | 178 addMessageToWorkerConsole(consoleMessage.release()); |
179 } else if (eventType == EventTypeNames::activate) { | 179 } else if (eventType == EventTypeNames::activate) { |
180 RefPtrWillBeRawPtr<ConsoleMessage> consoleMessage = ConsoleMessage::
create(JSMessageSource, WarningMessageLevel, "Event handler of 'activate' event
must be added on the initial evaluation of worker script."); | 180 RefPtrWillBeRawPtr<ConsoleMessage> consoleMessage = ConsoleMessage::
create(JSMessageSource, WarningMessageLevel, "Event handler of 'activate' event
must be added on the initial evaluation of worker script."); |
181 addMessageToWorkerConsole(consoleMessage.release()); | 181 addMessageToWorkerConsole(consoleMessage.release()); |
182 } | 182 } |
183 } | 183 } |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 } | 244 } |
245 | 245 |
246 void ServiceWorkerGlobalScope::scriptLoaded(size_t scriptSize, size_t cachedMeta
dataSize) | 246 void ServiceWorkerGlobalScope::scriptLoaded(size_t scriptSize, size_t cachedMeta
dataSize) |
247 { | 247 { |
248 ++m_scriptCount; | 248 ++m_scriptCount; |
249 m_scriptTotalSize += scriptSize; | 249 m_scriptTotalSize += scriptSize; |
250 m_scriptCachedMetadataTotalSize += cachedMetadataSize; | 250 m_scriptCachedMetadataTotalSize += cachedMetadataSize; |
251 } | 251 } |
252 | 252 |
253 } // namespace blink | 253 } // namespace blink |
OLD | NEW |