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

Issue 1135743002: Check the size of ResourceRecords in ServiceWorkerDatabase::ReadRegistration() (Closed)

Created:
5 years, 7 months ago by horo
Modified:
5 years, 7 months ago
Reviewers:
michaeln, nhiroki
CC:
chromium-reviews, jsbell+serviceworker_chromium.org, tzik, serviceworker-reviews, jam, nhiroki, darin-cc_chromium.org, horo+watch_chromium.org, kinuko+serviceworker, kinuko+watch
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Check the size of ResourceRecords in ServiceWorkerDatabase::ReadRegistration() The ResourceRecords must contain the ServiceWorker's main script. So the size of it must be bigger than 1. If the method returns STATUS_ERROR_CORRUPTED, DeleteAndStartOver() will be executed. BUG=485900, 478732 Committed: https://crrev.com/9dd8083acc8e0cce593507bc5736adb6bd5a5a66 Cr-Commit-Position: refs/heads/master@{#329801}

Patch Set 1 #

Total comments: 5

Patch Set 2 : incorporated nhiroki's comment #

Patch Set 3 : add comment #

Total comments: 2

Patch Set 4 : Added check logic in ServiceWorkerStorage and updated tests. #

Total comments: 7

Patch Set 5 : incorporated nhiroki's comment #

Patch Set 6 : DCHECK in ServiceWorkerStorage::ReturnFoundRegistration() #

