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

Side by Side Diff: Source/web/ServiceWorkerGlobalScopeProxy.cpp

Issue 1187573003: Fix for default value of FetchEvent.cancellable (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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
« no previous file with comments | « Source/modules/serviceworkers/FetchEvent.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 RespondWithObserver* observer = RespondWithObserver::create(m_workerGlobalSc ope, eventID, webRequest.mode(), webRequest.frameType()); 98 RespondWithObserver* observer = RespondWithObserver::create(m_workerGlobalSc ope, eventID, webRequest.mode(), webRequest.frameType());
99 bool defaultPrevented = false; 99 bool defaultPrevented = false;
100 if (!RuntimeEnabledFeatures::serviceWorkerOnFetchEnabled()) { 100 if (!RuntimeEnabledFeatures::serviceWorkerOnFetchEnabled()) {
101 observer->didDispatchEvent(defaultPrevented); 101 observer->didDispatchEvent(defaultPrevented);
102 return; 102 return;
103 } 103 }
104 104
105 Request* request = Request::create(m_workerGlobalScope, webRequest); 105 Request* request = Request::create(m_workerGlobalScope, webRequest);
106 request->headers()->setGuard(Headers::ImmutableGuard); 106 request->headers()->setGuard(Headers::ImmutableGuard);
107 FetchEventInit eventInit; 107 FetchEventInit eventInit;
108 eventInit.setCancelable(true);
108 eventInit.setRequest(request); 109 eventInit.setRequest(request);
109 eventInit.setIsReload(webRequest.isReload()); 110 eventInit.setIsReload(webRequest.isReload());
110 RefPtrWillBeRawPtr<FetchEvent> fetchEvent(FetchEvent::create(EventTypeNames: :fetch, eventInit, observer)); 111 RefPtrWillBeRawPtr<FetchEvent> fetchEvent(FetchEvent::create(EventTypeNames: :fetch, eventInit, observer));
111 defaultPrevented = !m_workerGlobalScope->dispatchEvent(fetchEvent.release()) ; 112 defaultPrevented = !m_workerGlobalScope->dispatchEvent(fetchEvent.release()) ;
112 observer->didDispatchEvent(defaultPrevented); 113 observer->didDispatchEvent(defaultPrevented);
113 } 114 }
114 115
115 void ServiceWorkerGlobalScopeProxy::dispatchGeofencingEvent(int eventID, WebGeof encingEventType eventType, const WebString& regionID, const WebCircularGeofencin gRegion& region) 116 void ServiceWorkerGlobalScopeProxy::dispatchGeofencingEvent(int eventID, WebGeof encingEventType eventType, const WebString& regionID, const WebCircularGeofencin gRegion& region)
116 { 117 {
117 ASSERT(m_workerGlobalScope); 118 ASSERT(m_workerGlobalScope);
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 240
240 ServiceWorkerGlobalScopeProxy::ServiceWorkerGlobalScopeProxy(WebEmbeddedWorkerIm pl& embeddedWorker, Document& document, WebServiceWorkerContextClient& client) 241 ServiceWorkerGlobalScopeProxy::ServiceWorkerGlobalScopeProxy(WebEmbeddedWorkerIm pl& embeddedWorker, Document& document, WebServiceWorkerContextClient& client)
241 : m_embeddedWorker(embeddedWorker) 242 : m_embeddedWorker(embeddedWorker)
242 , m_document(document) 243 , m_document(document)
243 , m_client(client) 244 , m_client(client)
244 , m_workerGlobalScope(0) 245 , m_workerGlobalScope(0)
245 { 246 {
246 } 247 }
247 248
248 } // namespace blink 249 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/serviceworkers/FetchEvent.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698