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 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 dispatchResult = workerGlobalScope()->dispatchEvent(fetc
hEvent.release()); |
310 observer->didDispatchEvent(defaultPrevented); | 309 observer->didDispatchEvent(dispatchResult); |
311 } | 310 } |
312 | 311 |
313 } // namespace blink | 312 } // namespace blink |
OLD | NEW |