| 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |