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

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

Issue 1241613004: Rework dispatchEvent so it is consistent for isTrusted support. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Work around MSVC optimization bug Created 5 years, 5 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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 } 182 }
183 } 183 }
184 return WorkerGlobalScope::addEventListener(eventType, listener, useCapture); 184 return WorkerGlobalScope::addEventListener(eventType, listener, useCapture);
185 } 185 }
186 186
187 const AtomicString& ServiceWorkerGlobalScope::interfaceName() const 187 const AtomicString& ServiceWorkerGlobalScope::interfaceName() const
188 { 188 {
189 return EventTargetNames::ServiceWorkerGlobalScope; 189 return EventTargetNames::ServiceWorkerGlobalScope;
190 } 190 }
191 191
192 bool ServiceWorkerGlobalScope::dispatchEvent(PassRefPtrWillBeRawPtr<Event> event ) 192 bool ServiceWorkerGlobalScope::dispatchEventInternal(PassRefPtrWillBeRawPtr<Even t> event)
193 { 193 {
194 m_eventNestingLevel++; 194 m_eventNestingLevel++;
195 bool result = WorkerGlobalScope::dispatchEvent(event.get()); 195 bool result = WorkerGlobalScope::dispatchEventInternal(event.get());
196 if (event->interfaceName() == EventNames::ErrorEvent && m_eventNestingLevel == 2 && !event->defaultPrevented()) 196 if (event->interfaceName() == EventNames::ErrorEvent && m_eventNestingLevel == 2 && !event->defaultPrevented())
197 m_hadErrorInTopLevelEventHandler = true; 197 m_hadErrorInTopLevelEventHandler = true;
198 m_eventNestingLevel--; 198 m_eventNestingLevel--;
199 return result; 199 return result;
200 } 200 }
201 201
202 void ServiceWorkerGlobalScope::dispatchExtendableEvent(PassRefPtrWillBeRawPtr<Ev ent> event, WaitUntilObserver* observer) 202 void ServiceWorkerGlobalScope::dispatchExtendableEvent(PassRefPtrWillBeRawPtr<Ev ent> event, WaitUntilObserver* observer)
203 { 203 {
204 ASSERT(m_eventNestingLevel == 0); 204 ASSERT(m_eventNestingLevel == 0);
205 m_hadErrorInTopLevelEventHandler = false; 205 m_hadErrorInTopLevelEventHandler = false;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698