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