| 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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 } | 157 } |
| 158 | 158 |
| 159 void ServiceWorkerGlobalScopeProxy::dispatchFetchEvent( | 159 void ServiceWorkerGlobalScopeProxy::dispatchFetchEvent( |
| 160 int fetchEventID, | 160 int fetchEventID, |
| 161 const WebServiceWorkerRequest& webRequest, | 161 const WebServiceWorkerRequest& webRequest, |
| 162 bool navigationPreloadSent) { | 162 bool navigationPreloadSent) { |
| 163 ScriptState::Scope scope( | 163 ScriptState::Scope scope( |
| 164 workerGlobalScope()->scriptController()->getScriptState()); | 164 workerGlobalScope()->scriptController()->getScriptState()); |
| 165 WaitUntilObserver* waitUntilObserver = WaitUntilObserver::create( | 165 WaitUntilObserver* waitUntilObserver = WaitUntilObserver::create( |
| 166 workerGlobalScope(), WaitUntilObserver::Fetch, fetchEventID); | 166 workerGlobalScope(), WaitUntilObserver::Fetch, fetchEventID); |
| 167 RespondWithObserver* respondWithObserver = RespondWithObserver::create( | 167 FetchRespondWithObserver* respondWithObserver = |
| 168 workerGlobalScope(), fetchEventID, webRequest.url(), webRequest.mode(), | 168 FetchRespondWithObserver::create( |
| 169 webRequest.redirectMode(), webRequest.frameType(), | 169 workerGlobalScope(), fetchEventID, webRequest.url(), |
| 170 webRequest.requestContext(), waitUntilObserver); | 170 webRequest.mode(), webRequest.redirectMode(), webRequest.frameType(), |
| 171 webRequest.requestContext(), waitUntilObserver); |
| 171 Request* request = Request::create( | 172 Request* request = Request::create( |
| 172 workerGlobalScope()->scriptController()->getScriptState(), webRequest); | 173 workerGlobalScope()->scriptController()->getScriptState(), webRequest); |
| 173 request->getHeaders()->setGuard(Headers::ImmutableGuard); | 174 request->getHeaders()->setGuard(Headers::ImmutableGuard); |
| 174 FetchEventInit eventInit; | 175 FetchEventInit eventInit; |
| 175 eventInit.setCancelable(true); | 176 eventInit.setCancelable(true); |
| 176 eventInit.setRequest(request); | 177 eventInit.setRequest(request); |
| 177 eventInit.setClientId( | 178 eventInit.setClientId( |
| 178 webRequest.isMainResourceLoad() ? WebString() : webRequest.clientId()); | 179 webRequest.isMainResourceLoad() ? WebString() : webRequest.clientId()); |
| 179 eventInit.setIsReload(webRequest.isReload()); | 180 eventInit.setIsReload(webRequest.isReload()); |
| 180 ScriptState* scriptState = | 181 ScriptState* scriptState = |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 483 return *m_document; | 484 return *m_document; |
| 484 } | 485 } |
| 485 | 486 |
| 486 ServiceWorkerGlobalScope* ServiceWorkerGlobalScopeProxy::workerGlobalScope() | 487 ServiceWorkerGlobalScope* ServiceWorkerGlobalScopeProxy::workerGlobalScope() |
| 487 const { | 488 const { |
| 488 DCHECK(m_workerGlobalScope); | 489 DCHECK(m_workerGlobalScope); |
| 489 return m_workerGlobalScope; | 490 return m_workerGlobalScope; |
| 490 } | 491 } |
| 491 | 492 |
| 492 } // namespace blink | 493 } // namespace blink |
| OLD | NEW |