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

Issue 2002883002: ServiceWorker: Store the existence of fetch event handler (Closed)

Created:
4 years, 7 months ago by shimazu
Modified:
4 years, 6 months ago
Reviewers:
palmer, falken, keishi
CC:
chromium-reviews, michaeln, jsbell+serviceworker_chromium.org, mlamouri+watch-content_chromium.org, tzik, serviceworker-reviews, jam, kinuko+serviceworker, nhiroki, darin-cc_chromium.org, mkwst+moarreviews-renderer_chromium.org, horo+watch_chromium.org, kinuko+watch, blink-worker-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

ServiceWorker: Store the existence of fetch event handler Currently |has_fetch_handler| is always set to true though the ServiceWorker script has no fetch event handler. This patch passes the existence of fetch handler in the response to the install event, so the correct value will be stored. This information will be used for bypassing ServiceWorker when no fetch handler is registered. BUG=605844 TEST=./out/Default/content_unittests --gtest_filter="ServiceWorkerJobTest.HasFetchHandler" TEST=./out/Default/content_browsertests --gtest_filter="ServiceWorkerVersionBrowserTest.InstallWith*" Committed: https://crrev.com/ceec8e3a24f7ad3a2bd7a64ae7f6d82f25dfabdb Cr-Commit-Position: refs/heads/master@{#396381}

Patch Set 1 #

Total comments: 8

Patch Set 2 : Merge blink-side patch #

Patch Set 3 : Fix my mistake #

Total comments: 2

Patch Set 4 : Remove DispatchInstallEvent #

Total comments: 6

Patch Set 5 : Add tests and change the default status code to FAILED #

Total comments: 2

Patch Set 6 : Add a browser-side test and rebase #

Total comments: 6

Patch Set 7 : Use EXPECT_* and remove unnecessary checks #

