Commit cb381999 authored by dominicc@chromium.org's avatar dominicc@chromium.org

Make ServiceWorker::from handle "unwrapping" a null ServiceWorker

Currently ServiceWorkers are non-null, however when we implement the .waiting property, the browser will "set" a null ServiceWorker to clear the property. Make Blink ready to unwrap one of those.

BUG=379012

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

git-svn-id: svn://svn.chromium.org/blink/trunk@175853 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 336cdb95
...@@ -140,6 +140,9 @@ const AtomicString& ServiceWorker::state() const ...@@ -140,6 +140,9 @@ const AtomicString& ServiceWorker::state() const
PassRefPtr<ServiceWorker> ServiceWorker::from(ExecutionContext* executionContext, WebType* worker) PassRefPtr<ServiceWorker> ServiceWorker::from(ExecutionContext* executionContext, WebType* worker)
{ {
if (!worker)
return PassRefPtr<ServiceWorker>();
blink::WebServiceWorkerProxy* proxy = worker->proxy(); blink::WebServiceWorkerProxy* proxy = worker->proxy();
ServiceWorker* existingServiceWorker = proxy ? proxy->unwrap() : 0; ServiceWorker* existingServiceWorker = proxy ? proxy->unwrap() : 0;
if (existingServiceWorker) { if (existingServiceWorker) {
......
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