Bug 158292

Summary: Modernize various lambda captures
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: WebCore Misc.Assignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: beidson, commit-queue, darin
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch none

Description Chris Dumez 2016-06-01 21:26:16 PDT
Modernize various lambda captures, especially the ones unnecessarily allocating objects on the heap and destroying them in the lambda.
Comment 1 Chris Dumez 2016-06-01 22:09:11 PDT
Created attachment 280308 [details]
Patch
Comment 2 WebKit Commit Bot 2016-06-01 22:11:12 PDT
Attachment 280308 [details] did not pass style-queue:


ERROR: Source/WebKit2/NetworkProcess/cache/NetworkCache.cpp:523:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/NetworkProcess/cache/NetworkCache.h:116:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/NetworkProcess/NetworkProcess.cpp:311:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/NetworkProcess/NetworkProcess.cpp:415:  Extra space before ( in function call  [whitespace/parens] [4]
Total errors found: 4 in 11 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Brady Eidson 2016-06-01 22:58:06 PDT
Comment on attachment 280308 [details]
Patch

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

Reviewing this urged me to file https://bugs.webkit.org/show_bug.cgi?id=158293

r+ as long as cleaning up the build errors doesn't substantially change the patch.

> Source/WebCore/Modules/websockets/ThreadableWebSocketChannelClientWrapper.cpp:-173
> -    String messageCopy = message.isolatedCopy();
> -    m_pendingTasks.append(std::make_unique<ScriptExecutionContext::Task>([this, message] (ScriptExecutionContext&) {

AGGGGH! This one was straight up wrong!!! :(
Comment 4 Chris Dumez 2016-06-02 08:53:01 PDT
Created attachment 280333 [details]
Patch
Comment 5 WebKit Commit Bot 2016-06-02 08:54:24 PDT
Attachment 280333 [details] did not pass style-queue:


ERROR: Source/WebKit2/NetworkProcess/cache/NetworkCache.cpp:523:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/NetworkProcess/cache/NetworkCache.h:116:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/NetworkProcess/NetworkProcess.cpp:311:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/NetworkProcess/NetworkProcess.cpp:415:  Extra space before ( in function call  [whitespace/parens] [4]
Total errors found: 4 in 11 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 6 Chris Dumez 2016-06-02 09:14:07 PDT
Hmm.

  "WTF::RefPtr<WebKit::NetworkProcess::fetchWebsiteData(WebCore::SessionID, WTF::OptionSet<WebKit::WebsiteDataType>, WTF::OptionSet<WebKit::WebsiteDataFetchOption>, unsigned long long)::CallbackAggregator>::RefPtr(WTF::RefPtr<WebKit::NetworkProcess::fetchWebsiteData(WebCore::SessionID, WTF::OptionSet<WebKit::WebsiteDataType>, WTF::OptionSet<WebKit::WebsiteDataFetchOption>, unsigned long long)::CallbackAggregator> const&)", referenced from:
      WebKit::NetworkProcess::fetchWebsiteData(WebCore::SessionID, WTF::OptionSet<WebKit::WebsiteDataType>, WTF::OptionSet<WebKit::WebsiteDataFetchOption>, unsigned long long) in NetworkProcess.o
ld: symbol(s) not found for architecture x86_64

But I did not modify fetchWebsiteData() or any of its call sites. Weird.
Comment 7 Chris Dumez 2016-06-02 09:45:55 PDT
Created attachment 280335 [details]
Patch
Comment 8 WebKit Commit Bot 2016-06-02 09:58:26 PDT
Attachment 280335 [details] did not pass style-queue:


ERROR: Source/WebKit2/NetworkProcess/cache/NetworkCache.cpp:524:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/NetworkProcess/cache/NetworkCache.h:117:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/NetworkProcess/NetworkProcess.cpp:311:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/NetworkProcess/NetworkProcess.cpp:415:  Extra space before ( in function call  [whitespace/parens] [4]
Total errors found: 4 in 12 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 9 Chris Dumez 2016-06-02 10:04:03 PDT
Created attachment 280336 [details]
Patch
Comment 10 WebKit Commit Bot 2016-06-02 10:05:04 PDT
Attachment 280336 [details] did not pass style-queue:


ERROR: Source/WebKit2/NetworkProcess/cache/NetworkCache.cpp:524:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/NetworkProcess/cache/NetworkCache.h:117:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/NetworkProcess/NetworkProcess.cpp:311:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/NetworkProcess/NetworkProcess.cpp:355:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/NetworkProcess/NetworkProcess.cpp:369:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/NetworkProcess/NetworkProcess.cpp:415:  Extra space before ( in function call  [whitespace/parens] [4]
Total errors found: 6 in 12 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 11 Chris Dumez 2016-06-02 10:58:36 PDT
Comment on attachment 280336 [details]
Patch

Clearing flags on attachment: 280336

Committed r201602: <http://trac.webkit.org/changeset/201602>
Comment 12 Chris Dumez 2016-06-02 10:58:43 PDT
All reviewed patches have been landed.  Closing bug.