Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(90)

Side by Side Diff: third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScope.cpp

Issue 1479923002: Enumerate the return value of dispatchEvent so it is clear. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master_passive_uma_add
Patch Set: Fix typo Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 } 160 }
161 } 161 }
162 return WorkerGlobalScope::addEventListenerInternal(eventType, listener, opti ons); 162 return WorkerGlobalScope::addEventListenerInternal(eventType, listener, opti ons);
163 } 163 }
164 164
165 const AtomicString& ServiceWorkerGlobalScope::interfaceName() const 165 const AtomicString& ServiceWorkerGlobalScope::interfaceName() const
166 { 166 {
167 return EventTargetNames::ServiceWorkerGlobalScope; 167 return EventTargetNames::ServiceWorkerGlobalScope;
168 } 168 }
169 169
170 bool ServiceWorkerGlobalScope::dispatchEventInternal(PassRefPtrWillBeRawPtr<Even t> event) 170 DispatchEventResult ServiceWorkerGlobalScope::dispatchEventInternal(PassRefPtrWi llBeRawPtr<Event> event)
171 { 171 {
172 m_eventNestingLevel++; 172 m_eventNestingLevel++;
173 bool result = WorkerGlobalScope::dispatchEventInternal(event.get()); 173 DispatchEventResult dispatchResult = WorkerGlobalScope::dispatchEventInterna l(event.get());
174 if (event->interfaceName() == EventNames::ErrorEvent && m_eventNestingLevel == 2) 174 if (event->interfaceName() == EventNames::ErrorEvent && m_eventNestingLevel == 2)
175 m_hadErrorInTopLevelEventHandler = true; 175 m_hadErrorInTopLevelEventHandler = true;
176 m_eventNestingLevel--; 176 m_eventNestingLevel--;
177 return result; 177 return dispatchResult;
178 } 178 }
179 179
180 void ServiceWorkerGlobalScope::dispatchExtendableEvent(PassRefPtrWillBeRawPtr<Ev ent> event, WaitUntilObserver* observer) 180 void ServiceWorkerGlobalScope::dispatchExtendableEvent(PassRefPtrWillBeRawPtr<Ev ent> event, WaitUntilObserver* observer)
181 { 181 {
182 ASSERT(m_eventNestingLevel == 0); 182 ASSERT(m_eventNestingLevel == 0);
183 m_hadErrorInTopLevelEventHandler = false; 183 m_hadErrorInTopLevelEventHandler = false;
184 184
185 observer->willDispatchEvent(); 185 observer->willDispatchEvent();
186 dispatchEvent(event); 186 dispatchEvent(event);
187 if (thread()->terminated()) 187 if (thread()->terminated())
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 } 221 }
222 222
223 void ServiceWorkerGlobalScope::scriptLoaded(size_t scriptSize, size_t cachedMeta dataSize) 223 void ServiceWorkerGlobalScope::scriptLoaded(size_t scriptSize, size_t cachedMeta dataSize)
224 { 224 {
225 ++m_scriptCount; 225 ++m_scriptCount;
226 m_scriptTotalSize += scriptSize; 226 m_scriptTotalSize += scriptSize;
227 m_scriptCachedMetadataTotalSize += cachedMetadataSize; 227 m_scriptCachedMetadataTotalSize += cachedMetadataSize;
228 } 228 }
229 229
230 } // namespace blink 230 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698