Bug 133375

Summary: Replace uses of CrossThreadTask in DefaultSharedWorkerRepository, WorkerMessagingProxy with C++11 lambdas
Product: WebKit Reporter: Zan Dobersek <zan>
Component: New BugsAssignee: Zan Dobersek <zan>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch darin: review+

Description Zan Dobersek 2014-05-29 04:21:10 PDT
Replaces uses of CrossThreadTask with C++11 lambdas
Comment 1 Zan Dobersek 2014-05-29 04:25:21 PDT
Created attachment 232241 [details]
Patch
Comment 2 WebKit Commit Bot 2014-05-29 04:28:34 PDT
Attachment 232241 [details] did not pass style-queue:


ERROR: Source/WebCore/workers/DefaultSharedWorkerRepository.cpp:186:  Multi line control clauses should use braces.  [whitespace/braces] [4]
Total errors found: 1 in 3 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Darin Adler 2014-05-31 15:35:11 PDT
Comment on attachment 232241 [details]
Patch

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

Looks good. I’d like to eliminate the context argument to the function at some point. I don’t think it adds much over a function with no arguments.

> Source/WebCore/workers/DefaultSharedWorkerRepository.cpp:188
> +            context->reportException(errorMessageCopy, lineNumber, columnNumber, sourceURLCopy);

Need to add a nullptr to this line, after sourceURLCopy.

> Source/WebCore/workers/WorkerMessagingProxy.cpp:170
> +        if (this->askedToTerminate())

No need for "this->" here.

> Source/WebCore/workers/WorkerMessagingProxy.cpp:238
> +        toWorkerGlobalScope(context)->workerInspectorController().disconnectFrontend(Inspector::InspectorDisconnectReason::InspectorDestroyed);

Could we just capture a worker global scope here instead of casting the context?
Comment 4 Zan Dobersek 2014-06-05 02:12:32 PDT
Comment on attachment 232241 [details]
Patch

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

>> Source/WebCore/workers/WorkerMessagingProxy.cpp:170
>> +        if (this->askedToTerminate())
> 
> No need for "this->" here.

Right, and it can be removed in some other places as well.

>> Source/WebCore/workers/WorkerMessagingProxy.cpp:238
>> +        toWorkerGlobalScope(context)->workerInspectorController().disconnectFrontend(Inspector::InspectorDisconnectReason::InspectorDestroyed);
> 
> Could we just capture a worker global scope here instead of casting the context?

Where from? This task is posted in WorkerMessagingProxy::disconnectFromInspector(), and there's no WorkerGlobalScope available there for capturing.
Comment 5 Zan Dobersek 2014-06-05 02:13:28 PDT
Created attachment 232531 [details]
Patch
Comment 6 WebKit Commit Bot 2014-06-05 02:14:19 PDT
Attachment 232531 [details] did not pass style-queue:


ERROR: Source/WebCore/workers/DefaultSharedWorkerRepository.cpp:187:  Multi line control clauses should use braces.  [whitespace/braces] [4]
Total errors found: 1 in 3 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 7 Zan Dobersek 2014-06-07 06:07:26 PDT
Committed r169673: <http://trac.webkit.org/changeset/169673>