Commit e849bd83 authored by nhiroki's avatar nhiroki Committed by Commit bot

ServiceWorker: Fix registration refcount handling in the renderer

- ServiceWorkerRegistrationHandleReference::Create() should increment registration refcount
- ServiceWorkerMessageFilter::OnStaleSetVersionAttributes shouldn’t decrement registration refcount

TEST=n/a
BUG=452403

Review URL: https://codereview.chromium.org/868483008

Cr-Commit-Position: refs/heads/master@{#313497}
parent 4463a715
......@@ -104,8 +104,8 @@ void ServiceWorkerMessageFilter::OnStaleSetVersionAttributes(
attrs.waiting.handle_id);
SendServiceWorkerObjectDestroyed(thread_safe_sender_.get(),
attrs.active.handle_id);
SendRegistrationObjectDestroyed(thread_safe_sender_.get(),
registration_handle_id);
// Don't have to decrement registration refcount because the sender of the
// SetVersionAttributes message doesn't increment it.
}
void ServiceWorkerMessageFilter::OnStaleSetControllerServiceWorker(
......
......@@ -34,7 +34,7 @@ ServiceWorkerRegistrationHandleReference(
sender_(sender) {
DCHECK_NE(kInvalidServiceWorkerRegistrationHandleId, info_.handle_id);
DCHECK(sender_.get());
if (increment_ref_in_ctor)
if (!increment_ref_in_ctor)
return;
sender_->Send(
new ServiceWorkerHostMsg_IncrementRegistrationRefCount(info_.handle_id));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment