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

ServiceWorker: Clean up WebServiceWorkerRegistrationImpl

BUG=n/a
TEST=should pass all existing tests (no behavioral change)

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

Cr-Commit-Position: refs/heads/master@{#292302}
parent 73e898c3
......@@ -340,7 +340,7 @@ void ServiceWorkerDispatcher::SetInstallingServiceWorker(
registrations_.find(registration_handle_id);
if (found != registrations_.end()) {
// Populate the .installing field with the new worker object.
found->second->setInstalling(GetServiceWorker(info, false));
found->second->SetInstalling(GetServiceWorker(info, false));
if (info.handle_id != kInvalidServiceWorkerHandleId)
found->second->OnUpdateFound();
}
......@@ -370,7 +370,7 @@ void ServiceWorkerDispatcher::SetWaitingServiceWorker(
registrations_.find(registration_handle_id);
if (found != registrations_.end()) {
// Populate the .waiting field with the new worker object.
found->second->setWaiting(GetServiceWorker(info, false));
found->second->SetWaiting(GetServiceWorker(info, false));
}
}
......@@ -398,7 +398,7 @@ void ServiceWorkerDispatcher::SetActiveServiceWorker(
registrations_.find(registration_handle_id);
if (found != registrations_.end()) {
// Populate the .active field with the new worker object.
found->second->setActive(GetServiceWorker(info, false));
found->second->SetActive(GetServiceWorker(info, false));
}
}
......
......@@ -31,39 +31,39 @@ WebServiceWorkerRegistrationImpl::~WebServiceWorkerRegistrationImpl() {
dispatcher->RemoveServiceWorkerRegistration(handle_ref_->handle_id());
}
void WebServiceWorkerRegistrationImpl::OnUpdateFound() {
DCHECK(proxy_);
proxy_->dispatchUpdateFoundEvent();
}
void WebServiceWorkerRegistrationImpl::setProxy(
blink::WebServiceWorkerRegistrationProxy* proxy) {
proxy_ = proxy;
}
blink::WebServiceWorkerRegistrationProxy*
WebServiceWorkerRegistrationImpl::proxy() {
return proxy_;
}
void WebServiceWorkerRegistrationImpl::setInstalling(
void WebServiceWorkerRegistrationImpl::SetInstalling(
blink::WebServiceWorker* service_worker) {
DCHECK(proxy_);
proxy_->setInstalling(service_worker);
}
void WebServiceWorkerRegistrationImpl::setWaiting(
void WebServiceWorkerRegistrationImpl::SetWaiting(
blink::WebServiceWorker* service_worker) {
DCHECK(proxy_);
proxy_->setWaiting(service_worker);
}
void WebServiceWorkerRegistrationImpl::setActive(
void WebServiceWorkerRegistrationImpl::SetActive(
blink::WebServiceWorker* service_worker) {
DCHECK(proxy_);
proxy_->setActive(service_worker);
}
void WebServiceWorkerRegistrationImpl::OnUpdateFound() {
DCHECK(proxy_);
proxy_->dispatchUpdateFoundEvent();
}
void WebServiceWorkerRegistrationImpl::setProxy(
blink::WebServiceWorkerRegistrationProxy* proxy) {
proxy_ = proxy;
}
blink::WebServiceWorkerRegistrationProxy*
WebServiceWorkerRegistrationImpl::proxy() {
return proxy_;
}
blink::WebURL WebServiceWorkerRegistrationImpl::scope() const {
return handle_ref_->scope();
}
......
......@@ -26,14 +26,15 @@ class WebServiceWorkerRegistrationImpl
scoped_ptr<ServiceWorkerRegistrationHandleReference> handle_ref);
virtual ~WebServiceWorkerRegistrationImpl();
void SetInstalling(blink::WebServiceWorker* service_worker);
void SetWaiting(blink::WebServiceWorker* service_worker);
void SetActive(blink::WebServiceWorker* service_worker);
void OnUpdateFound();
// blink::WebServiceWorkerRegistration overrides.
virtual void setProxy(blink::WebServiceWorkerRegistrationProxy* proxy);
virtual blink::WebServiceWorkerRegistrationProxy* proxy();
virtual void setInstalling(blink::WebServiceWorker* service_worker);
virtual void setWaiting(blink::WebServiceWorker* service_worker);
virtual void setActive(blink::WebServiceWorker* service_worker);
virtual blink::WebURL scope() const;
private:
......
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