WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
158539
Modernize WebSocket code
https://bugs.webkit.org/show_bug.cgi?id=158539
Summary
Modernize WebSocket code
Alex Christensen
Reported
2016-06-08 13:52:14 PDT
Modernize WebSocket code
Attachments
Patch
(35.96 KB, patch)
2016-06-08 14:04 PDT
,
Alex Christensen
no flags
Details
Formatted Diff
Diff
Patch
(35.97 KB, patch)
2016-06-08 14:31 PDT
,
Alex Christensen
no flags
Details
Formatted Diff
Diff
Patch
(37.14 KB, patch)
2016-06-08 15:03 PDT
,
Alex Christensen
beidson
: review+
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Alex Christensen
Comment 1
2016-06-08 14:04:38 PDT
Created
attachment 280835
[details]
Patch
Alex Christensen
Comment 2
2016-06-08 14:05:56 PDT
Comment on
attachment 280835
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=280835&action=review
> Source/WebCore/ChangeLog:8 > + No new tests (OOPS!).
I'll put "no change in behavior" here
WebKit Commit Bot
Comment 3
2016-06-08 14:06:17 PDT
Attachment 280835
[details]
did not pass style-queue: ERROR: Source/WebCore/ChangeLog:8: You should remove the 'No new tests' and either add and list tests, or explain why no new tests were possible. [changelog/nonewtests] [5] Total errors found: 1 in 10 files If any of these errors are false positives, please file a bug against check-webkit-style.
Alex Christensen
Comment 4
2016-06-08 14:31:11 PDT
Created
attachment 280840
[details]
Patch
Brady Eidson
Comment 5
2016-06-08 14:58:45 PDT
Comment on
attachment 280840
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=280840&action=review
> Source/WebCore/Modules/websockets/WorkerThreadableWebSocketChannel.cpp:175 > - RefPtr<ThreadableWebSocketChannelClientWrapper> workerClientWrapper = m_workerClientWrapper; > + RefPtr<ThreadableWebSocketChannelClientWrapper> workerClientWrapper = m_workerClientWrapper.copyRef(); > m_loaderProxy.postTaskForModeToWorkerGlobalScope([workerClientWrapper = WTFMove(workerClientWrapper), sendRequestResult] (ScriptExecutionContext&) {
This can be written as 1 line. m_loaderProxy.postTaskForModeToWorkerGlobalScope([workerClientWrapper = Ref<ThreadableWebSocketChannelClientWrapper>(*m_workerClientWrapper), sendRequestResult] (ScriptExecutionContext&) mutable { All the other ones like it, too!
Brady Eidson
Comment 6
2016-06-08 14:59:34 PDT
(In reply to
comment #5
)
> Comment on
attachment 280840
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=280840&action=review
> > > Source/WebCore/Modules/websockets/WorkerThreadableWebSocketChannel.cpp:175 > > - RefPtr<ThreadableWebSocketChannelClientWrapper> workerClientWrapper = m_workerClientWrapper; > > + RefPtr<ThreadableWebSocketChannelClientWrapper> workerClientWrapper = m_workerClientWrapper.copyRef(); > > m_loaderProxy.postTaskForModeToWorkerGlobalScope([workerClientWrapper = WTFMove(workerClientWrapper), sendRequestResult] (ScriptExecutionContext&) { > > This can be written as 1 line. > > m_loaderProxy.postTaskForModeToWorkerGlobalScope([workerClientWrapper = > Ref<ThreadableWebSocketChannelClientWrapper>(*m_workerClientWrapper), > sendRequestResult] (ScriptExecutionContext&) mutable { > > All the other ones like it, too!
Also, there should be no space between the capture list and the open paren: m_loaderProxy.postTaskForModeToWorkerGlobalScope([workerClientWrapper =
> Ref<ThreadableWebSocketChannelClientWrapper>(*m_workerClientWrapper), > sendRequestResult](ScriptExecutionContext&) mutable {
Alex Christensen
Comment 7
2016-06-08 15:03:42 PDT
Created
attachment 280845
[details]
Patch
Brady Eidson
Comment 8
2016-06-08 15:12:19 PDT
Comment on
attachment 280845
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=280845&action=review
> Source/WebCore/Modules/websockets/WorkerThreadableWebSocketChannel.cpp:355 > + auto peer = std::make_unique<Peer>(clientWrapper.copyRef(), loaderProxy, context, taskMode); > + bool sent = loaderProxy.postTaskForModeToWorkerGlobalScope({ > ScriptExecutionContext::Task::CleanupTask, > - [clientWrapper, loaderProxy, peer = WTFMove(peer)] (ScriptExecutionContext& context) mutable { > + [clientWrapper = clientWrapper.copyRef(), &loaderProxy, peer = WTFMove(peer)] (ScriptExecutionContext& context) mutable {
You could move the peer creation into the capture list.
Alex Christensen
Comment 9
2016-06-08 15:26:36 PDT
http://trac.webkit.org/changeset/201837
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