Bug 178681 - Remove scopeguard from platform
Summary: Remove scopeguard from platform
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-10-23 14:18 PDT by Christopher Reid
Modified: 2017-11-15 13:03 PST (History)
15 users (show)

See Also:


Attachments
Patch (17.60 KB, patch)
2017-10-23 16:01 PDT, Christopher Reid
no flags Details | Formatted Diff | Diff
Patch (17.61 KB, patch)
2017-10-23 16:13 PDT, Christopher Reid
no flags Details | Formatted Diff | Diff
Patch (17.39 KB, patch)
2017-10-23 16:41 PDT, Christopher Reid
no flags Details | Formatted Diff | Diff
patch (17.31 KB, patch)
2017-10-24 17:12 PDT, Christopher Reid
no flags Details | Formatted Diff | Diff
Patch (11.59 KB, patch)
2017-10-24 17:21 PDT, Christopher Reid
no flags Details | Formatted Diff | Diff
Patch (17.45 KB, patch)
2017-10-24 17:21 PDT, Christopher Reid
no flags Details | Formatted Diff | Diff
Patch (17.75 KB, patch)
2017-10-25 18:07 PDT, Christopher Reid
no flags Details | Formatted Diff | Diff
Patch (17.83 KB, patch)
2017-10-25 18:15 PDT, Christopher Reid
no flags Details | Formatted Diff | Diff
Patch (18.17 KB, patch)
2017-10-25 18:38 PDT, Christopher Reid
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Christopher Reid 2017-10-23 14:18:58 PDT
FileSystem uses scopeguard so filesystem can't be moved into PAL while scopeguard is in WebCore.
Comment 1 Christopher Reid 2017-10-23 16:01:27 PDT
Created attachment 324604 [details]
Patch
Comment 2 Build Bot 2017-10-23 16:05:10 PDT
Attachment 324604 [details] did not pass style-queue:


ERROR: Source/WebCore/Modules/indexeddb/IDBRequest.h:40:  Code inside a namespace should not be indented.  [whitespace/indent] [4]
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]
ERROR: Tools/TestWebKitAPI/Tests/WebCore/FileMonitor.cpp:31:  Alphabetical sorting problem.  [build/include_order] [4]
Total errors found: 3 in 15 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Christopher Reid 2017-10-23 16:13:04 PDT
Created attachment 324606 [details]
Patch

Fixing style issues
Comment 4 Christopher Reid 2017-10-23 16:41:29 PDT
Created attachment 324610 [details]
Patch

Patch - Fixing a poorly merged line
Comment 5 Brady Eidson 2017-10-23 22:44:54 PDT
I'm surprised so few places use this.

Regardless, there's nothing "Platform" about this class - It belongs in WTF
Comment 6 Sam Weinig 2017-10-24 05:37:49 PDT
WTF already has ScopeExit, which looks similar. Maybe we can just remove ScopeGuard.
Comment 7 Christopher Reid 2017-10-24 17:12:05 PDT
Created attachment 324764 [details]
patch

Here's a patch replacing Webcore::ScopeGuard with WTF::ScopeExit
Comment 8 Build Bot 2017-10-24 17:14:08 PDT
Attachment 324764 [details] did not pass style-queue:


ERROR: Source/WebCore/workers/service/ServiceWorkerContainer.cpp:45:  Alphabetical sorting problem.  [build/include_order] [4]
ERROR: Source/WebKit/Shared/mac/ChildProcessMac.mm:39:  Alphabetical sorting problem.  [build/include_order] [4]
ERROR: Source/WebCore/platform/FileSystem.cpp:31:  Alphabetical sorting problem.  [build/include_order] [4]
ERROR: Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp:48:  Alphabetical sorting problem.  [build/include_order] [4]
ERROR: Source/WebCore/platform/network/BlobRegistryImpl.cpp:44:  Alphabetical sorting problem.  [build/include_order] [4]
ERROR: Tools/TestWebKitAPI/Tests/WebCore/FileMonitor.cpp:31:  Alphabetical sorting problem.  [build/include_order] [4]
Total errors found: 6 in 11 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 9 Christopher Reid 2017-10-24 17:21:07 PDT
Created attachment 324765 [details]
Patch

Fixing style issues for scopeguard removal patch
Comment 10 Christopher Reid 2017-10-24 17:21:56 PDT
Created attachment 324766 [details]
Patch

Accidentally uploaded an older patch
Comment 11 Alex Christensen 2017-10-25 15:27:34 PDT
Comment on attachment 324766 [details]
Patch

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

> Source/WebCore/Modules/indexeddb/IDBRequest.h:174
> +    std::unique_ptr<WTF::ScopeExit<std::function<void()>>> m_cursorRequestNotifier;

Is there a reason this needs to be std::function?  We're trying to use WTF::Function instead because it's non-copyable.
Comment 12 Christopher Reid 2017-10-25 15:47:14 PDT
(In reply to Alex Christensen from comment #11)
> Comment on attachment 324766 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=324766&action=review
> 
> > Source/WebCore/Modules/indexeddb/IDBRequest.h:174
> > +    std::unique_ptr<WTF::ScopeExit<std::function<void()>>> m_cursorRequestNotifier;
> 
> Is there a reason this needs to be std::function?  We're trying to use
> WTF::Function instead because it's non-copyable.

For some reason I thought ScopeGuard was using std::function, but I was mistaken. I'll change it to WTF::Function.
Comment 13 Christopher Reid 2017-10-25 18:07:44 PDT
Created attachment 324932 [details]
Patch

Using WTF::Function instead of std::function
Comment 14 Build Bot 2017-10-25 18:10:34 PDT
Attachment 324932 [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 12 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 15 Christopher Reid 2017-10-25 18:15:23 PDT
Created attachment 324934 [details]
Patch

Using WTF::Function instead of std::function - Fixing style issue
Comment 16 Christopher Reid 2017-10-25 18:38:55 PDT
Created attachment 324938 [details]
Patch

Using WTF::Function instead of std::function -- Missed a new scope guard that was added today :(
Comment 17 Brady Eidson 2017-10-25 20:20:57 PDT
Comment on attachment 324938 [details]
Patch

LGTM once EWS is all green.
Comment 18 WebKit Commit Bot 2017-10-26 07:06:30 PDT
Comment on attachment 324938 [details]
Patch

Clearing flags on attachment: 324938

Committed r224018: <https://trac.webkit.org/changeset/224018>
Comment 19 WebKit Commit Bot 2017-10-26 07:06:32 PDT
All reviewed patches have been landed.  Closing bug.
Comment 20 Radar WebKit Bug Importer 2017-11-15 13:03:03 PST
<rdar://problem/35568687>