[webkit-reviews] review granted: [Bug 181079] navigator.onLine does not work inside service workers : [Attachment 330545] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Jan 7 22:54:04 PST 2018


Darin Adler <darin at apple.com> has granted youenn fablet <youennf at gmail.com>'s
request for review:
Bug 181079: navigator.onLine does not work inside service workers
https://bugs.webkit.org/show_bug.cgi?id=181079

Attachment 330545: Patch

https://bugs.webkit.org/attachment.cgi?id=330545&action=review




--- Comment #10 from Darin Adler <darin at apple.com> ---
Comment on attachment 330545
  --> https://bugs.webkit.org/attachment.cgi?id=330545
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=330545&action=review

> Source/WebCore/testing/ServiceWorkerInternals.h:37
> +    static Ref<ServiceWorkerInternals> create(ServiceWorkerIdentifier
identifier) { return adoptRef(*new ServiceWorkerInternals { identifier }); }

For new classes I suggest having the create functions not be inlined; the
constructor can be inlined in the create function, which seems better to me.

> Source/WebCore/testing/js/WebCoreTestSupport.cpp:196
> +	   auto* execState = globalScope.execState();

In new WebCore code I would suggest:

    auto& state = *globalScope.execState();

Over time we we always be using references for this, not pointers.

> Source/WebCore/workers/service/context/ServiceWorkerThreadProxy.cpp:101
> +    auto addResult = allServiceWorkerThreadProxies().add(this);
> +    ASSERT_UNUSED(addResult, addResult.isNewEntry);

Since this is for debugging only, maybe assert !contains and do the assertion
before the add rather than using the add result?

> Source/WebCore/workers/service/context/ServiceWorkerThreadProxy.cpp:112
> +    allServiceWorkerThreadProxies().remove(this);

Maybe assert contains here?

> Source/WebCore/workers/service/context/ServiceWorkerThreadProxy.h:69
> +    // Public only for testing purposes.
> +    WEBCORE_EXPORT void notifyNetworkStateChange(bool isOnline);

Is this what WEBCORE_TESTSUPPORT_EXPORT is for? Or is that something else?


More information about the webkit-reviews mailing list