WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED WONTFIX
54226
[Chromium] WebSocket: Implement WebKit::WebSocketStreamError
https://bugs.webkit.org/show_bug.cgi?id=54226
Summary
[Chromium] WebSocket: Implement WebKit::WebSocketStreamError
Yuta Kitamura
Reported
2011-02-10 11:07:11 PST
Currently, WebKit::WebSocketStreamError is not implemented and there is no way to report errors arising from underlying sockets. Need to implement it to show these errors in JavaScript console and let developers debug WebSocket issues easily.
Attachments
Patch
(9.34 KB, patch)
2011-02-10 13:02 PST
,
Yuta Kitamura
no flags
Details
Formatted Diff
Diff
Patch v2
(9.82 KB, patch)
2011-04-19 23:52 PDT
,
Yuta Kitamura
no flags
Details
Formatted Diff
Diff
Patch v3
(9.85 KB, patch)
2011-05-06 01:06 PDT
,
Yuta Kitamura
no flags
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Yuta Kitamura
Comment 1
2011-02-10 11:08:43 PST
Related bug:
bug 40945
(SocketStreamError implementation for Apple port),
http://crbug.com/67662
Yuta Kitamura
Comment 2
2011-02-10 13:02:33 PST
Created
attachment 82033
[details]
Patch
Yuta Kitamura
Comment 3
2011-02-10 13:41:13 PST
FYI, follow-up patch for Chromium:
http://codereview.chromium.org/6474012/
The change above should be committed *after* the patch on this bug is merged.
Fumitoshi Ukai
Comment 4
2011-02-14 22:53:17 PST
Comment on
attachment 82033
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=82033&action=review
> Source/WebCore/platform/network/chromium/SocketStreamError.h:43 > + SocketStreamError(int errorCode, const String& failingURL, const String& localizedDescription)
I'm not sure, but localized description should be retrieved via WebCore/platform/LocalizedStrings.h ? Do we need failingURL? I think SocketStreamHandleClient (that is, WebSocketChannel) should know the corresponding URL.
Yuta Kitamura
Comment 5
2011-02-15 18:27:26 PST
(In reply to
comment #4
)
> I'm not sure, but localized description should be retrieved via > WebCore/platform/LocalizedStrings.h ? >
As I understand, localizedDescription represents a system error message (such as "Connection was refused" or "Network is unreachable"), which each port has some way to translate (strerror for example). Errors come from the browser process, so we can translate them inside Chromium, not using WebCore's LocalizedStrings.
> Do we need failingURL? I think SocketStreamHandleClient (that is, WebSocketChannel) should know the corresponding URL.
No. I'll remove it in another changelist. I'd like to focus this change on Chromium port. (I just copied failingURL from ResourceError and did not notice it was not necessary)
Fumitoshi Ukai
Comment 6
2011-02-15 18:31:35 PST
(In reply to
comment #5
)
> (In reply to
comment #4
) > > I'm not sure, but localized description should be retrieved via > > WebCore/platform/LocalizedStrings.h ? > > > > As I understand, localizedDescription represents a system error message (such as "Connection was refused" or "Network is unreachable"), which each port has some way to translate (strerror for example). > > Errors come from the browser process, so we can translate them inside Chromium, not using WebCore's LocalizedStrings.
Then, I think it's better to call it systemErrorMessage.
> > Do we need failingURL? I think SocketStreamHandleClient (that is, WebSocketChannel) should know the corresponding URL. > > No. I'll remove it in another changelist. I'd like to focus this change on Chromium port.
Why not in this changelist?
> > (I just copied failingURL from ResourceError and did not notice it was not necessary)
Darin Fisher (:fishd, Google)
Comment 7
2011-04-04 21:09:24 PDT
Comment on
attachment 82033
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=82033&action=review
> Source/WebKit/chromium/src/WebSocketStreamError.cpp:46 > + WTF::String errorDescription(m_errorDescription);
should be no need for WTF:: in .cpp file. please add a 'using namespace WebCore' at the top so you don't need the WebCore:: prefixes either. also, i don't think you need this temporary.
> Source/WebKit/chromium/src/WebSocketStreamError.cpp:47 > + WTF::String failingURL(static_cast<WebCore::KURL>(m_failingURL).string());
instead of casting to KURL, please just construct a KURL. casts are ugly, but WebURL provides the casting operator so that you can just construct a KURL from a WebURL w/o having to make KURL know about WebURL. come to think about it, perhaps it would be more consistent w/ webkit API conventions if this function were a casting operator to WebCore::SocketStreamError. then when using WebSocketStreamError, you could just happily pass those objects to methods expecting a WebCore::SocketStreamError :)
> Source/WebKit/chromium/src/WebSocketStreamError.cpp:48 > + return WebCore::SocketStreamError(m_errorCode, failingURL, errorDescription);
i think you should be able to compact to this: return WebCore::SocketStreamError(m_errorCode, KURL(failingURL).string(), m_errorDescription);
Yuta Kitamura
Comment 8
2011-04-18 04:15:25 PDT
(In reply to
comment #6
)
> Then, I think it's better to call it systemErrorMessage.
What's systemErrorMessage? I could not find any usage inside WebKit.
> Why not in this changelist?
To lower the reviewer's load. Reviewers who are good at WebCore/websockets (like ap@apple) may not be good at WebKit/chromium, and vice versa.
Yuta Kitamura
Comment 9
2011-04-19 23:52:37 PDT
Created
attachment 90317
[details]
Patch v2
Yuta Kitamura
Comment 10
2011-04-20 00:01:36 PDT
I think I addressed all issues raised by Darin. In terms of failingURL, we have decided not to remove it (see
bug 58765
).
Adam Barth
Comment 11
2011-04-27 14:04:44 PDT
Comment on
attachment 90317
[details]
Patch v2 View in context:
https://bugs.webkit.org/attachment.cgi?id=90317&action=review
This looks great, but we need fishd for WebKit API approval.
> Source/WebKit/chromium/public/WebSocketStreamError.h:55 > + WebSocketStreamError() > + : m_isNull(true), m_errorCode(0) { } > + WebSocketStreamError(int errorCode, const WebString& errorDescription, const WebURL& failingURL) > + : m_isNull(false), m_errorCode(errorCode), m_errorDescription(errorDescription), m_failingURL(failingURL) { }
Each initializer should be on it's own line.
> Source/WebKit/chromium/src/WebSocketStreamError.cpp:48 > + return SocketStreamError(m_errorCode, KURL(m_failingURL).string(), m_errorDescription);
Is KURL(m_failingURL).string() the right pattern here?
Adam Barth
Comment 12
2011-04-27 14:06:19 PDT
(In reply to
comment #11
)
> (From update of
attachment 90317
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=90317&action=review
>
> > Source/WebKit/chromium/src/WebSocketStreamError.cpp:48 > > + return SocketStreamError(m_errorCode, KURL(m_failingURL).string(), m_errorDescription); > > Is KURL(m_failingURL).string() the right pattern here?
Looks like it is the right pattern, according to fishd.
Adam Barth
Comment 13
2011-04-27 14:06:38 PDT
+fishd for WebKit API approval.
Yuta Kitamura
Comment 14
2011-05-06 01:06:05 PDT
Created
attachment 92558
[details]
Patch v3
Eric Seidel (no email)
Comment 15
2012-01-30 15:10:49 PST
Has this really been pending API approval for 8 months? :p
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