Bug 133541
| Summary: | ScriptExecutionContext::Task lambdas shouldn't have to specify unused ScriptExecutionContext* parameters | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Zan Dobersek <zan> |
| Component: | WebCore Misc. | Assignee: | Zan Dobersek <zan> |
| Status: | RESOLVED DUPLICATE | ||
| Severity: | Normal | CC: | darin |
| Priority: | P2 | ||
| Version: | 528+ (Nightly build) | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Zan Dobersek
Some ScriptExecutionContext::Task lambdas don't use the ScriptExecutionContext pointer that's passed into the function.
This would look better:
context->postTask([=] {
doWhatever(stringCopy);
});
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Darin Adler
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.
Darin Adler
(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.
Zan Dobersek
*** This bug has been marked as a duplicate of bug 148427 ***