| Summary: | [Cocoa] Ensure that the WebKit bundle version in the user agent string continues to match the current format | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Mark Rowe (bdash) <mrowe> | ||||||
| Component: | New Bugs | Assignee: | Mark Rowe (bdash) <mrowe> | ||||||
| Status: | RESOLVED FIXED | ||||||||
| Severity: | Normal | ||||||||
| Priority: | P2 | ||||||||
| Version: | 528+ (Nightly build) | ||||||||
| Hardware: | Unspecified | ||||||||
| OS: | Unspecified | ||||||||
| Bug Depends on: | 134521, 134522 | ||||||||
| Bug Blocks: | |||||||||
| Attachments: |
|
||||||||
|
Description
Mark Rowe (bdash)
2014-07-01 16:48:19 PDT
Created attachment 234217 [details]
Patch
Created attachment 234271 [details]
Patch
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++? (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. Landed in r170735. <https://trac.webkit.org/r170735> |