Bug 133541 - ScriptExecutionContext::Task lambdas shouldn't have to specify unused ScriptExecutionContext* parameters
Summary: ScriptExecutionContext::Task lambdas shouldn't have to specify unused ScriptE...
Status: RESOLVED DUPLICATE of bug 148427
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Zan Dobersek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-05 02:49 PDT by Zan Dobersek
Modified: 2015-09-01 23:19 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Zan Dobersek 2014-06-05 02:49:22 PDT
Some ScriptExecutionContext::Task lambdas don't use the ScriptExecutionContext pointer that's passed into the function.
This would look better:

    context->postTask([=] {
        doWhatever(stringCopy);
    });
Comment 1 Darin Adler 2014-06-05 09:59:55 PDT
Further:

1) Even some of the lambdas that use the ScriptExecutionContext* parameter need to downcast to Document*, and I think it would be better to capture a variable of the correct type rather than casting.

2) It should be ScriptExecutionContext&, since it can’t ever be null.
Comment 2 Darin Adler 2014-06-05 10:00:29 PDT
(In reply to comment #1)
> 2) It should be ScriptExecutionContext&, since it can’t ever be null.

Ah, I see that you filed bug 133542 about that.
Comment 3 Zan Dobersek 2015-09-01 23:19:08 PDT

*** This bug has been marked as a duplicate of bug 148427 ***