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

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

Issue 2376403004: Store Origin-Trial tokens to ServiceWorkerDataBase (Closed)
Patch Set: add comment in ServiceWorkerGlobalScopeProxy::dispatchForeignFetchEvent Created 4 years, 2 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
« no previous file with comments | « content/common/origin_trials/trial_token_validator.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 // promise rejection or an uncaught runtime script error. 181 // promise rejection or an uncaught runtime script error.
182 waitUntilObserver->didDispatchEvent(false /* errorOccurred */); 182 waitUntilObserver->didDispatchEvent(false /* errorOccurred */);
183 } 183 }
184 184
185 void ServiceWorkerGlobalScopeProxy::dispatchForeignFetchEvent( 185 void ServiceWorkerGlobalScopeProxy::dispatchForeignFetchEvent(
186 int responseID, 186 int responseID,
187 int eventFinishID, 187 int eventFinishID,
188 const WebServiceWorkerRequest& webRequest) { 188 const WebServiceWorkerRequest& webRequest) {
189 if (!OriginTrials::foreignFetchEnabled(workerGlobalScope())) { 189 if (!OriginTrials::foreignFetchEnabled(workerGlobalScope())) {
190 // If origin trial tokens have expired, or are otherwise no longer valid 190 // If origin trial tokens have expired, or are otherwise no longer valid
191 // no events should be dispatched. 191 // no events should be dispatched. We can check it in the browser process if
192 // TODO(mek): Ideally the browser wouldn't even start the service worker 192 // the service worker is installed after M56. But if the service worker is
193 // if its tokens have expired. 193 // installed in old version of Chrome (<M55) we have to check it in the
falken 2016/10/07 05:38:33 "is installed" -> "was installed" (two places)
horo 2016/10/07 08:29:42 Done.
194 // renderer process.
falken 2016/10/07 05:38:33 maybe add "renderer process (here)" for clarity
194 ServiceWorkerGlobalScopeClient::from(workerGlobalScope()) 195 ServiceWorkerGlobalScopeClient::from(workerGlobalScope())
195 ->respondToFetchEvent(responseID, WTF::currentTime()); 196 ->respondToFetchEvent(responseID, WTF::currentTime());
196 ServiceWorkerGlobalScopeClient::from(workerGlobalScope()) 197 ServiceWorkerGlobalScopeClient::from(workerGlobalScope())
197 ->didHandleFetchEvent(eventFinishID, 198 ->didHandleFetchEvent(eventFinishID,
198 WebServiceWorkerEventResultCompleted, 199 WebServiceWorkerEventResultCompleted,
199 WTF::currentTime()); 200 WTF::currentTime());
200 return; 201 return;
201 } 202 }
202 203
203 ScriptState::Scope scope( 204 ScriptState::Scope scope(
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 return *m_document; 408 return *m_document;
408 } 409 }
409 410
410 ServiceWorkerGlobalScope* ServiceWorkerGlobalScopeProxy::workerGlobalScope() 411 ServiceWorkerGlobalScope* ServiceWorkerGlobalScopeProxy::workerGlobalScope()
411 const { 412 const {
412 DCHECK(m_workerGlobalScope); 413 DCHECK(m_workerGlobalScope);
413 return m_workerGlobalScope; 414 return m_workerGlobalScope;
414 } 415 }
415 416
416 } // namespace blink 417 } // namespace blink
OLDNEW
« no previous file with comments | « content/common/origin_trials/trial_token_validator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698