Bug 177741 - [GLib] NetworkStateNotifier implementation missing
Summary: [GLib] NetworkStateNotifier implementation missing
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Gustavo Noronha (kov)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-10-02 06:22 PDT by Gustavo Noronha (kov)
Modified: 2017-10-02 11:08 PDT (History)
4 users (show)

See Also:


Attachments
Patch (6.03 KB, patch)
2017-10-02 06:26 PDT, Gustavo Noronha (kov)
no flags Details | Formatted Diff | Diff
Patch for landing (5.72 KB, patch)
2017-10-02 10:02 PDT, Gustavo Noronha (kov)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gustavo Noronha (kov) 2017-10-02 06:22:59 PDT
[GLib] NetworkStateNotifier implementation missing
Comment 1 Gustavo Noronha (kov) 2017-10-02 06:26:56 PDT
Created attachment 322372 [details]
Patch
Comment 2 Gustavo Noronha (kov) 2017-10-02 06:29:55 PDT
I used this to test: http://html5-demos.appspot.com/static/navigator.onLine.html
Comment 3 Carlos Garcia Campos 2017-10-02 06:59:31 PDT
Comment on attachment 322372 [details]
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.
Comment 4 Michael Catanzaro 2017-10-02 07:09:19 PDT
Comment on attachment 322372 [details]
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) && !PLATFORM(GTK) && !PLATFORM(WPE)
> 
> So, can we remove the stubs now then?

Yeah, looks like it's #if !EVERYTHING now!
Comment 5 Gustavo Noronha (kov) 2017-10-02 10:02:39 PDT
Created attachment 322383 [details]
Patch for landing
Comment 6 WebKit Commit Bot 2017-10-02 11:08:10 PDT
Comment on attachment 322383 [details]
Patch for landing

Clearing flags on attachment: 322383

Committed r222723: <http://trac.webkit.org/changeset/222723>
Comment 7 WebKit Commit Bot 2017-10-02 11:08:11 PDT
All reviewed patches have been landed.  Closing bug.