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

Side by Side Diff: third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.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 comments Created 4 years, 10 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 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 290
291 ServiceWorkerGlobalScope* ServiceWorkerGlobalScopeProxy::workerGlobalScope() con st 291 ServiceWorkerGlobalScope* ServiceWorkerGlobalScopeProxy::workerGlobalScope() con st
292 { 292 {
293 ASSERT(m_workerGlobalScope); 293 ASSERT(m_workerGlobalScope);
294 return m_workerGlobalScope; 294 return m_workerGlobalScope;
295 } 295 }
296 296
297 void ServiceWorkerGlobalScopeProxy::dispatchFetchEventImpl(int eventID, const We bServiceWorkerRequest& webRequest, const AtomicString& eventTypeName) 297 void ServiceWorkerGlobalScopeProxy::dispatchFetchEventImpl(int eventID, const We bServiceWorkerRequest& webRequest, const AtomicString& eventTypeName)
298 { 298 {
299 RespondWithObserver* observer = RespondWithObserver::create(workerGlobalScop e(), eventID, webRequest.url(), webRequest.mode(), webRequest.frameType(), webRe quest.requestContext()); 299 RespondWithObserver* observer = RespondWithObserver::create(workerGlobalScop e(), eventID, webRequest.url(), webRequest.mode(), webRequest.frameType(), webRe quest.requestContext());
300 bool defaultPrevented = false;
301 Request* request = Request::create(workerGlobalScope(), webRequest); 300 Request* request = Request::create(workerGlobalScope(), webRequest);
302 request->headers()->setGuard(Headers::ImmutableGuard); 301 request->headers()->setGuard(Headers::ImmutableGuard);
303 FetchEventInit eventInit; 302 FetchEventInit eventInit;
304 eventInit.setCancelable(true); 303 eventInit.setCancelable(true);
305 eventInit.setRequest(request); 304 eventInit.setRequest(request);
306 eventInit.setClientId(webRequest.isMainResourceLoad() ? WebString() : webReq uest.clientId()); 305 eventInit.setClientId(webRequest.isMainResourceLoad() ? WebString() : webReq uest.clientId());
307 eventInit.setIsReload(webRequest.isReload()); 306 eventInit.setIsReload(webRequest.isReload());
308 RefPtrWillBeRawPtr<FetchEvent> fetchEvent(FetchEvent::create(eventTypeName, eventInit, observer)); 307 RefPtrWillBeRawPtr<FetchEvent> fetchEvent(FetchEvent::create(eventTypeName, eventInit, observer));
309 defaultPrevented = !workerGlobalScope()->dispatchEvent(fetchEvent.release()) ; 308 DispatchEventResult eventResult = workerGlobalScope()->dispatchEvent(fetchEv ent.release());
310 observer->didDispatchEvent(defaultPrevented); 309 observer->didDispatchEvent(eventResult);
311 } 310 }
312 311
313 } // namespace blink 312 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698