Bug 163938

Summary: Make CachedResourceLoader originsMatch check more efficient
Product: WebKit Reporter: youenn fablet <youennf>
Component: WebCore Misc.Assignee: youenn fablet <youennf>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, commit-queue, darin, dbates, japhet
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch for landing none

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.