Unified diffs Side-by-side diffs Delta from patch set Stats (+207 lines, -91 lines) Patch
M content/browser/service_worker/embedded_worker_test_helper.h View 1 2 3 4 2 chunks +3 lines, -0 lines 0 comments Download
M content/browser/service_worker/embedded_worker_test_helper.cc View 1 2 3 4 3 chunks +20 lines, -0 lines 0 comments Download
M content/browser/service_worker/service_worker_browsertest.cc View 1 2 3 3 chunks +5 lines, -2 lines 0 comments Download
M content/browser/service_worker/service_worker_controllee_request_handler_unittest.cc View 1 2 3 1 chunk +5 lines, -0 lines 0 comments Download
M content/browser/service_worker/service_worker_database.cc View 1 2 3 2 chunks +5 lines, -0 lines 0 comments Download
M content/browser/service_worker/service_worker_database_unittest.cc View 1 2 3 30 chunks +127 lines, -89 lines 0 comments Download
M content/browser/service_worker/service_worker_dispatcher_host_unittest.cc View 1 2 3 1 chunk +4 lines, -0 lines 0 comments Download
M content/browser/service_worker/service_worker_handle_unittest.cc View 1 2 3 1 chunk +4 lines, -0 lines 0 comments Download
M content/browser/service_worker/service_worker_storage.cc View 1 2 3 4 5 2 chunks +6 lines, -0 lines 0 comments Download
M content/browser/service_worker/service_worker_storage_unittest.cc View 1 2 3 5 chunks +20 lines, -0 lines 0 comments Download
M content/browser/service_worker/service_worker_url_request_job_unittest.cc View 1 2 3 1 chunk +4 lines, -0 lines 0 comments Download
M content/browser/service_worker/service_worker_version_unittest.cc View 1 2 3 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 28 (6 generated)
horo
nhiroki@ Could you please review this?
5 years, 7 months ago (2015-05-08 08:05:38 UTC) #2
nhiroki
https://codereview.chromium.org/1135743002/diff/1/content/browser/service_worker/service_worker_database.cc File content/browser/service_worker/service_worker_database.cc (right): https://codereview.chromium.org/1135743002/diff/1/content/browser/service_worker/service_worker_database.cc#newcode533 content/browser/service_worker/service_worker_database.cc:533: if (!resources->size()) empty()? https://codereview.chromium.org/1135743002/diff/1/content/browser/service_worker/service_worker_database.cc#newcode579 content/browser/service_worker/service_worker_database.cc:579: DCHECK(sequence_checker_.CalledOnValidSequencedThread()); How about adding ...
5 years, 7 months ago (2015-05-08 08:14:42 UTC) #3
nhiroki
Sorry, one more comment https://codereview.chromium.org/1135743002/diff/1/content/browser/service_worker/service_worker_database.cc File content/browser/service_worker/service_worker_database.cc (right): https://codereview.chromium.org/1135743002/diff/1/content/browser/service_worker/service_worker_database.cc#newcode533 content/browser/service_worker/service_worker_database.cc:533: if (!resources->size()) On 2015/05/08 08:14:42, ...
5 years, 7 months ago (2015-05-08 08:19:00 UTC) #4
horo
https://codereview.chromium.org/1135743002/diff/1/content/browser/service_worker/service_worker_database.cc File content/browser/service_worker/service_worker_database.cc (right): https://codereview.chromium.org/1135743002/diff/1/content/browser/service_worker/service_worker_database.cc#newcode533 content/browser/service_worker/service_worker_database.cc:533: if (!resources->size()) On 2015/05/08 08:19:00, nhiroki wrote: > On ...
5 years, 7 months ago (2015-05-08 08:22:31 UTC) #5
nhiroki
lgtm
5 years, 7 months ago (2015-05-08 08:24:34 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1135743002/40001
5 years, 7 months ago (2015-05-08 08:33:20 UTC) #8
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_chromeos_ozone_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_ozone_rel_ng/builds/15731)
5 years, 7 months ago (2015-05-08 09:12:31 UTC) #10
michaeln
https://codereview.chromium.org/1135743002/diff/40001/content/browser/service_worker/service_worker_database.cc File content/browser/service_worker/service_worker_database.cc (right): https://codereview.chromium.org/1135743002/diff/40001/content/browser/service_worker/service_worker_database.cc#newcode582 content/browser/service_worker/service_worker_database.cc:582: DCHECK(!resources.empty()); Should an attempt to write a reg with ...
5 years, 7 months ago (2015-05-08 20:41:08 UTC) #12
horo
https://codereview.chromium.org/1135743002/diff/40001/content/browser/service_worker/service_worker_database.cc File content/browser/service_worker/service_worker_database.cc (right): https://codereview.chromium.org/1135743002/diff/40001/content/browser/service_worker/service_worker_database.cc#newcode582 content/browser/service_worker/service_worker_database.cc:582: DCHECK(!resources.empty()); On 2015/05/08 20:41:08, michaeln wrote: > Should an ...
5 years, 7 months ago (2015-05-11 03:10:20 UTC) #13
horo
I added check logic in ServiceWorkerStorage and updated tests. nhiroki@ Could you please review this ...
5 years, 7 months ago (2015-05-11 05:01:44 UTC) #14
nhiroki
Lgtm with nits. Please wait for michaeln@'s comments. https://codereview.chromium.org/1135743002/diff/60001/content/browser/service_worker/embedded_worker_test_helper.cc File content/browser/service_worker/embedded_worker_test_helper.cc (right): https://codereview.chromium.org/1135743002/diff/60001/content/browser/service_worker/embedded_worker_test_helper.cc#newcode199 content/browser/service_worker/embedded_worker_test_helper.cc:199: // ...
5 years, 7 months ago (2015-05-11 05:46:04 UTC) #15
horo
https://codereview.chromium.org/1135743002/diff/60001/content/browser/service_worker/embedded_worker_test_helper.cc File content/browser/service_worker/embedded_worker_test_helper.cc (right): https://codereview.chromium.org/1135743002/diff/60001/content/browser/service_worker/embedded_worker_test_helper.cc#newcode199 content/browser/service_worker/embedded_worker_test_helper.cc:199: // avoid ID corraption. On 2015/05/11 05:46:04, nhiroki wrote: ...
5 years, 7 months ago (2015-05-11 07:41:30 UTC) #16
michaeln
On 2015/05/11 03:10:20, horo wrote: > https://codereview.chromium.org/1135743002/diff/40001/content/browser/service_worker/service_worker_database.cc > File content/browser/service_worker/service_worker_database.cc (right): > > https://codereview.chromium.org/1135743002/diff/40001/content/browser/service_worker/service_worker_database.cc#newcode582 > ...
5 years, 7 months ago (2015-05-11 19:05:10 UTC) #17
michaeln
> > When WriteRegistration() is called, the registration must have at least one > > ...
5 years, 7 months ago (2015-05-11 19:22:24 UTC) #18
horo
On 2015/05/11 19:22:24, michaeln wrote: > > > When WriteRegistration() is called, the registration must ...
5 years, 7 months ago (2015-05-12 00:47:35 UTC) #19
michaeln
I just wanted to point out the the problem could be on the input rather ...
5 years, 7 months ago (2015-05-12 01:25:18 UTC) #20
horo
On 2015/05/12 01:25:18, michaeln wrote: > I just wanted to point out the the problem ...
5 years, 7 months ago (2015-05-12 02:43:59 UTC) #21
michaeln
lgtm (but see question below) https://codereview.chromium.org/1135743002/diff/60001/content/browser/service_worker/service_worker_storage.cc File content/browser/service_worker/service_worker_storage.cc (right): https://codereview.chromium.org/1135743002/diff/60001/content/browser/service_worker/service_worker_storage.cc#newcode542 content/browser/service_worker/service_worker_storage.cc:542: if (resources.empty()) { thnx! ...
5 years, 7 months ago (2015-05-14 03:27:59 UTC) #22
horo
Thank you!! https://codereview.chromium.org/1135743002/diff/60001/content/browser/service_worker/service_worker_storage.cc File content/browser/service_worker/service_worker_storage.cc (right): https://codereview.chromium.org/1135743002/diff/60001/content/browser/service_worker/service_worker_storage.cc#newcode1102 content/browser/service_worker/service_worker_storage.cc:1102: if (resources.empty()) { On 2015/05/14 03:27:59, michaeln ...
5 years, 7 months ago (2015-05-14 03:46:50 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1135743002/100001
5 years, 7 months ago (2015-05-14 04:02:38 UTC) #26
commit-bot: I haz the power
Committed patchset #6 (id:100001)
5 years, 7 months ago (2015-05-14 04:43:23 UTC) #27
commit-bot: I haz the power
5 years, 7 months ago (2015-05-14 04:44:25 UTC) #28
Message was sent while issue was closed.
Patchset 6 (id:??) landed as
https://crrev.com/9dd8083acc8e0cce593507bc5736adb6bd5a5a66
Cr-Commit-Position: refs/heads/master@{#329801}

Powered by Google App Engine
This is Rietveld 408576698