Bug 163938 - Make CachedResourceLoader originsMatch check more efficient
Summary: Make CachedResourceLoader originsMatch check more efficient
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: youenn fablet
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-25 01:05 PDT by youenn fablet
Modified: 2016-10-26 01:11 PDT (History)
5 users (show)

See Also:


Attachments
Patch (6.14 KB, patch)
2016-10-25 01:09 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Patch for landing (6.21 KB, patch)
2016-10-26 00:35 PDT, youenn fablet
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description youenn fablet 2016-10-25 01:05:53 PDT
As a follow-up of bug 163242, we could migrate the originsMatch helper routine to SecurityOrigin so as to make it more efficient.
Comment 1 youenn fablet 2016-10-25 01:09:23 PDT
Created attachment 292732 [details]
Patch
Comment 2 Darin Adler 2016-10-25 09:44:37 PDT
Comment on attachment 292732 [details]
Patch

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

> Source/WebCore/page/SecurityOrigin.cpp:488
> +    if (!origin1 || !origin2)
> +        return false;

So nullptr does not match nullptr? Probably worth documenting in the header.

> Source/WebCore/page/SecurityOrigin.h:93
> +    static bool originsMatch(const SecurityOrigin*, const SecurityOrigin*);

I think this might be nicer as a free function rather than a member function, although I like it being in this header. Also would be nice to expose two overloads so we can call it with either references or pointers.
Comment 3 youenn fablet 2016-10-26 00:35:32 PDT
Created attachment 292881 [details]
Patch for landing
Comment 4 WebKit Commit Bot 2016-10-26 01:11:01 PDT
Comment on attachment 292881 [details]
Patch for landing

Clearing flags on attachment: 292881

Committed r207871: <http://trac.webkit.org/changeset/207871>
Comment 5 WebKit Commit Bot 2016-10-26 01:11:06 PDT
All reviewed patches have been landed.  Closing bug.