WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
95532
[EFL] Add proper support for navigator.onLine and associated events
https://bugs.webkit.org/show_bug.cgi?id=95532
Summary
[EFL] Add proper support for navigator.onLine and associated events
Chris Dumez
Reported
2012-08-31 00:23:28 PDT
The EFL port currently relies on the client application to provide it with the current onLine state. We should be able to detect and monitor the onLine state without relying on the client application, similarly to what other ports are doing.
Attachments
Patch
(12.02 KB, patch)
2012-08-31 00:29 PDT
,
Chris Dumez
kenneth
: review+
kenneth
: commit-queue-
Details
Formatted Diff
Diff
Patch for landing
(12.09 KB, patch)
2012-08-31 01:54 PDT
,
Chris Dumez
cdumez
: commit-queue-
Details
Formatted Diff
Diff
Patch for landing
(12.91 KB, patch)
2012-08-31 03:14 PDT
,
Chris Dumez
cdumez
: commit-queue-
Details
Formatted Diff
Diff
Fixed patch
(12.90 KB, patch)
2012-08-31 05:25 PDT
,
Chris Dumez
no flags
Details
Formatted Diff
Diff
Show Obsolete
(3)
View All
Add attachment
proposed patch, testcase, etc.
Chris Dumez
Comment 1
2012-08-31 00:29:00 PDT
Created
attachment 161628
[details]
Patch
Kenneth Rohde Christiansen
Comment 2
2012-08-31 00:42:00 PDT
Comment on
attachment 161628
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=161628&action=review
> Source/WebCore/platform/network/efl/NetworkStateNotifierEfl.cpp:49 > + // Assume that we're offline until proven otherwise. > + m_isOnLine = false;
It that really wise?
> Source/WebCore/platform/network/efl/NetworkStateNotifierEfl.cpp:60 > + if (!syspath || !strcmp(syspath, UdevLoopBackInterfaceSysPath))
When you are already taking assumption that UdevLoo/... is non-null, why not use strncmp() with 2?
> Source/WebCore/platform/network/efl/NetworkStateNotifierEfl.cpp:77 > + eeze_net_free(static_cast<Eeze_Net*>(data));
why different indentation
> Source/WebCore/platform/network/efl/NetworkStateNotifierEfl.cpp:93 > + char buffer[4096]; > + size_t len;
why not initialize len to 4096;? size_t len = 4096 char buffer[len] then replace it
> Source/WebCore/platform/network/efl/NetworkStateNotifierEfl.cpp:102 > + if (nlh->nlmsg_type == RTM_NEWADDR > + || nlh->nlmsg_type == RTM_DELADDR) {
why not just keep that on one line?
> Source/WebCore/platform/network/efl/NetworkStateNotifierEfl.cpp:116 > + int sock = ecore_main_fd_handler_fd_get(m_fdHandler);
socket?
> Source/WebCore/platform/network/efl/NetworkStateNotifierEfl.cpp:120 > + eeze_shutdown();
what if it is used elsewhere? (I believe it is)
> Source/WebCore/platform/network/efl/NetworkStateNotifierEfl.cpp:147 > + if (bind(sock, (struct sockaddr *)&addr, sizeof(addr)) == -1) {
wrong styled cast
Gyuyoung Kim
Comment 3
2012-08-31 01:17:26 PDT
Comment on
attachment 161628
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=161628&action=review
> Source/WebCore/platform/network/efl/NetworkStateNotifierEfl.cpp:89 > +static Eina_Bool readSocketCallback(void* userData, Ecore_Fd_Handler* handler)
We decided to use standard boolean type except for public API.
Chris Dumez
Comment 4
2012-08-31 01:22:01 PDT
Comment on
attachment 161628
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=161628&action=review
>> Source/WebCore/platform/network/efl/NetworkStateNotifierEfl.cpp:89 >> +static Eina_Bool readSocketCallback(void* userData, Ecore_Fd_Handler* handler) > > We decided to use standard boolean type except for public API.
It is a EFL callback, I'm not sure I can use bool but I'll try.
>> Source/WebCore/platform/network/efl/NetworkStateNotifierEfl.cpp:120 >> + eeze_shutdown(); > > what if it is used elsewhere? (I believe it is)
Not a problem. This merely decreases some ref count. I call _init() to increment refcount so I need to call _shutdown() to decrement it as well:
http://docs.enlightenment.org/auto/eeze/group__main.html#ga908dda677760bf318a67428938a07d42
Chris Dumez
Comment 5
2012-08-31 01:24:34 PDT
Comment on
attachment 161628
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=161628&action=review
>>> Source/WebCore/platform/network/efl/NetworkStateNotifierEfl.cpp:89 >>> +static Eina_Bool readSocketCallback(void* userData, Ecore_Fd_Handler* handler) >> >> We decided to use standard boolean type except for public API. > > It is a EFL callback, I'm not sure I can use bool but I'll try.
As I thought, this won't compile. It needs to be Eina_Bool.
Chris Dumez
Comment 6
2012-08-31 01:54:35 PDT
Created
attachment 161640
[details]
Patch for landing Take Kenneth's feedback into consideration.
Raphael Kubo da Costa (:rakuco)
Comment 7
2012-08-31 01:59:45 PDT
Does this work with --no-networkinfo as well?
Gyuyoung Kim
Comment 8
2012-08-31 03:03:17 PDT
(In reply to
comment #5
)
> (From update of
attachment 161628
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=161628&action=review
> > >>> Source/WebCore/platform/network/efl/NetworkStateNotifierEfl.cpp:89 > >>> +static Eina_Bool readSocketCallback(void* userData, Ecore_Fd_Handler* handler) > >> > >> We decided to use standard boolean type except for public API. > > > > It is a EFL callback, I'm not sure I can use bool but I'll try. > > As I thought, this won't compile. It needs to be Eina_Bool.
Yes, I add this case to EFL coding style wiki page. Thanks.
https://trac.webkit.org/wiki/EFLWebKitCodingStyle
Chris Dumez
Comment 9
2012-08-31 03:09:49 PDT
(In reply to
comment #7
)
> Does this work with --no-networkinfo as well?
Right, it Gamepads and NetworkInfo support is disabled then it won't compile. I'll fix the CMake.
Chris Dumez
Comment 10
2012-08-31 03:14:18 PDT
Created
attachment 161649
[details]
Patch for landing Link unconditionally against Eeze library now.
Chris Dumez
Comment 11
2012-08-31 05:11:00 PDT
Comment on
attachment 161649
[details]
Patch for landing I need to double check something before this lands. I think it may cause a regression.
Chris Dumez
Comment 12
2012-08-31 05:25:46 PDT
Created
attachment 161672
[details]
Fixed patch Fix 2 issues with the first version of the patch 1. use ssize_t instead of size_t for len (used to store return value of recv()). We cannot use size_t since recv() returns -1 when there is nothing to read anymore. 2. Use MSG_DONTWAIT flag for recv() to make the operation non-blocking. Setting r? again since those are not style changes.
WebKit Review Bot
Comment 13
2012-08-31 07:34:51 PDT
Comment on
attachment 161672
[details]
Fixed patch Clearing flags on attachment: 161672 Committed
r127258
: <
http://trac.webkit.org/changeset/127258
>
WebKit Review Bot
Comment 14
2012-08-31 07:34:55 PDT
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug