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

Issue 2627023002: Introduce Origin-Trial for Service Worker Navigation Preload (Closed)

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

Description

Introduce Origin-Trial for Service Worker Navigation Preload. There are three possible states: - A: Navigation Preload related methods and attributes are available in JS and work correctly. - B: Navigation Preload related methods and attributes are available in JS. But NavigationPreloadManager's enable, disable and setHeaderValue methods always return a rejected promise. And FetchEvent's preloadResponse attribute returns a promise which always resolve with undefined. - C: Navigation Preload related methods and attributes are not available in JS. The state B is very weird state. But we can't avoid this, because the generated code OriginTrials.cpp always return true when the Origin Trial is enabled. https://cs.chromium.org/chromium/src/out/Debug/gen/blink/core/origin_trials/OriginTrials.cpp And according to the discussion, this is the expected behavior. https://groups.google.com/a/chromium.org/forum/#!topic/experimentation-dev/k6ZdmFp84QE * Origin Trial: Have an effective header. Command line Default Enable Disabled Default B A B Field trial Enabled A A B Disabled B A B * Origin Trial: No header. Command line Default Enable Disabled Default C A C Field trial Enabled C A C Disabled C A C There is no way to test the field trial Enabled/Disabled cases in LayoutTest. So the LayoutTests in this CL test the following combinations. (Field trial=Default) * (Command line=Default/Enable/Disabled) * (OriginTrial=On/Off) BUG=649558 Review-Url: https://codereview.chromium.org/2627023002 Cr-Commit-Position: refs/heads/master@{#443742} Committed: https://chromium.googlesource.com/chromium/src/+/519589379f0aa766e7fe2357515b0f506f001d12

Patch Set 1 #

Patch Set 2 : add LayoutTests #

Total comments: 21

Patch Set 3 : incorporated falken's comment #

Total comments: 12

Patch Set 4 : incorporated falken's comment #

Total comments: 4

Patch Set 5 : incorpotated chasej's comment #

Total comments: 2

Patch Set 6 : s/an/a #

