Bug 134004 - [iOS][wk2] Ensure that layers are marked volatile before allowing the process to suspend
Summary: [iOS][wk2] Ensure that layers are marked volatile before allowing the process...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Tim Horton
URL:
Keywords: InRadar
Depends on: 134189
Blocks:
  Show dependency treegraph
 
Reported: 2014-06-17 16:45 PDT by Tim Horton
Modified: 2014-06-23 14:12 PDT (History)
5 users (show)

See Also:


Attachments
patch (18.59 KB, patch)
2014-06-17 17:13 PDT, Tim Horton
simon.fraser: review+
Details | Formatted Diff | Diff
with simon's changes (18.65 KB, patch)
2014-06-17 19:23 PDT, Tim Horton
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Horton 2014-06-17 16:45:51 PDT
WebKit tries to make layers volatile when unparented, but sometimes isn't given a chance to do so before the process gets suspended, so we end up with lots of non-volatile surfaces that should really be volatile.

<rdar://problem/17186342>
Comment 1 Tim Horton 2014-06-17 17:13:20 PDT
Created attachment 233271 [details]
patch
Comment 2 Simon Fraser (smfr) 2014-06-17 18:26:11 PDT
Comment on attachment 233271 [details]
patch

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

> Source/WebKit2/Shared/mac/RemoteLayerBackingStoreCollection.h:65
> +    bool markBackingStoreVolatileImmediately(RemoteLayerBackingStore&, unsigned volatilityMarkingFlags = 0);

enum for the set of flag mask please, not unsigned.

> Source/WebKit2/Shared/mac/RemoteLayerBackingStoreCollection.mm:160
> +    for (const auto& backingStore : m_unparentedBackingStore)

Blank line above please.

> Source/WebKit2/UIProcess/ios/ProcessThrottler.mm:109
> +    // If the process is currently waiting for the WebProcess to become suspendable but would become runnable,
> +    // let it know that it can cancel the suspension cleanup.

Hard to grok
Comment 3 Tim Horton 2014-06-17 18:44:37 PDT
(In reply to comment #2)
> (From update of attachment 233271 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=233271&action=review
> 
> > Source/WebKit2/Shared/mac/RemoteLayerBackingStoreCollection.h:65
> > +    bool markBackingStoreVolatileImmediately(RemoteLayerBackingStore&, unsigned volatilityMarkingFlags = 0);
> 
> enum for the set of flag mask please, not unsigned.

To clarify, .smfr says to use a typedef of unsigned for the flag argument type.
Comment 4 Tim Horton 2014-06-17 19:23:49 PDT
Created attachment 233277 [details]
with simon's changes

This patch will now sit here for a bit while I work on the final remaining piece in another bug.
Comment 5 WebKit Commit Bot 2014-06-17 19:25:52 PDT
Attachment 233277 [details] did not pass style-queue:


ERROR: Source/WebKit2/Shared/mac/RemoteLayerBackingStoreCollection.h:66:  The parameter name "volatilityMarkingFlags" adds no information, so it should be removed.  [readability/parameter_name] [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 6 Gavin Barraclough 2014-06-17 22:27:42 PDT
LGTM
Comment 7 Tim Horton 2014-06-23 14:12:45 PDT
http://trac.webkit.org/changeset/170316