Bug 84982 - [BlackBerry] run-time websocket availability check was lost
Summary: [BlackBerry] run-time websocket availability check was lost
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit BlackBerry (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Joe Mason
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-26 11:54 PDT by Joe Mason
Modified: 2013-01-04 10:02 PST (History)
6 users (show)

See Also:


Attachments
patch (7.32 KB, patch)
2012-04-27 09:08 PDT, Joe Mason
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ec2-cq-02 (6.00 MB, application/zip)
2012-04-27 13:43 PDT, WebKit Review Bot
no flags Details
Archive of layout-test-results from ec2-cq-01 (5.98 MB, application/zip)
2012-04-27 16:04 PDT, WebKit Review Bot
no flags Details
Archive of layout-test-results from ec2-cr-linux-03 (5.68 MB, application/zip)
2012-04-27 20:49 PDT, WebKit Review Bot
no flags Details
Patch (6.67 KB, patch)
2012-10-12 08:30 PDT, Rob Buis
no flags Details | Formatted Diff | Diff
Patch (6.50 KB, patch)
2012-10-12 08:48 PDT, Rob Buis
no flags Details | Formatted Diff | Diff
Patch (4.46 KB, patch)
2012-10-12 11:05 PDT, Rob Buis
no flags Details | Formatted Diff | Diff
Patch (4.48 KB, patch)
2012-10-12 11:07 PDT, Rob Buis
yong.li.webkit: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joe Mason 2012-04-26 11:54:40 PDT
The patch to check if websocket is available at runtime was lost when JSDOMWindow::webSocket moved to JSDOMWindowWebSocketCustom.cpp.
Comment 1 Joe Mason 2012-04-27 09:08:23 PDT
Created attachment 139213 [details]
patch
Comment 2 WebKit Review Bot 2012-04-27 09:11:54 PDT
Attachment 139213 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'LayoutTests/platform/blackberry/http/tests..." exit_code: 1
Source/WebCore/bindings/js/JSDOMWindowWebSocketCustom.cpp:32:  Found header this file implements after other header. Should be: config.h, primary header, blank line, and then alphabetically sorted.  [build/include_order] [4]
Total errors found: 1 in 6 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Joe Mason 2012-04-27 10:02:58 PDT
Comment on attachment 139213 [details]
patch

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

>> Source/WebCore/bindings/js/JSDOMWindowWebSocketCustom.cpp:32
>> +#include "WebSocket.h"
> 
> Found header this file implements after other header. Should be: config.h, primary header, blank line, and then alphabetically sorted.  [build/include_order] [4]

This is a false positive.  Filed bug 85075.  For now this will have to be committed by hand.
Comment 4 WebKit Review Bot 2012-04-27 13:43:05 PDT
Comment on attachment 139213 [details]
patch

Rejecting attachment 139213 [details] from commit-queue.

New failing tests:
platform/blackberry/http/tests/websocket/tests/enable-disable-setting.html
Full output: http://queues.webkit.org/results/12549321
Comment 5 WebKit Review Bot 2012-04-27 13:43:11 PDT
Created attachment 139263 [details]
Archive of layout-test-results from ec2-cq-02

The attached test failures were seen while running run-webkit-tests on the commit-queue.
Bot: ec2-cq-02  Port: <class 'webkitpy.common.config.ports.ChromiumXVFBPort'>  Platform: Linux-2.6.35-28-virtual-x86_64-with-Ubuntu-10.10-maverick
Comment 6 WebKit Review Bot 2012-04-27 16:04:41 PDT
Comment on attachment 139213 [details]
patch

Rejecting attachment 139213 [details] from commit-queue.

New failing tests:
platform/blackberry/http/tests/websocket/tests/enable-disable-setting.html
Full output: http://queues.webkit.org/results/12555379
Comment 7 WebKit Review Bot 2012-04-27 16:04:46 PDT
Created attachment 139298 [details]
Archive of layout-test-results from ec2-cq-01

The attached test failures were seen while running run-webkit-tests on the commit-queue.
Bot: ec2-cq-01  Port: <class 'webkitpy.common.config.ports.ChromiumXVFBPort'>  Platform: Linux-2.6.35-28-virtual-x86_64-with-Ubuntu-10.10-maverick
Comment 8 Antonio Gomes 2012-04-27 20:45:37 PDT
Is chromium trying to run a layout test added to layouttests/platform/blackberry?
Comment 9 WebKit Review Bot 2012-04-27 20:49:10 PDT
Comment on attachment 139213 [details]
patch

Attachment 139213 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/12552470

New failing tests:
platform/blackberry/http/tests/websocket/tests/enable-disable-setting.html
Comment 10 WebKit Review Bot 2012-04-27 20:49:16 PDT
Created attachment 139331 [details]
Archive of layout-test-results from ec2-cr-linux-03

The attached test failures were seen while running run-webkit-tests on the chromium-ews.
Bot: ec2-cr-linux-03  Port: <class 'webkitpy.common.config.ports.ChromiumXVFBPort'>  Platform: Linux-2.6.35-28-virtual-x86_64-with-Ubuntu-10.10-maverick
Comment 11 Rob Buis 2012-10-12 08:30:19 PDT
Created attachment 168422 [details]
Patch
Comment 12 WebKit Review Bot 2012-10-12 08:32:17 PDT
Attachment 168422 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'LayoutTests/ChangeLog', u'LayoutTests/plat..." exit_code: 1
Source/WebCore/bindings/js/JSDOMWindowWebSocketCustom.cpp:31:  Found header this file implements after other header. Should be: config.h, primary header, blank line, and then alphabetically sorted.  [build/include_order] [4]
Total errors found: 1 in 7 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 13 Rob Buis 2012-10-12 08:48:59 PDT
Created attachment 168427 [details]
Patch
Comment 14 Yong Li 2012-10-12 10:09:27 PDT
Comment on attachment 168427 [details]
Patch

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

> Source/WebCore/bindings/js/JSDOMWindowWebSocketCustom.cpp:57
>  JSValue JSDOMWindow::webSocket(ExecState* exec) const
>  {
>      if (!settingsForWindowWebSocket(this))
>          return jsUndefined();
> +#if PLATFORM(BLACKBERRY)
> +    // FIXME: returning undefined is not the same things as disabling the
> +    // WebSocket object completely. But, this is the best we can do without
> +    // changing the code generation to check RuntimeEnabledFeatures, like V8
> +    // does, which is too big a job at the moment. Remove this check when
> +    // https://bugs.webkit.org/show_bug.cgi?id=52011 is fixed.
> +    if (!WebSocket::isAvailable())
> +        return jsUndefined();
> +#endif
>      return getDOMConstructor<JSWebSocketConstructor>(exec, this);
>  }

I don't like this #if PLATFORM(). Does returning jsUndefined when !WebSocket::isAvailable() also make sense to other ports?
Comment 15 Rob Buis 2012-10-12 11:05:10 PDT
Created attachment 168448 [details]
Patch
Comment 16 Rob Buis 2012-10-12 11:07:03 PDT
Created attachment 168449 [details]
Patch
Comment 17 Joe Mason 2012-10-12 12:59:36 PDT
(In reply to comment #14)
> I don't like this #if PLATFORM(). Does returning jsUndefined when !WebSocket::isAvailable() also make sense to other ports?

Not really - it's kind of a hack. The correct thing to do is to drop "websocket" from the list of properties entirely, which only works under V8. (There's a bug open about that.) If other ports want to take advantage of this they can add themselves to the ifdef, but it would be rude to turn this behaviour on by default.
Comment 18 Rob Buis 2013-01-04 10:02:22 PST
This landed in r131204, closing.