[Webkit-unassigned] [Bug 75586] New: WebFrameLoaderClient::userAgent does unnecessary NSString/NSURL conversions

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jan 4 15:57:04 PST 2012


https://bugs.webkit.org/show_bug.cgi?id=75586

           Summary: WebFrameLoaderClient::userAgent does unnecessary
                    NSString/NSURL conversions
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Unspecified
        OS/Version: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: WebKit Misc.
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: psolanki at apple.com
                CC: koivisto at iki.fi


WebFrameLoaderClient::userAgent calls -(NSString *)userAgentForURL:(NSURL *)url on WebView to get the user agent string. This results in

- converting KURL to NSURL* before passing to userAgentForURL (note that the function does't use the argument at all!)
- Since userAgentForURL returns an NSString* but stores the user agent internally as WTF::String, it converts the String to NSString* before returning
- WebFrameLoaderClient::userAgent converts that NSString back into a WTF::String when returning

We can optimize this by having a separate code path that takes a KURL and returns String.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list