RESOLVED FIXED Bug 67013
WebSocket: Load Blob in WebSocketChannel
https://bugs.webkit.org/show_bug.cgi?id=67013
Summary WebSocket: Load Blob in WebSocketChannel
Yuta Kitamura
Reported 2011-08-25 19:26:55 PDT
Part of implementing WebSocket.send(Blob).
Attachments
Patch (10.16 KB, patch)
2011-08-25 20:36 PDT, Yuta Kitamura
no flags
Patch v2 (10.61 KB, patch)
2011-08-26 01:03 PDT, Yuta Kitamura
no flags
Patch v3 (10.71 KB, patch)
2011-08-30 22:34 PDT, Yuta Kitamura
no flags
Yuta Kitamura
Comment 1 2011-08-25 20:36:28 PDT
WebKit Review Bot
Comment 2 2011-08-25 20:38:24 PDT
Attachment 105297 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1 Source/WebCore/websockets/WebSocketChannel.h:48: Code inside a namespace should not be indented. [whitespace/indent] [4] Total errors found: 1 in 3 files If any of these errors are false positives, please file a bug against check-webkit-style.
Yuta Kitamura
Comment 3 2011-08-25 20:40:24 PDT
CCing jianli and kinuko for Blob/FileReaderLoader usage.
Gyuyoung Kim
Comment 4 2011-08-25 20:41:48 PDT
Yuta Kitamura
Comment 5 2011-08-25 20:47:31 PDT
Comment on attachment 105297 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=105297&action=review >> Source/WebCore/websockets/WebSocketChannel.h:48 >> + class Blob; > > Code inside a namespace should not be indented. [whitespace/indent] [4] Indentation will be fixed independently.
Yuta Kitamura
Comment 6 2011-08-25 20:48:27 PDT
(In reply to comment #4) > (From update of attachment 105297 [details]) > Attachment 105297 [details] did not pass efl-ews (efl): > Output: http://queues.webkit.org/results/9513869 I forgot to guard FileReaderLoader with #if ENABLE(BLOB). Will be fixed in the next version.
Kent Tamura
Comment 7 2011-08-26 00:01:42 PDT
Comment on attachment 105297 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=105297&action=review > Source/WebCore/websockets/WebSocketChannel.cpp:858 > + if (m_blobLoaderStatus == BlobLoaderNotStarted) { We had better use switch(m_blobLoaderStatus). > Source/WebCore/websockets/WebSocketChannel.cpp:860 > + m_blobLoader = adoptPtr(new FileReaderLoader(FileReaderLoader::ReadAsArrayBuffer, this)); should we check ASSERT(!m_blobLoader)? Is it possible to enqueue multiple blob frames?
Yuta Kitamura
Comment 8 2011-08-26 01:03:58 PDT
Created attachment 105329 [details] Patch v2
Yuta Kitamura
Comment 9 2011-08-26 01:11:47 PDT
Comment on attachment 105297 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=105297&action=review >> Source/WebCore/websockets/WebSocketChannel.cpp:858 >> + if (m_blobLoaderStatus == BlobLoaderNotStarted) { > > We had better use switch(m_blobLoaderStatus). Fixed in patch v2. >> Source/WebCore/websockets/WebSocketChannel.cpp:860 >> + m_blobLoader = adoptPtr(new FileReaderLoader(FileReaderLoader::ReadAsArrayBuffer, this)); > > should we check ASSERT(!m_blobLoader)? > Is it possible to enqueue multiple blob frames? Added ASSERT. Re reading multiple Blob, it's technically possible and probably better, but I don't want to do it in this first version because adding many moving parts makes debugging hard and makes the code more fragile. I'll probably do it later. Added a FIXME comment in patch v2.
Kent Tamura
Comment 10 2011-08-29 22:11:24 PDT
Comment on attachment 105329 [details] Patch v2 I think the patch is ok except FileReaderLoader, which I'm not familiar with.
Kinuko Yasuda
Comment 11 2011-08-30 05:56:02 PDT
Comment on attachment 105329 [details] Patch v2 View in context: https://bugs.webkit.org/attachment.cgi?id=105329&action=review Changes related to FileReaderLoader looks good to me. > Source/WebCore/websockets/WebSocketChannel.cpp:913 > + m_blobLoader->cancel(); nit: no need to clear m_blobLoader here?
Yuta Kitamura
Comment 12 2011-08-30 22:34:18 PDT
Created attachment 105741 [details] Patch v3
Yuta Kitamura
Comment 13 2011-08-30 22:35:12 PDT
Comment on attachment 105329 [details] Patch v2 View in context: https://bugs.webkit.org/attachment.cgi?id=105329&action=review >> Source/WebCore/websockets/WebSocketChannel.cpp:913 >> + m_blobLoader->cancel(); > > nit: no need to clear m_blobLoader here? Good catch, thanks! Added didFail() in patch v3.
Kinuko Yasuda
Comment 14 2011-08-30 23:11:40 PDT
FileReaderLoader related changes looks good to me.
Kent Tamura
Comment 15 2011-08-30 23:45:25 PDT
Comment on attachment 105741 [details] Patch v3 ok
WebKit Review Bot
Comment 16 2011-08-31 01:35:00 PDT
Comment on attachment 105741 [details] Patch v3 Clearing flags on attachment: 105741 Committed r94162: <http://trac.webkit.org/changeset/94162>
WebKit Review Bot
Comment 17 2011-08-31 01:35:06 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.