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

Issue 2115393002: service worker: Refactor OnNoControllees (Closed)

Created:
4 years, 5 months ago by falken
Modified:
4 years, 5 months ago
Reviewers:
nhiroki
CC:
chromium-reviews, michaeln, jsbell+serviceworker_chromium.org, tzik, serviceworker-reviews, jam, kinuko+serviceworker, nhiroki, darin-cc_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

service worker: Refactor OnNoControllees OnNoControllees doesn't need to unset the flags. * If |is_uninstalling_| is set, the call to Clear() would unset it. * If |should_activate_when_ready_| is set, the call to ActivateWaitingVersion() would unset it. We also change Clear() to unset |should_activate_when_ready_| which makes sense for any callsite of Clear(). Minor simplification in anticipation of changes for https://crbug.com/616331 Refactoring only; no behavior change. BUG=616331 Committed: https://crrev.com/6c74874b9c6969a2afc6f195c96a1a3b15cda890 Cr-Commit-Position: refs/heads/master@{#403650}

Patch Set 1 #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+1 line, -2 lines) Patch
M content/browser/service_worker/service_worker_registration.cc View 2 chunks +1 line, -2 lines 3 comments Download

Messages

Total messages: 12 (3 generated)
falken
nhiroki: Can you review this tiny patch?
4 years, 5 months ago (2016-07-04 07:33:54 UTC) #2
nhiroki
lgtm https://codereview.chromium.org/2115393002/diff/1/content/browser/service_worker/service_worker_registration.cc File content/browser/service_worker/service_worker_registration.cc (right): https://codereview.chromium.org/2115393002/diff/1/content/browser/service_worker/service_worker_registration.cc#newcode430 content/browser/service_worker/service_worker_registration.cc:430: void ServiceWorkerRegistration::Clear() { How about checking pre-conditions before ...
4 years, 5 months ago (2016-07-04 07:53:38 UTC) #3
falken
https://codereview.chromium.org/2115393002/diff/1/content/browser/service_worker/service_worker_registration.cc File content/browser/service_worker/service_worker_registration.cc (right): https://codereview.chromium.org/2115393002/diff/1/content/browser/service_worker/service_worker_registration.cc#newcode430 content/browser/service_worker/service_worker_registration.cc:430: void ServiceWorkerRegistration::Clear() { On 2016/07/04 07:53:38, nhiroki wrote: > ...
4 years, 5 months ago (2016-07-04 08:14:37 UTC) #4
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/2115393002/1
4 years, 5 months ago (2016-07-04 08:15:18 UTC) #6
nhiroki
https://codereview.chromium.org/2115393002/diff/1/content/browser/service_worker/service_worker_registration.cc File content/browser/service_worker/service_worker_registration.cc (right): https://codereview.chromium.org/2115393002/diff/1/content/browser/service_worker/service_worker_registration.cc#newcode430 content/browser/service_worker/service_worker_registration.cc:430: void ServiceWorkerRegistration::Clear() { On 2016/07/04 08:14:37, falken wrote: > ...
4 years, 5 months ago (2016-07-04 08:39:05 UTC) #7
commit-bot: I haz the power
Committed patchset #1 (id:1)
4 years, 5 months ago (2016-07-04 08:48:54 UTC) #8
commit-bot: I haz the power
CQ bit was unchecked.
4 years, 5 months ago (2016-07-04 08:49:01 UTC) #9
commit-bot: I haz the power
Patchset 1 (id:??) landed as https://crrev.com/6c74874b9c6969a2afc6f195c96a1a3b15cda890 Cr-Commit-Position: refs/heads/master@{#403650}
4 years, 5 months ago (2016-07-04 08:50:28 UTC) #11
falken
4 years, 5 months ago (2016-07-04 10:39:09 UTC) #12
Message was sent while issue was closed.
On 2016/07/04 08:39:05, nhiroki wrote:
>
https://codereview.chromium.org/2115393002/diff/1/content/browser/service_wor...
> File content/browser/service_worker/service_worker_registration.cc (right):
> 
>
https://codereview.chromium.org/2115393002/diff/1/content/browser/service_wor...
> content/browser/service_worker/service_worker_registration.cc:430: void
> ServiceWorkerRegistration::Clear() {
> On 2016/07/04 08:14:37, falken wrote:
> > On 2016/07/04 07:53:38, nhiroki wrote:
> > > How about checking pre-conditions before flipping |is_uninstalling_| and
> > > |is_uninstalled_|?
> > > 
> > > DCHECK(is_uninstalling_);
> > > DCHECK(!is_uninstalled_);
> > 
> > Unfortunately I'm not 100% sure those hold. Since this patch doesn't change
> when
> > Clear() is called, I'll leave out the dchecks in this patch.
> 
> Acknowledged.
> 
> > In the future, these uninstalling/uninstalled/deleting flags should be
merged
> > into a single Status enum.
> 
> It's great to merge them! Are you going to try it? :)
> (I tried it before and gave up because of complex state transitions...)

Yea I plan to do this. It might lead to removing some complex code we no longer
need.

Powered by Google App Engine
This is Rietveld 408576698