Summary: | Need a way to retrieve custom user agent from a WKPage | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Brian Weinstein <bweinstein> | ||||||
Component: | WebKit2 | Assignee: | Brian Weinstein <bweinstein> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | andersca, sam | ||||||
Priority: | P2 | ||||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | All | ||||||||
OS: | All | ||||||||
Attachments: |
|
Description
Brian Weinstein
2010-10-26 12:00:46 PDT
Created attachment 71924 [details]
[PATCH] Fix
Comment on attachment 71924 [details] [PATCH] Fix View in context: https://bugs.webkit.org/attachment.cgi?id=71924&action=review > WebKit2/UIProcess/API/C/WKPage.cpp:158 > +WKStringRef WKPageGetCustomUserAgent(WKPageRef pageRef) > +{ > + return toCopiedAPI(toImpl(pageRef)->customUserAgent()); > +} If you are using toCopiedAPI then this function needs Copy in its name. (In reply to comment #2) > (From update of attachment 71924 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=71924&action=review > > > WebKit2/UIProcess/API/C/WKPage.cpp:158 > > +WKStringRef WKPageGetCustomUserAgent(WKPageRef pageRef) > > +{ > > + return toCopiedAPI(toImpl(pageRef)->customUserAgent()); > > +} > > If you are using toCopiedAPI then this function needs Copy in its name. Should this be using toCopiedAPI or just toAPI? I see functions that return a WKStringRef on WKPage that use both toCopiedAPI and toAPI. Created attachment 71929 [details]
[PATCH] Fix - rename to WKPageCopyCustomUserAgent
Comment on attachment 71929 [details] [PATCH] Fix - rename to WKPageCopyCustomUserAgent View in context: https://bugs.webkit.org/attachment.cgi?id=71929&action=review > WebKit2/UIProcess/WebPageProxy.cpp:462 > + if (m_customUserAgent == userAgent) > + return; This code distinguishes a null string from an empty string. I’m not sure that’s intentional. |