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

Issue 885443006: ServiceWorker: Get registration info and its version attributes in one lock operation (Closed)

Created:
5 years, 11 months ago by nhiroki
Modified:
5 years, 11 months ago
Reviewers:
Kunihiko Sakamoto
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
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

ServiceWorker: Get registration info and its version attributes in one lock operation Registration info and its version attributes owned by SWProviderContext can be accessed from both the main thread and the worker thread, so they are protected by a lock operation. However, getter functions for those info and attributes are separated and returned values could be in an invalid state due to interleaved operations. This CL merges getter functions (registration() and GetVersionAttributes()) into GetRegistrationInfoAndVersionAttributes() and avoids such an unexpected state. BUG=437677 TEST=should pass all existing tests Committed: https://crrev.com/0b705112ae022e84c89e4f71b4ea6c75835e0d30 Cr-Commit-Position: refs/heads/master@{#313470}

Patch Set 1 : #

Total comments: 4

Patch Set 2 : address review comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+36 lines, -40 lines) Patch
M content/child/service_worker/service_worker_dispatcher.cc View 1 1 chunk +6 lines, -4 lines 0 comments Download
M content/child/service_worker/service_worker_provider_context.h View 1 1 chunk +3 lines, -2 lines 0 comments Download
M content/child/service_worker/service_worker_provider_context.cc View 1 1 chunk +10 lines, -14 lines 0 comments Download
M content/child/service_worker/web_service_worker_provider_impl.cc View 1 2 chunks +6 lines, -6 lines 0 comments Download
M content/renderer/service_worker/embedded_worker_context_client.cc View 1 2 chunks +11 lines, -14 lines 0 comments Download

Messages

Total messages: 13 (6 generated)
nhiroki
Hi, can you review this? Thanks! https://codereview.chromium.org/885443006/diff/40001/content/renderer/service_worker/embedded_worker_context_client.cc File content/renderer/service_worker/embedded_worker_context_client.cc (right): https://codereview.chromium.org/885443006/diff/40001/content/renderer/service_worker/embedded_worker_context_client.cc#newcode430 content/renderer/service_worker/embedded_worker_context_client.cc:430: // Register a ...
5 years, 11 months ago (2015-01-28 05:54:59 UTC) #4
Kunihiko Sakamoto
https://codereview.chromium.org/885443006/diff/40001/content/child/service_worker/web_service_worker_provider_impl.cc File content/child/service_worker/web_service_worker_provider_impl.cc (right): https://codereview.chromium.org/885443006/diff/40001/content/child/service_worker/web_service_worker_provider_impl.cc#newcode52 content/child/service_worker/web_service_worker_provider_impl.cc:52: if (!context_->IsAssociatedWithRegistration()) I wonder if this and GetRegistrationInfoAndVersionAttributes() below ...
5 years, 11 months ago (2015-01-28 06:38:55 UTC) #5
nhiroki
Thank you! Updated. https://codereview.chromium.org/885443006/diff/40001/content/child/service_worker/web_service_worker_provider_impl.cc File content/child/service_worker/web_service_worker_provider_impl.cc (right): https://codereview.chromium.org/885443006/diff/40001/content/child/service_worker/web_service_worker_provider_impl.cc#newcode52 content/child/service_worker/web_service_worker_provider_impl.cc:52: if (!context_->IsAssociatedWithRegistration()) On 2015/01/28 06:38:55, Kunihiko ...
5 years, 11 months ago (2015-01-28 07:42:27 UTC) #8
Kunihiko Sakamoto
lgtm
5 years, 11 months ago (2015-01-28 07:50:39 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/885443006/100001
5 years, 11 months ago (2015-01-28 08:06:38 UTC) #11
commit-bot: I haz the power
Committed patchset #2 (id:100001)
5 years, 11 months ago (2015-01-28 10:08:31 UTC) #12
commit-bot: I haz the power
5 years, 11 months ago (2015-01-28 10:09:31 UTC) #13
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/0b705112ae022e84c89e4f71b4ea6c75835e0d30
Cr-Commit-Position: refs/heads/master@{#313470}

Powered by Google App Engine
This is Rietveld 408576698