Patch Set 8 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+129 lines, -26 lines) Patch
M content/browser/service_worker/embedded_worker_test_helper.cc View 1 2 3 4 5 1 chunk +3 lines, -4 lines 0 comments Download
M content/browser/service_worker/service_worker_browsertest.cc View 1 2 3 4 5 6 2 chunks +33 lines, -2 lines 0 comments Download
M content/browser/service_worker/service_worker_context_unittest.cc View 1 chunk +3 lines, -4 lines 0 comments Download
M content/browser/service_worker/service_worker_job_unittest.cc View 1 2 3 4 5 6 3 chunks +28 lines, -3 lines 0 comments Download
M content/browser/service_worker/service_worker_register_job.h View 1 2 3 1 chunk +4 lines, -1 line 0 comments Download
M content/browser/service_worker/service_worker_register_job.cc View 1 2 3 4 5 3 chunks +37 lines, -8 lines 0 comments Download
M content/browser/service_worker/service_worker_storage.cc View 2 chunks +2 lines, -1 line 0 comments Download
M content/browser/service_worker/service_worker_version.h View 1 2 3 2 chunks +5 lines, -0 lines 0 comments Download
M content/common/service_worker/service_worker_messages.h View 1 2 3 4 5 1 chunk +4 lines, -2 lines 0 comments Download
M content/renderer/service_worker/service_worker_context_client.cc View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.h View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp View 1 2 3 4 5 6 7 1 chunk +6 lines, -0 lines 0 comments Download
M third_party/WebKit/public/web/modules/serviceworker/WebServiceWorkerContextProxy.h View 1 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 38 (15 generated)
shimazu
PTAL:) == palmer@chromium.org: Please review changes in IPC falken@chromium.org: Please review changes in the others
4 years, 7 months ago (2016-05-23 07:41:51 UTC) #3
shimazu
keishi-san: Sorry for the inconvenience, please check again.
4 years, 7 months ago (2016-05-23 08:37:08 UTC) #5
falken
The choice of passing the flag in the install event response is a bit subtle, ...
4 years, 7 months ago (2016-05-23 08:41:13 UTC) #8
shimazu
https://codereview.chromium.org/2002883002/diff/1/content/browser/service_worker/embedded_worker_test_helper.cc File content/browser/service_worker/embedded_worker_test_helper.cc (left): https://codereview.chromium.org/2002883002/diff/1/content/browser/service_worker/embedded_worker_test_helper.cc#oldcode116 content/browser/service_worker/embedded_worker_test_helper.cc:116: void EmbeddedWorkerTestHelper::SimulateAddProcessToPattern( On 2016/05/23 08:41:13, falken wrote: > mistake? ...
4 years, 7 months ago (2016-05-23 10:44:24 UTC) #10
palmer
https://codereview.chromium.org/2002883002/diff/40001/content/browser/service_worker/service_worker_version.h File content/browser/service_worker/service_worker_version.h (right): https://codereview.chromium.org/2002883002/diff/40001/content/browser/service_worker/service_worker_version.h#newcode255 content/browser/service_worker/service_worker_version.h:255: // For install event, the callback should be specialized ...
4 years, 7 months ago (2016-05-23 21:31:32 UTC) #11
falken
https://codereview.chromium.org/2002883002/diff/1/content/browser/service_worker/embedded_worker_test_helper.cc File content/browser/service_worker/embedded_worker_test_helper.cc (left): https://codereview.chromium.org/2002883002/diff/1/content/browser/service_worker/embedded_worker_test_helper.cc#oldcode116 content/browser/service_worker/embedded_worker_test_helper.cc:116: void EmbeddedWorkerTestHelper::SimulateAddProcessToPattern( On 2016/05/23 10:44:24, makoto wrote: > On ...
4 years, 7 months ago (2016-05-24 01:15:34 UTC) #12
shimazu
PTAL again https://codereview.chromium.org/2002883002/diff/1/content/browser/service_worker/embedded_worker_test_helper.cc File content/browser/service_worker/embedded_worker_test_helper.cc (left): https://codereview.chromium.org/2002883002/diff/1/content/browser/service_worker/embedded_worker_test_helper.cc#oldcode116 content/browser/service_worker/embedded_worker_test_helper.cc:116: void EmbeddedWorkerTestHelper::SimulateAddProcessToPattern( On 2016/05/24 01:15:34, falken wrote: ...
4 years, 7 months ago (2016-05-24 04:17:47 UTC) #13
falken
Looking good. We'll also need tests of some sort. For this feature a browser test ...
4 years, 7 months ago (2016-05-24 06:25:48 UTC) #14
shimazu
Thank you for the reviews:) I also added the two tests. https://codereview.chromium.org/2002883002/diff/60001/content/browser/service_worker/service_worker_register_job.cc File content/browser/service_worker/service_worker_register_job.cc (right): ...
4 years, 6 months ago (2016-05-24 08:30:27 UTC) #15
keishi
web/ LGTM
4 years, 6 months ago (2016-05-24 08:38:50 UTC) #16
falken
Thanks for the test. I forgot that the browsertest would not actually exercise SWRegisterJob. So ...
4 years, 6 months ago (2016-05-25 01:19:35 UTC) #17
shimazu
PTAL again:) > Thanks for the test. I forgot that the browsertest would not actually ...
4 years, 6 months ago (2016-05-25 03:35:13 UTC) #18
falken
looks good https://codereview.chromium.org/2002883002/diff/100001/content/browser/service_worker/service_worker_browsertest.cc File content/browser/service_worker/service_worker_browsertest.cc (right): https://codereview.chromium.org/2002883002/diff/100001/content/browser/service_worker/service_worker_browsertest.cc#newcode891 content/browser/service_worker/service_worker_browsertest.cc:891: ASSERT_TRUE(version_->has_fetch_handler()); EXPECT_TRUE (see https://github.com/google/googletest/blob/master/googletest/docs/Primer.md) https://codereview.chromium.org/2002883002/diff/100001/content/browser/service_worker/service_worker_browsertest.cc#newcode897 content/browser/service_worker/service_worker_browsertest.cc:897: ASSERT_FALSE(version_->has_fetch_handler()); ...
4 years, 6 months ago (2016-05-25 04:30:17 UTC) #19
shimazu
https://codereview.chromium.org/2002883002/diff/100001/content/browser/service_worker/service_worker_browsertest.cc File content/browser/service_worker/service_worker_browsertest.cc (right): https://codereview.chromium.org/2002883002/diff/100001/content/browser/service_worker/service_worker_browsertest.cc#newcode891 content/browser/service_worker/service_worker_browsertest.cc:891: ASSERT_TRUE(version_->has_fetch_handler()); On 2016/05/25 04:30:17, falken wrote: > EXPECT_TRUE (see ...
4 years, 6 months ago (2016-05-25 07:22:39 UTC) #20
falken
Code looks good. The commit description is a bit hard to understand. It's unclear what ...
4 years, 6 months ago (2016-05-25 08:00:01 UTC) #21
shimazu
On 2016/05/25 08:00:01, falken wrote: > Code looks good. > > The commit description is ...
4 years, 6 months ago (2016-05-26 02:34:15 UTC) #23
falken
lgtm The TEST= line is optional, but you might want to make it consistent whether ...
4 years, 6 months ago (2016-05-26 03:05:25 UTC) #24
palmer
lgtm
4 years, 6 months ago (2016-05-26 20:39:23 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2002883002/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/2002883002/120001
4 years, 6 months ago (2016-05-27 01:52:58 UTC) #29
commit-bot: I haz the power
Try jobs failed on following builders: ios-device on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device/builds/12350) ios-device-gn on tryserver.chromium.mac (JOB_FAILED, ...
4 years, 6 months ago (2016-05-27 01:55:10 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2002883002/140001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/2002883002/140001
4 years, 6 months ago (2016-05-27 02:33:11 UTC) #34
commit-bot: I haz the power
Committed patchset #8 (id:140001)
4 years, 6 months ago (2016-05-27 04:34:17 UTC) #36
commit-bot: I haz the power
4 years, 6 months ago (2016-05-27 04:36:04 UTC) #38
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/ceec8e3a24f7ad3a2bd7a64ae7f6d82f25dfabdb
Cr-Commit-Position: refs/heads/master@{#396381}

Powered by Google App Engine
This is Rietveld 408576698