Changeset 286368 in webkit


Ignore:
Timestamp:
Dec 1, 2021, 9:50:30 AM (4 years ago)
Author:
timothy_horton@apple.com
Message:

REGRESSION (r286346): ResourceLoadDelegate.LoadInfo fails
https://bugs.webkit.org/show_bug.cgi?id=233689

Reviewed by Simon Fraser.

  • TestWebKitAPI/Tests/WebKitCocoa/ResourceLoadDelegate.mm:

This test asserts that archiving a _WKResourceLoadInfo via NSKeyedArchiver
encodes to a particular size (607 bytes).

If you look at the resultant plist before r286346, the encoded frameID
and resourceLoadID have the same value, and because of NSKeyedArchiver
deduplication, share the same object.

If you look at the resultant plist *after* r286346, the encoded frameID
is one larger than the resourceLoadID, thus cannot be deduplicated, and
end up encoding as separate objects. This results in the encoded size
increasing to 612 bytes.

The reason that the encoded frameID is now one value larger is that
ObjectIdentifier uses a global identifier pool, and r286346 creates
one more ObjectIdentifier during EventHandler construction, destroying
our entirely coincidental ID overlap, and causing the aforementioned
encoded size change.

Remove this assertion from the test, since it is very aggressive and
seems unnecessary. We could instead just rebaseline the test, but it
seems insufficiently important to burden some future developer with
a repeat of this evening of exploration and discovery.

Location:
trunk/Tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r286355 r286368  
     12021-12-01  Tim Horton  <timothy_horton@apple.com>
     2
     3        REGRESSION (r286346): ResourceLoadDelegate.LoadInfo fails
     4        https://bugs.webkit.org/show_bug.cgi?id=233689
     5
     6        Reviewed by Simon Fraser.
     7
     8        * TestWebKitAPI/Tests/WebKitCocoa/ResourceLoadDelegate.mm:
     9        This test asserts that archiving a _WKResourceLoadInfo via NSKeyedArchiver
     10        encodes to a particular size (607 bytes).
     11
     12        If you look at the resultant plist before r286346, the encoded frameID
     13        and resourceLoadID have the same value, and because of NSKeyedArchiver
     14        deduplication, share the same object.
     15
     16        If you look at the resultant plist *after* r286346, the encoded frameID
     17        is one larger than the resourceLoadID, thus cannot be deduplicated, and
     18        end up encoding as separate objects. This results in the encoded size
     19        increasing to 612 bytes.
     20
     21        The reason that the encoded frameID is now one value larger is that
     22        ObjectIdentifier uses a global identifier pool, and r286346 creates
     23        one more ObjectIdentifier during EventHandler construction, destroying
     24        our entirely coincidental ID overlap, and causing the aforementioned
     25        encoded size change.
     26
     27        Remove this assertion from the test, since it is very aggressive and
     28        seems unnecessary. We could instead just rebaseline the test, but it
     29        seems insufficiently important to burden some future developer with
     30        a repeat of this evening of exploration and discovery.
     31
    1322021-12-01  Brady Eidson  <beidson@apple.com>
    233
  • trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ResourceLoadDelegate.mm

    r283714 r286368  
    380380    NSError *error = nil;
    381381    NSData *archiveData = [NSKeyedArchiver archivedDataWithRootObject:original requiringSecureCoding:YES error:&error];
    382     EXPECT_EQ(archiveData.length, 607ull);
    383382    EXPECT_FALSE(error);
    384383    _WKResourceLoadInfo *deserialized = [NSKeyedUnarchiver unarchivedObjectOfClass:[_WKResourceLoadInfo class] fromData:archiveData error:&error];
Note: See TracChangeset for help on using the changeset viewer.