[webkit-reviews] review granted: [Bug 177741] [GLib] NetworkStateNotifier implementation missing : [Attachment 322372] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Oct 2 06:59:31 PDT 2017


Carlos Garcia Campos <cgarcia at igalia.com> has granted Gustavo Noronha (kov)
<gns at gnome.org>'s request for review:
Bug 177741: [GLib] NetworkStateNotifier implementation missing
https://bugs.webkit.org/show_bug.cgi?id=177741

Attachment 322372: Patch

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




--- Comment #3 from Carlos Garcia Campos <cgarcia at igalia.com> ---
Comment on attachment 322372
  --> https://bugs.webkit.org/attachment.cgi?id=322372
Patch

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

> Source/WebCore/platform/network/NetworkStateNotifier.cpp:78
>  
> -#if !PLATFORM(IOS) && !PLATFORM(MAC) && !PLATFORM(WIN)
> +#if !PLATFORM(IOS) && !PLATFORM(MAC) && !PLATFORM(WIN) && !PLATFORM(GTK) &&
!PLATFORM(WPE)

So, can we remove the stubs now then?

> Source/WebCore/platform/network/glib/NetworkStateNotifierGLib.cpp:29
> +    GNetworkMonitor* monitor = g_network_monitor_get_default();
> +    m_isOnLine = g_network_monitor_get_network_available(monitor);

This can be one line, we don't need the local variable.

> Source/WebCore/platform/network/glib/NetworkStateNotifierGLib.cpp:40
> +    GNetworkMonitor* monitor = g_network_monitor_get_default();
> +    g_signal_connect(monitor, "network-changed",
G_CALLBACK(networkChangedCallback), this);

Ditto. Since we don't really use the monitor in the callback we could use
connect swapped and the callbck would only receive the NetworkStateNotifier and
we don't need the forward declaration in the header either.


More information about the webkit-reviews mailing list