Bug 179515

Summary: REGRESSION(r224267): WebViews scheduled with custom run loop modes don't load
Product: WebKit Reporter: Alex Christensen <achristensen>
Component: New BugsAssignee: Alex Christensen <achristensen>
Status: RESOLVED FIXED    
Severity: Normal CC: aestes, benjamin, buildbot, cdumez, cmarcelo, dbates, ggaren, koivisto, thorton, webkit-bug-importer
Priority: P2 Keywords: InRadar, Regression
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch aestes: review+

Description Alex Christensen 2017-11-09 17:05:22 PST
REGRESSION(r224267): WebViews scheduled with custom run loop modes don't load
Comment 1 Alex Christensen 2017-11-09 17:56:36 PST
Created attachment 326521 [details]
Patch
Comment 2 Build Bot 2017-11-09 17:58:43 PST
Attachment 326521 [details] did not pass style-queue:


ERROR: Source/WTF/wtf/NeverDestroyed.h:26:  Use #pragma once instead of #ifndef for header guard.  [build/header_guard] [5]
Total errors found: 1 in 15 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Tim Horton 2017-11-09 18:24:53 PST
Comment on attachment 326521 [details]
Patch

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

> Source/WTF/ChangeLog:15
> +        Unfortunately we need to go back to #ifdef guards because different copies of this header are included while building WTF.

Wat

> Source/WTF/wtf/mac/MainThreadMac.mm:125
> +static RetainPtr<NSArray<NSString *>> nsArrayFromVector(const Vector<String>& strings)

The name of this function should be way more clear that it does crazy things.
Comment 4 Alex Christensen 2017-11-09 19:00:03 PST
Created attachment 326531 [details]
Patch
Comment 5 Geoffrey Garen 2017-11-09 20:11:06 PST
Comment on attachment 326531 [details]
Patch

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

> Source/WebCore/platform/network/mac/ResourceHandleMac.mm:277
> +    RetainPtr<NSArray<NSString *>> runLoopModes;
> +    if (auto* scheduledPairs = d->m_context->scheduledRunLoopPairs()) {
> +        runLoopModes = adoptNS([[NSMutableArray alloc] initWithCapacity:scheduledPairs->size()]);
> +        for (auto& pair : *scheduledPairs)
> +            [runLoopModes addObject:(NSString *)pair->mode()];
> +    }

Can we just pass though the SchedulePairHashSet instead of copying into an NSArray *?

Reasons to prefer:

(1) A full fix for this bug requires honoring not just the run loop mode but also the run loop, which need not be the main run loop.

(2) It's nice to pass C++ types to C++ code -- and faster too.
Comment 6 Alex Christensen 2017-11-09 20:56:52 PST
Created attachment 326547 [details]
Patch
Comment 7 Alex Christensen 2017-11-09 21:23:23 PST
Created attachment 326550 [details]
Patch
Comment 8 Alex Christensen 2017-11-10 09:31:15 PST
http://trac.webkit.org/r224687
Comment 9 Radar WebKit Bug Importer 2017-11-15 09:37:36 PST
<rdar://problem/35562089>