| 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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 webRequest.isMainResourceLoad() ? WebString() : webRequest.clientId()); | 178 webRequest.isMainResourceLoad() ? WebString() : webRequest.clientId()); |
| 179 eventInit.setIsReload(webRequest.isReload()); | 179 eventInit.setIsReload(webRequest.isReload()); |
| 180 ScriptState* scriptState = | 180 ScriptState* scriptState = |
| 181 workerGlobalScope()->scriptController()->getScriptState(); | 181 workerGlobalScope()->scriptController()->getScriptState(); |
| 182 FetchEvent* fetchEvent = FetchEvent::create( | 182 FetchEvent* fetchEvent = FetchEvent::create( |
| 183 scriptState, EventTypeNames::fetch, eventInit, respondWithObserver, | 183 scriptState, EventTypeNames::fetch, eventInit, respondWithObserver, |
| 184 waitUntilObserver, navigationPreloadSent); | 184 waitUntilObserver, navigationPreloadSent); |
| 185 if (navigationPreloadSent) { | 185 if (navigationPreloadSent) { |
| 186 // Keep |fetchEvent| until onNavigationPreloadResponse() or | 186 // Keep |fetchEvent| until onNavigationPreloadResponse() or |
| 187 // onNavigationPreloadError() will be called. | 187 // onNavigationPreloadError() will be called. |
| 188 m_pendingPreloadFetchEvents.add(fetchEventID, fetchEvent); | 188 m_pendingPreloadFetchEvents.insert(fetchEventID, fetchEvent); |
| 189 } | 189 } |
| 190 waitUntilObserver->willDispatchEvent(); | 190 waitUntilObserver->willDispatchEvent(); |
| 191 respondWithObserver->willDispatchEvent(); | 191 respondWithObserver->willDispatchEvent(); |
| 192 DispatchEventResult dispatchResult = | 192 DispatchEventResult dispatchResult = |
| 193 workerGlobalScope()->dispatchEvent(fetchEvent); | 193 workerGlobalScope()->dispatchEvent(fetchEvent); |
| 194 respondWithObserver->didDispatchEvent(dispatchResult); | 194 respondWithObserver->didDispatchEvent(dispatchResult); |
| 195 // false is okay because waitUntil for fetch event doesn't care about the | 195 // false is okay because waitUntil for fetch event doesn't care about the |
| 196 // promise rejection or an uncaught runtime script error. | 196 // promise rejection or an uncaught runtime script error. |
| 197 waitUntilObserver->didDispatchEvent(false /* errorOccurred */); | 197 waitUntilObserver->didDispatchEvent(false /* errorOccurred */); |
| 198 } | 198 } |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 483 return *m_document; | 483 return *m_document; |
| 484 } | 484 } |
| 485 | 485 |
| 486 ServiceWorkerGlobalScope* ServiceWorkerGlobalScopeProxy::workerGlobalScope() | 486 ServiceWorkerGlobalScope* ServiceWorkerGlobalScopeProxy::workerGlobalScope() |
| 487 const { | 487 const { |
| 488 DCHECK(m_workerGlobalScope); | 488 DCHECK(m_workerGlobalScope); |
| 489 return m_workerGlobalScope; | 489 return m_workerGlobalScope; |
| 490 } | 490 } |
| 491 | 491 |
| 492 } // namespace blink | 492 } // namespace blink |
| OLD | NEW |