Unified diffs Side-by-side diffs Delta from patch set Stats (+809 lines, -11 lines) Patch
M content/browser/service_worker/service_worker_dispatcher_host.cc View 1 2 3 3 chunks +42 lines, -0 lines 0 comments Download
M content/browser/service_worker/service_worker_fetch_dispatcher.cc View 1 2 3 chunks +5 lines, -6 lines 0 comments Download
M content/browser/service_worker/service_worker_version.h View 1 2 3 2 chunks +43 lines, -0 lines 0 comments Download
M content/browser/service_worker/service_worker_version.cc View 1 2 3 3 chunks +38 lines, -0 lines 0 comments Download
M content/child/runtime_features.cc View 1 2 3 4 5 1 chunk +13 lines, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/VirtualTestSuites View 1 1 chunk +5 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/http/tests/serviceworker/chromium/navigation-preload-origin-trial-interfaces.html View 1 2 1 chunk +71 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/http/tests/serviceworker/chromium/navigation-preload-origin-trial-interfaces-expected.txt View 1 2 1 chunk +81 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/http/tests/serviceworker/chromium/navigation-preload-origin-trial-methods.html View 1 2 1 chunk +79 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/http/tests/serviceworker/chromium/navigation-preload-origin-trial-methods-expected.txt View 1 2 3 1 chunk +30 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/http/tests/serviceworker/chromium/resources/get-interface-names.js View 1 2 1 chunk +37 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/http/tests/serviceworker/chromium/resources/navigation-preload-origin-trial-interfaces-worker.php View 1 2 1 chunk +17 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/http/tests/serviceworker/chromium/resources/navigation-preload-origin-trial-methods-scope.php View 1 1 chunk +8 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/http/tests/serviceworker/chromium/resources/navigation-preload-origin-trial-methods-worker.php View 1 2 1 chunk +64 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/virtual/service-worker-navigation-preload-disabled/http/tests/serviceworker/chromium/README.txt View 1 1 chunk +1 line, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/virtual/service-worker-navigation-preload-disabled/http/tests/serviceworker/chromium/navigation-preload-origin-trial-interfaces-expected.txt View 1 2 1 chunk +81 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/virtual/service-worker-navigation-preload-disabled/http/tests/serviceworker/chromium/navigation-preload-origin-trial-methods-expected.txt View 1 2 3 1 chunk +30 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/virtual/service-worker-navigation-preload/http/tests/serviceworker/chromium/navigation-preload-origin-trial-interfaces-expected.txt View 1 2 1 chunk +89 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/virtual/service-worker-navigation-preload/http/tests/serviceworker/chromium/navigation-preload-origin-trial-methods-expected.txt View 1 1 chunk +35 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/modules/v8/ConditionalFeaturesForModules.cpp View 1 2 3 4 2 chunks +36 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/serviceworkers/FetchEvent.idl View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/modules/serviceworkers/NavigationPreloadManager.idl View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerRegistration.idl View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in View 1 3 4 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 62 (45 generated)
horo
falken@ Could you please review?
3 years, 11 months ago (2017-01-12 15:32:33 UTC) #27
falken
Is there any way to test the field trial Disabled case in a browser or ...
3 years, 11 months ago (2017-01-13 03:43:42 UTC) #30
horo
I tried to create a test using ScopedFeatureList::InitAndEnableFeature(). But the behavior of this method is ...
3 years, 11 months ago (2017-01-13 08:41:33 UTC) #31
falken
lgtm. This is really thorough work. https://codereview.chromium.org/2627023002/diff/160001/content/browser/service_worker/service_worker_dispatcher_host.cc File content/browser/service_worker/service_worker_dispatcher_host.cc (right): https://codereview.chromium.org/2627023002/diff/160001/content/browser/service_worker/service_worker_dispatcher_host.cc#newcode92 content/browser/service_worker/service_worker_dispatcher_host.cc:92: return "Navigation Preload ...
3 years, 11 months ago (2017-01-13 09:13:21 UTC) #34
haraken
owner LGTM
3 years, 11 months ago (2017-01-13 09:19:19 UTC) #35
horo
Thank you! https://codereview.chromium.org/2627023002/diff/160001/content/browser/service_worker/service_worker_dispatcher_host.cc File content/browser/service_worker/service_worker_dispatcher_host.cc (right): https://codereview.chromium.org/2627023002/diff/160001/content/browser/service_worker/service_worker_dispatcher_host.cc#newcode92 content/browser/service_worker/service_worker_dispatcher_host.cc:92: return "Navigation Preload field trial is stopped."; ...
3 years, 11 months ago (2017-01-13 09:27:57 UTC) #36
horo
clamy@ Could you please review content/child/runtime_features.cc?
3 years, 11 months ago (2017-01-13 09:32:23 UTC) #39
chasej
Drive-by code review. A few nits below. https://codereview.chromium.org/2627023002/diff/180001/third_party/WebKit/Source/bindings/modules/v8/ConditionalFeaturesForModules.cpp File third_party/WebKit/Source/bindings/modules/v8/ConditionalFeaturesForModules.cpp (right): https://codereview.chromium.org/2627023002/diff/180001/third_party/WebKit/Source/bindings/modules/v8/ConditionalFeaturesForModules.cpp#newcode111 third_party/WebKit/Source/bindings/modules/v8/ConditionalFeaturesForModules.cpp:111: v8::Local<v8::Object> instanceObject ...
3 years, 11 months ago (2017-01-13 16:28:32 UTC) #44
horo
Thank you! https://codereview.chromium.org/2627023002/diff/180001/third_party/WebKit/Source/bindings/modules/v8/ConditionalFeaturesForModules.cpp File third_party/WebKit/Source/bindings/modules/v8/ConditionalFeaturesForModules.cpp (right): https://codereview.chromium.org/2627023002/diff/180001/third_party/WebKit/Source/bindings/modules/v8/ConditionalFeaturesForModules.cpp#newcode111 third_party/WebKit/Source/bindings/modules/v8/ConditionalFeaturesForModules.cpp:111: v8::Local<v8::Object> instanceObject = scriptState->context()->Global(); On 2017/01/13 16:28:32, ...
3 years, 11 months ago (2017-01-13 16:45:22 UTC) #47
clamy
Thanks! content/child lgtm. https://codereview.chromium.org/2627023002/diff/200001/content/child/runtime_features.cc File content/child/runtime_features.cc (right): https://codereview.chromium.org/2627023002/diff/200001/content/child/runtime_features.cc#newcode322 content/child/runtime_features.cc:322: // this feature should be available ...
3 years, 11 months ago (2017-01-13 17:44:10 UTC) #48
horo
Thank you. https://codereview.chromium.org/2627023002/diff/200001/content/child/runtime_features.cc File content/child/runtime_features.cc (right): https://codereview.chromium.org/2627023002/diff/200001/content/child/runtime_features.cc#newcode322 content/child/runtime_features.cc:322: // this feature should be available only ...
3 years, 11 months ago (2017-01-13 23:01:24 UTC) #51
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/2627023002/220001
3 years, 11 months ago (2017-01-13 23:02:25 UTC) #54
commit-bot: I haz the power
Committed patchset #6 (id:220001) as https://chromium.googlesource.com/chromium/src/+/519589379f0aa766e7fe2357515b0f506f001d12
3 years, 11 months ago (2017-01-14 00:35:08 UTC) #57
sof
Looks like some of the tests added here are flakily crashing on the Windows (dbg) ...
3 years, 11 months ago (2017-01-16 18:18:45 UTC) #59
horo
On 2017/01/16 18:18:45, sof wrote: > Looks like some of the tests added here are ...
3 years, 11 months ago (2017-01-17 01:59:16 UTC) #60
sof
On 2017/01/17 01:59:16, horo wrote: > On 2017/01/16 18:18:45, sof wrote: > > Looks like ...
3 years, 11 months ago (2017-01-17 07:49:10 UTC) #61
pkalinnikov
3 years, 11 months ago (2017-01-17 15:06:05 UTC) #62
Message was sent while issue was closed.
A revert of this CL (patchset #6 id:220001) has been created in
https://codereview.chromium.org/2634373002/ by pkalinnikov@chromium.org.

The reason for reverting is:
virtual/service-worker-navigation-preload-disabled/http/tests/serviceworker/chromium/resolve-after-window-close.html
(and 1 more introduced test) is consistently failing on "WebKit Linux Trusty
Leak" builder..

Powered by Google App Engine
This is Rietveld 408576698