WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
134524
[Cocoa] Ensure that the WebKit bundle version in the user agent string continues to match the current format
https://bugs.webkit.org/show_bug.cgi?id=134524
Summary
[Cocoa] Ensure that the WebKit bundle version in the user agent string contin...
Mark Rowe (bdash)
Reported
2014-07-01 16:48:19 PDT
The WebKit version portion of the user agent string has historically had at most three components. There's no guarantee that the WebKit framework's bundle version will be limited in this fashion. We should ensure that the version inserted in to the user agent string continues to match the historical format. <
rdar://problem/17447771
>
Attachments
Patch
(5.75 KB, patch)
2014-07-01 16:50 PDT
,
Mark Rowe (bdash)
no flags
Details
Formatted Diff
Diff
Patch
(5.53 KB, patch)
2014-07-02 11:37 PDT
,
Mark Rowe (bdash)
simon.fraser
: review+
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Mark Rowe (bdash)
Comment 1
2014-07-01 16:50:48 PDT
Created
attachment 234217
[details]
Patch
Mark Rowe (bdash)
Comment 2
2014-07-02 11:37:12 PDT
Created
attachment 234271
[details]
Patch
Simon Fraser (smfr)
Comment 3
2014-07-02 14:53:13 PDT
Comment on
attachment 234271
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=234271&action=review
> Source/WebCore/page/cocoa/UserAgent.mm:69 > + // We include at most three components of the bundle version in the user agent string. > + NSString *bundleVersion = userVisibleWebKitBundleVersionFromFullVersion(fullWebKitVersion); > + NSScanner *scanner = [NSScanner scannerWithString:bundleVersion]; > + NSInteger periodCount = 0; > + while (true) { > + if (![scanner scanUpToString:@"." intoString:nullptr] || scanner.isAtEnd) > + return bundleVersion; > + > + if (++periodCount == 3) > + return [bundleVersion substringToIndex:scanner.scanLocation]; > + > + ++scanner.scanLocation; > + } > + > + ASSERT_NOT_REACHED();
Can we do this in C++?
Mark Rowe (bdash)
Comment 4
2014-07-02 14:57:28 PDT
(In reply to
comment #3
)
> (From update of
attachment 234271
[details]
) > Can we do this in C++?
It seemed preferable for the code to match our other internal implementation rather than writing it twice.
Mark Rowe (bdash)
Comment 5
2014-07-02 16:04:29 PDT
Landed in
r170735
. <
https://trac.webkit.org/r170735
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug