Changeset 192459 in webkit
- Timestamp:
- Nov 14, 2015 11:56:55 PM (8 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r192458 r192459 1 2015-11-14 Gyuyoung Kim <gyuyoung.kim@webkit.org> 2 3 [EFL][GTK] Remove use of String::format() in versionForUAString() 4 https://bugs.webkit.org/show_bug.cgi?id=151250 5 6 Reviewed by Darin Adler. 7 8 As String::format() will be deprecated due to the security problem, reimplement 9 versionForUAString() using a macro. 10 11 * platform/efl/UserAgentEfl.cpp: 12 (WebCore::versionForUAString): 13 * platform/gtk/UserAgentGtk.cpp: 14 (WebCore::platformVersionForUAString): 15 (WebCore::versionForUAString): 16 1 17 2015-11-14 Antti Koivisto <antti@apple.com> 2 18 -
trunk/Source/WebCore/platform/efl/UserAgentEfl.cpp
r192288 r192459 56 56 } 57 57 58 static const String&versionForUAString()58 static const char* versionForUAString() 59 59 { 60 static NeverDestroyed<String> version(String::format("%i.%i", WEBKIT_MAJOR_VERSION, WEBKIT_MINOR_VERSION)); 61 return version; 60 #define MAKE_VERSION(major, minor) #major "." #minor 61 return MAKE_VERSION(WEBKIT_MAJOR_VERSION, WEBKIT_MINOR_VERSION); 62 #undef MAKE_VERSION 62 63 } 63 64 64 65 String standardUserAgent(const String& applicationName, const String& applicationVersion) 65 66 { 66 const String& version = versionForUAString();67 const String& version = ASCIILiteral(versionForUAString()); 67 68 static NeverDestroyed<String> standardUserAgentString = makeString("Mozilla/5.0 (", platformForUAString(), "; ", platformVersionForUAString(), 68 69 ") AppleWebKit/", version, " (KHTML, like Gecko) Version/8.0 Safari/601.2.7"); … … 73 74 String finalApplicationVersion = applicationVersion; 74 75 if (finalApplicationVersion.isEmpty()) 75 finalApplicationVersion = versionForUAString();76 finalApplicationVersion = ASCIILiteral(versionForUAString()); 76 77 77 78 return standardUserAgentString + ' ' + applicationName + '/' + finalApplicationVersion; -
trunk/Source/WebCore/platform/gtk/UserAgentGtk.cpp
r169892 r192459 112 112 } 113 113 114 static const StringversionForUAString()114 static const char* versionForUAString() 115 115 { 116 static NeverDestroyed<const String> uaVersion(String::format("%i.%i", USER_AGENT_GTK_MAJOR_VERSION, USER_AGENT_GTK_MINOR_VERSION)); 117 return uaVersion; 116 #define MAKE_VERSION(major, minor) #major "." #minor 117 return MAKE_VERSION(USER_AGENT_GTK_MAJOR_VERSION, USER_AGENT_GTK_MINOR_VERSION); 118 #undef MAKE_VERSION 118 119 } 119 120
Note: See TracChangeset
for help on using the changeset viewer.