| 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 { | 90 { |
| 91 ASSERT(m_workerGlobalScope); | 91 ASSERT(m_workerGlobalScope); |
| 92 WaitUntilObserver* observer = WaitUntilObserver::create(m_workerGlobalScope,
WaitUntilObserver::Activate, eventID); | 92 WaitUntilObserver* observer = WaitUntilObserver::create(m_workerGlobalScope,
WaitUntilObserver::Activate, eventID); |
| 93 RefPtrWillBeRawPtr<Event> event(ExtendableEvent::create(EventTypeNames::acti
vate, ExtendableEventInit(), observer)); | 93 RefPtrWillBeRawPtr<Event> event(ExtendableEvent::create(EventTypeNames::acti
vate, ExtendableEventInit(), observer)); |
| 94 m_workerGlobalScope->dispatchExtendableEvent(event.release(), observer); | 94 m_workerGlobalScope->dispatchExtendableEvent(event.release(), observer); |
| 95 } | 95 } |
| 96 | 96 |
| 97 void ServiceWorkerGlobalScopeProxy::dispatchFetchEvent(int eventID, const WebSer
viceWorkerRequest& webRequest) | 97 void ServiceWorkerGlobalScopeProxy::dispatchFetchEvent(int eventID, const WebSer
viceWorkerRequest& webRequest) |
| 98 { | 98 { |
| 99 ASSERT(m_workerGlobalScope); | 99 ASSERT(m_workerGlobalScope); |
| 100 RespondWithObserver* observer = RespondWithObserver::create(m_workerGlobalSc
ope, eventID, webRequest.mode(), webRequest.frameType()); | 100 RespondWithObserver* observer = RespondWithObserver::create(m_workerGlobalSc
ope, eventID, webRequest.url(), webRequest.mode(), webRequest.frameType()); |
| 101 bool defaultPrevented = false; | 101 bool defaultPrevented = false; |
| 102 Request* request = Request::create(m_workerGlobalScope, webRequest); | 102 Request* request = Request::create(m_workerGlobalScope, webRequest); |
| 103 request->headers()->setGuard(Headers::ImmutableGuard); | 103 request->headers()->setGuard(Headers::ImmutableGuard); |
| 104 FetchEventInit eventInit; | 104 FetchEventInit eventInit; |
| 105 eventInit.setCancelable(true); | 105 eventInit.setCancelable(true); |
| 106 eventInit.setRequest(request); | 106 eventInit.setRequest(request); |
| 107 eventInit.setIsReload(webRequest.isReload()); | 107 eventInit.setIsReload(webRequest.isReload()); |
| 108 RefPtrWillBeRawPtr<FetchEvent> fetchEvent(FetchEvent::create(EventTypeNames:
:fetch, eventInit, observer)); | 108 RefPtrWillBeRawPtr<FetchEvent> fetchEvent(FetchEvent::create(EventTypeNames:
:fetch, eventInit, observer)); |
| 109 defaultPrevented = !m_workerGlobalScope->dispatchEvent(fetchEvent.release())
; | 109 defaultPrevented = !m_workerGlobalScope->dispatchEvent(fetchEvent.release())
; |
| 110 observer->didDispatchEvent(defaultPrevented); | 110 observer->didDispatchEvent(defaultPrevented); |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 | 245 |
| 246 ServiceWorkerGlobalScopeProxy::ServiceWorkerGlobalScopeProxy(WebEmbeddedWorkerIm
pl& embeddedWorker, Document& document, WebServiceWorkerContextClient& client) | 246 ServiceWorkerGlobalScopeProxy::ServiceWorkerGlobalScopeProxy(WebEmbeddedWorkerIm
pl& embeddedWorker, Document& document, WebServiceWorkerContextClient& client) |
| 247 : m_embeddedWorker(embeddedWorker) | 247 : m_embeddedWorker(embeddedWorker) |
| 248 , m_document(document) | 248 , m_document(document) |
| 249 , m_client(client) | 249 , m_client(client) |
| 250 , m_workerGlobalScope(0) | 250 , m_workerGlobalScope(0) |
| 251 { | 251 { |
| 252 } | 252 } |
| 253 | 253 |
| 254 } // namespace blink | 254 } // namespace blink |
| OLD | NEW |