Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(239)

Side by Side Diff: third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp

Issue 2645493002: Increase the lifetime of Navigation Preload related objects. (Closed)
Patch Set: fix broken-chunked-encoding-worker.js Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 DCHECK(fetchEvent); 205 DCHECK(fetchEvent);
206 fetchEvent->onNavigationPreloadResponse( 206 fetchEvent->onNavigationPreloadResponse(
207 workerGlobalScope()->scriptController()->getScriptState(), 207 workerGlobalScope()->scriptController()->getScriptState(),
208 std::move(response), std::move(dataConsumeHandle)); 208 std::move(response), std::move(dataConsumeHandle));
209 } 209 }
210 210
211 void ServiceWorkerGlobalScopeProxy::onNavigationPreloadError( 211 void ServiceWorkerGlobalScopeProxy::onNavigationPreloadError(
212 int fetchEventID, 212 int fetchEventID,
213 std::unique_ptr<WebServiceWorkerError> error) { 213 std::unique_ptr<WebServiceWorkerError> error) {
214 FetchEvent* fetchEvent = m_pendingPreloadFetchEvents.take(fetchEventID); 214 FetchEvent* fetchEvent = m_pendingPreloadFetchEvents.take(fetchEventID);
215 DCHECK(fetchEvent); 215 // This method may be called after onNavigationPreloadResponse() was called.
216 if (!fetchEvent)
217 return;
216 fetchEvent->onNavigationPreloadError( 218 fetchEvent->onNavigationPreloadError(
217 workerGlobalScope()->scriptController()->getScriptState(), 219 workerGlobalScope()->scriptController()->getScriptState(),
218 std::move(error)); 220 std::move(error));
219 } 221 }
220 222
221 void ServiceWorkerGlobalScopeProxy::dispatchForeignFetchEvent( 223 void ServiceWorkerGlobalScopeProxy::dispatchForeignFetchEvent(
222 int fetchEventID, 224 int fetchEventID,
223 const WebServiceWorkerRequest& webRequest) { 225 const WebServiceWorkerRequest& webRequest) {
224 if (!OriginTrials::foreignFetchEnabled(workerGlobalScope())) { 226 if (!OriginTrials::foreignFetchEnabled(workerGlobalScope())) {
225 // If origin trial tokens have expired, or are otherwise no longer valid 227 // If origin trial tokens have expired, or are otherwise no longer valid
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 return *m_document; 488 return *m_document;
487 } 489 }
488 490
489 ServiceWorkerGlobalScope* ServiceWorkerGlobalScopeProxy::workerGlobalScope() 491 ServiceWorkerGlobalScope* ServiceWorkerGlobalScopeProxy::workerGlobalScope()
490 const { 492 const {
491 DCHECK(m_workerGlobalScope); 493 DCHECK(m_workerGlobalScope);
492 return m_workerGlobalScope; 494 return m_workerGlobalScope;
493 } 495 }
494 496
495 } // namespace blink 497 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/serviceworker/navigation-preload/resources/chunked-encoding-worker.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698