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

Issue 2376403004: Store Origin-Trial tokens to ServiceWorkerDataBase (Closed)

Created:
4 years, 2 months ago by horo
Modified:
4 years, 2 months ago
Reviewers:
falken, keishi, chasej, iclelland
CC:
chromium-reviews, michaeln, jsbell+serviceworker_chromium.org, shimazu+serviceworker_chromium.org, serviceworker-reviews, jam, chasej+watch_chromium.org, nhiroki, kinuko+serviceworker, horo+watch_chromium.org, darin-cc_chromium.org, kinuko+watch, tzik, blink-worker-reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Store Origin-Trial tokens to ServiceWorkerDataBase Currently the Origin-Trial tokens for ServiceWorkers are stored in the HTTP header in ServiceWorkerStorage. These are loaded when the ServiceWorker is started. We are thinking about using Origin-Trial for Navigation Preload feature. If we will do so, we have to check the token before starting the ServiceWorker. So we need to store the token in the ServiceWorkerDataBase. And also if we have the tokens in ServiceWorkerDataBase, we can check the tokens and stop starting ServiceWorkers for ForeignFetch when the tokens have expired. See comments in ServiceWorkerGlobalScopeProxy::dispatchForeignFetchEvent(). BUG=649558 Committed: https://crrev.com/2b805ae42103749c9d92785b10528bde83a4bd4b Cr-Commit-Position: refs/heads/master@{#424677}

Patch Set 1 #

Patch Set 2 : Add tests #

Total comments: 2

Patch Set 3 : incorporated chasej's comment #

Total comments: 13

Patch Set 4 : incorporated falken's comment #

Patch Set 5 : add comment in ServiceWorkerGlobalScopeProxy::dispatchForeignFetchEvent #

Total comments: 3

Patch Set 6 : fix comment #

Total comments: 4

Patch Set 7 : incorporated iclelland's comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+368 lines, -3 lines) Patch
M content/browser/service_worker/service_worker_database.h View 1 2 chunks +3 lines, -0 lines 0 comments Download
M content/browser/service_worker/service_worker_database.cc View 1 2 3 4 5 6 2 chunks +19 lines, -0 lines 0 comments Download
M content/browser/service_worker/service_worker_database.proto View 1 2 3 2 chunks +15 lines, -0 lines 0 comments Download
M content/browser/service_worker/service_worker_storage.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/service_worker/service_worker_storage.cc View 1 2 2 chunks +4 lines, -0 lines 0 comments Download
M content/browser/service_worker/service_worker_storage_unittest.cc View 1 2 3 3 chunks +220 lines, -0 lines 0 comments Download
M content/browser/service_worker/service_worker_url_request_job_unittest.cc View 1 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/service_worker/service_worker_version.h View 1 2 3 3 chunks +16 lines, -0 lines 0 comments Download
M content/browser/service_worker/service_worker_version.cc View 1 2 3 3 chunks +19 lines, -0 lines 0 comments Download
M content/common/origin_trials/trial_token_validator.h View 1 2 3 4 5 6 3 chunks +17 lines, -0 lines 0 comments Download
M content/common/origin_trials/trial_token_validator.cc View 1 2 2 chunks +49 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp View 1 2 3 4 5 1 chunk +4 lines, -3 lines 0 comments Download

Messages

