Add extension attribute support.
Created attachment 126880 [details] Patch
Comment on attachment 126880 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=126880&action=review Generally looks fine except for one comment. [Note: I don't have r+ privilege] > Source/WebCore/websockets/WebSocketExtensionDispatcher.cpp:228 > + if (!acceptedExtensions.contains(extensionToken)) This code requires O(N^2)-time for N extension items, right? O(N^2) algorithm is not acceptable.
Created attachment 126937 [details] Patch
Comment on attachment 126880 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=126880&action=review >> Source/WebCore/websockets/WebSocketExtensionDispatcher.cpp:228 >> + if (!acceptedExtensions.contains(extensionToken)) > > This code requires O(N^2)-time for N extension items, right? O(N^2) algorithm is not acceptable. Used Vector<bool> as flags to determine whether the extensionToken should be appended.
Kent-san, Alexey, Could you review the patch?
Comment on attachment 126937 [details] Patch Talked with Yuta-san in person. I'll change the behavior.
Created attachment 126946 [details] Patch
Attachment 126946 [details] did not pass style-queue: Failed to run "['Tools/Scripts/update-webkit']" exit_code: 9 Updating OpenSource First, rewinding head to replay your work on top of it... Applying: [Mac][Win][WK2] Switch to RFC 6455 protocol for WebSockets Using index info to reconstruct a base tree... <stdin>:1578: trailing whitespace. <stdin>:1647: trailing whitespace. <stdin>:1657: trailing whitespace. <stdin>:1672: trailing whitespace. return 0; <stdin>:1674: trailing whitespace. warning: squelched 7 whitespace errors warning: 12 lines add whitespace errors. Falling back to patching base and 3-way merge... warning: too many files (created: 168766 deleted: 3), skipping inexact rename detection Auto-merging LayoutTests/ChangeLog CONFLICT (content): Merge conflict in LayoutTests/ChangeLog Auto-merging Source/WebCore/ChangeLog CONFLICT (content): Merge conflict in Source/WebCore/ChangeLog Auto-merging Tools/ChangeLog CONFLICT (content): Merge conflict in Tools/ChangeLog Failed to merge in the changes. Patch failed at 0001 [Mac][Win][WK2] Switch to RFC 6455 protocol for WebSockets When you have resolved this problem run "git rebase --continue". If you would prefer to skip this patch, instead run "git rebase --skip". To restore the original branch and stop rebasing run "git rebase --abort". rebase refs/remotes/origin/master: command returned error: 1 Died at Tools/Scripts/update-webkit line 164. If any of these errors are false positives, please file a bug against check-webkit-style.
Comment on attachment 126946 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=126946&action=review Looks OK. [Note: I don't have r+ privilege yet.] > Source/WebCore/websockets/WebSocketExtensionDispatcher.cpp:181 > + for (HashMap<String, String>::const_iterator iterator = extensionParameters.begin(); iterator != extensionParameters.end(); ++iterator) { Please add a FIXME comment which indicates there's a possibility of changing the order of parameters due to HashMap. (As we told off-line, I assume you are going to fix this as a separate issue.)
Created attachment 126954 [details] Patch
Comment on attachment 126946 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=126946&action=review >> Source/WebCore/websockets/WebSocketExtensionDispatcher.cpp:181 >> + for (HashMap<String, String>::const_iterator iterator = extensionParameters.begin(); iterator != extensionParameters.end(); ++iterator) { > > Please add a FIXME comment which indicates there's a possibility of changing the order of parameters due to HashMap. (As we told off-line, I assume you are going to fix this as a separate issue.) Done.
Attachment 126954 [details] did not pass style-queue: Failed to run "['Tools/Scripts/update-webkit']" exit_code: 9 Updating OpenSource First, rewinding head to replay your work on top of it... Applying: [Mac][Win][WK2] Switch to RFC 6455 protocol for WebSockets Using index info to reconstruct a base tree... <stdin>:1578: trailing whitespace. <stdin>:1647: trailing whitespace. <stdin>:1657: trailing whitespace. <stdin>:1672: trailing whitespace. return 0; <stdin>:1674: trailing whitespace. warning: squelched 7 whitespace errors warning: 12 lines add whitespace errors. Falling back to patching base and 3-way merge... warning: too many files (created: 168768 deleted: 3), skipping inexact rename detection Auto-merging LayoutTests/ChangeLog CONFLICT (content): Merge conflict in LayoutTests/ChangeLog Auto-merging Source/WebCore/ChangeLog Auto-merging Tools/ChangeLog CONFLICT (content): Merge conflict in Tools/ChangeLog Failed to merge in the changes. Patch failed at 0001 [Mac][Win][WK2] Switch to RFC 6455 protocol for WebSockets When you have resolved this problem run "git rebase --continue". If you would prefer to skip this patch, instead run "git rebase --skip". To restore the original branch and stop rebasing run "git rebase --abort". rebase refs/remotes/origin/master: command returned error: 1 Died at Tools/Scripts/update-webkit line 164. If any of these errors are false positives, please file a bug against check-webkit-style.
Comment on attachment 126954 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=126954&action=review > Source/WebCore/websockets/WebSocketExtensionDispatcher.cpp:268 > + return m_acceptedExtensionsBuilder.toAtomicString().string(); Why toAtomicString().string() instead of toString()?
(In reply to comment #13) > (From update of attachment 126954 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=126954&action=review > > > Source/WebCore/websockets/WebSocketExtensionDispatcher.cpp:268 > > + return m_acceptedExtensionsBuilder.toAtomicString().string(); > > Why toAtomicString().string() instead of toString()? StringBuilder::toString() isn't a const member function so I can't call it in acceptedExtensions(), which is a const member function. Looks like win EWS is red and I can't call toAtomicString() here so I'll make m_acceptedExtensionsBuilder mutable.
Comment on attachment 126954 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=126954&action=review >>> Source/WebCore/websockets/WebSocketExtensionDispatcher.cpp:268 >>> + return m_acceptedExtensionsBuilder.toAtomicString().string(); >> >> Why toAtomicString().string() instead of toString()? > > StringBuilder::toString() isn't a const member function so I can't call it in acceptedExtensions(), which is a const member function. Looks like win EWS is red and I can't call toAtomicString() here so I'll make m_acceptedExtensionsBuilder mutable. Ah, I see. StringBuilder::toString() is not const. How about StringBuilder::toStringPreserveCapacity()?
Created attachment 127081 [details] Patch
Comment on attachment 126954 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=126954&action=review >>>> Source/WebCore/websockets/WebSocketExtensionDispatcher.cpp:268 >>>> + return m_acceptedExtensionsBuilder.toAtomicString().string(); >>> >>> Why toAtomicString().string() instead of toString()? >> >> StringBuilder::toString() isn't a const member function so I can't call it in acceptedExtensions(), which is a const member function. Looks like win EWS is red and I can't call toAtomicString() here so I'll make m_acceptedExtensionsBuilder mutable. > > Ah, I see. StringBuilder::toString() is not const. > How about StringBuilder::toStringPreserveCapacity()? It works. Thank you!
Comment on attachment 127081 [details] Patch ok
Comment on attachment 127081 [details] Patch Thanks!
Comment on attachment 127081 [details] Patch Clearing flags on attachment: 127081 Committed r107769: <http://trac.webkit.org/changeset/107769>
All reviewed patches have been landed. Closing bug.