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

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

Issue 2715663002: ServiceWorker: Factor out FetchEvent related logics from RespondWithObserver. (Closed)
Patch Set: RespondWithObserver Created 3 years, 9 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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 RespondWithObserver* respondWithObserver = FetchRespondWithObserver::create(
nhiroki 2017/03/08 01:49:04 Can you replace RespondWithObserver* with FetchRes
zino 2017/03/10 17:57:17 Done.
168 workerGlobalScope(), fetchEventID, webRequest.url(), webRequest.mode(), 168 workerGlobalScope(), fetchEventID, webRequest.url(), webRequest.mode(),
169 webRequest.redirectMode(), webRequest.frameType(), 169 webRequest.redirectMode(), webRequest.frameType(),
170 webRequest.requestContext(), waitUntilObserver); 170 webRequest.requestContext(), waitUntilObserver);
171 Request* request = Request::create( 171 Request* request = Request::create(
172 workerGlobalScope()->scriptController()->getScriptState(), webRequest); 172 workerGlobalScope()->scriptController()->getScriptState(), webRequest);
173 request->getHeaders()->setGuard(Headers::ImmutableGuard); 173 request->getHeaders()->setGuard(Headers::ImmutableGuard);
174 FetchEventInit eventInit; 174 FetchEventInit eventInit;
175 eventInit.setCancelable(true); 175 eventInit.setCancelable(true);
176 eventInit.setRequest(request); 176 eventInit.setRequest(request);
177 eventInit.setClientId( 177 eventInit.setClientId(
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698