Total messages: 73 (54 generated)
horo
falken@ Could you please review?
4 years, 2 months ago (2016-10-05 12:01:10 UTC) #29
chasej
Drive-by code review (from watch on origin trials). https://codereview.chromium.org/2376403004/diff/120001/content/browser/service_worker/service_worker_version.cc File content/browser/service_worker/service_worker_version.cc (right): https://codereview.chromium.org/2376403004/diff/120001/content/browser/service_worker/service_worker_version.cc#newcode712 content/browser/service_worker/service_worker_version.cc:712: if ...
4 years, 2 months ago (2016-10-05 23:39:55 UTC) #33
horo
Thank you. https://codereview.chromium.org/2376403004/diff/120001/content/browser/service_worker/service_worker_version.cc File content/browser/service_worker/service_worker_version.cc (right): https://codereview.chromium.org/2376403004/diff/120001/content/browser/service_worker/service_worker_version.cc#newcode712 content/browser/service_worker/service_worker_version.cc:712: if (TrialTokenValidator::ValidateToken(token, url::Origin(scope()), On 2016/10/05 23:39:54, chasej ...
4 years, 2 months ago (2016-10-06 06:59:25 UTC) #39
chasej
On 2016/10/06 06:59:25, horo wrote: > Thank you. > > https://codereview.chromium.org/2376403004/diff/120001/content/browser/service_worker/service_worker_version.cc > File content/browser/service_worker/service_worker_version.cc (right): ...
4 years, 2 months ago (2016-10-06 14:12:51 UTC) #42
falken
This looks good. If I understand correctly, now we parse origin trial headers both on ...
4 years, 2 months ago (2016-10-07 03:35:23 UTC) #43
nhiroki
DBC https://codereview.chromium.org/2376403004/diff/160001/content/browser/service_worker/service_worker_database.proto File content/browser/service_worker/service_worker_database.proto (right): https://codereview.chromium.org/2376403004/diff/160001/content/browser/service_worker/service_worker_database.proto#newcode45 content/browser/service_worker/service_worker_database.proto:45: optional ServiceWorkerOriginTrialInfo origin_trial_tokens = 11; Doesn't this work? ...
4 years, 2 months ago (2016-10-07 04:40:34 UTC) #45
horo
> This looks good. If I understand correctly, now we parse origin trial headers > ...
4 years, 2 months ago (2016-10-07 05:33:32 UTC) #48
falken
lgtm https://codereview.chromium.org/2376403004/diff/200001/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp File third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp (right): https://codereview.chromium.org/2376403004/diff/200001/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp#newcode193 third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp:193: // installed in old version of Chrome (<M55) ...
4 years, 2 months ago (2016-10-07 05:38:33 UTC) #49
nhiroki
https://codereview.chromium.org/2376403004/diff/160001/content/browser/service_worker/service_worker_database.proto File content/browser/service_worker/service_worker_database.proto (right): https://codereview.chromium.org/2376403004/diff/160001/content/browser/service_worker/service_worker_database.proto#newcode45 content/browser/service_worker/service_worker_database.proto:45: optional ServiceWorkerOriginTrialInfo origin_trial_tokens = 11; On 2016/10/07 05:33:32, horo ...
4 years, 2 months ago (2016-10-07 05:59:04 UTC) #50
horo
https://codereview.chromium.org/2376403004/diff/200001/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp File third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp (right): https://codereview.chromium.org/2376403004/diff/200001/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp#newcode193 third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp:193: // installed in old version of Chrome (<M55) we ...
4 years, 2 months ago (2016-10-07 08:29:42 UTC) #57
horo
iclelland@ Could you please review content/common/origin_trials/trial_token_validator.*?
4 years, 2 months ago (2016-10-07 08:29:51 UTC) #58
horo
keishi@ Please review third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp.
4 years, 2 months ago (2016-10-07 08:30:28 UTC) #60
keishi
LGTM
4 years, 2 months ago (2016-10-07 12:42:37 UTC) #63
horo
iclelland@ Ping? :)
4 years, 2 months ago (2016-10-12 00:27:32 UTC) #64
iclelland
origin_trials LGTM; sorry for the wait https://codereview.chromium.org/2376403004/diff/220001/content/browser/service_worker/service_worker_database.cc File content/browser/service_worker/service_worker_database.cc (right): https://codereview.chromium.org/2376403004/diff/220001/content/browser/service_worker/service_worker_database.cc#newcode1227 content/browser/service_worker/service_worker_database.cc:1227: const auto& info ...
4 years, 2 months ago (2016-10-12 03:31:39 UTC) #65
horo
Thank you! https://codereview.chromium.org/2376403004/diff/220001/content/browser/service_worker/service_worker_database.cc File content/browser/service_worker/service_worker_database.cc (right): https://codereview.chromium.org/2376403004/diff/220001/content/browser/service_worker/service_worker_database.cc#newcode1227 content/browser/service_worker/service_worker_database.cc:1227: const auto& info = data.origin_trial_tokens(); On 2016/10/12 ...
4 years, 2 months ago (2016-10-12 04:13:15 UTC) #66
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2376403004/240001
4 years, 2 months ago (2016-10-12 04:13:40 UTC) #69
commit-bot: I haz the power
Committed patchset #7 (id:240001)
4 years, 2 months ago (2016-10-12 05:33:29 UTC) #71
commit-bot: I haz the power
4 years, 2 months ago (2016-10-12 05:35:19 UTC) #73
Message was sent while issue was closed.
Patchset 7 (id:??) landed as
https://crrev.com/2b805ae42103749c9d92785b10528bde83a4bd4b
Cr-Commit-Position: refs/heads/master@{#424677}

Powered by Google App Engine
This is Rietveld 408576698