diff options
author | tommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-22 21:36:41 +0000 |
---|---|---|
committer | tommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-22 21:36:41 +0000 |
commit | a38056a858bcbcb5f3c8266247fdac2ab9703d0f (patch) | |
tree | 4a7c905f36df7893c69ac8c5218710f0804541f5 /chrome_frame | |
parent | 6913b5479f4f12fc9f883d6c8567cea73e05a43f (diff) | |
download | chromium_src-a38056a858bcbcb5f3c8266247fdac2ab9703d0f.zip chromium_src-a38056a858bcbcb5f3c8266247fdac2ab9703d0f.tar.gz chromium_src-a38056a858bcbcb5f3c8266247fdac2ab9703d0f.tar.bz2 |
Include the full version number in the user agent.
TEST=Run unit tests. This change will make the request user agent have a more detailed version number for chrome frame (chromeframe/a.b.c.d instead of chromeframe/a.b)
BUG=29258
Review URL: http://codereview.chromium.org/546117
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36898 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame')
-rw-r--r-- | chrome_frame/html_utils.cc | 10 | ||||
-rw-r--r-- | chrome_frame/test/html_util_unittests.cc | 26 |
2 files changed, 19 insertions, 17 deletions
diff --git a/chrome_frame/html_utils.cc b/chrome_frame/html_utils.cc index e964ab9..dcc1f53 100644 --- a/chrome_frame/html_utils.cc +++ b/chrome_frame/html_utils.cc @@ -294,10 +294,12 @@ const char* GetChromeFrameUserAgent() { if (!cf_user_agent[0]) { _pAtlModule->m_csStaticDataInitAndTypeInfo.Lock(); if (!cf_user_agent[0]) { - uint32 version = 0; - GetModuleVersion(reinterpret_cast<HMODULE>(&__ImageBase), &version, NULL); - wsprintfA(cf_user_agent, "%s/%i.%i", kChromeFrameUserAgent, - HIWORD(version), LOWORD(version)); + uint32 high_version = 0, low_version = 0; + GetModuleVersion(reinterpret_cast<HMODULE>(&__ImageBase), &high_version, + &low_version); + wsprintfA(cf_user_agent, "%s/%i.%i.%i.%i", kChromeFrameUserAgent, + HIWORD(high_version), LOWORD(high_version), + HIWORD(low_version), LOWORD(low_version)); } _pAtlModule->m_csStaticDataInitAndTypeInfo.Unlock(); } diff --git a/chrome_frame/test/html_util_unittests.cc b/chrome_frame/test/html_util_unittests.cc index 5670055..90cdd4f 100644 --- a/chrome_frame/test/html_util_unittests.cc +++ b/chrome_frame/test/html_util_unittests.cc @@ -228,51 +228,51 @@ TEST_F(HtmlUtilUnittest, AddChromeFrameToUserAgentValue) { "", "" }, { "Mozilla/4.7 [en] (WinNT; U)", - "Mozilla/4.7 [en] (WinNT; U) chromeframe/0.0" + "Mozilla/4.7 [en] (WinNT; U) chromeframe/0.0.0.0" }, { "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT)", - "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT) chromeframe/0.0" + "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT) chromeframe/0.0.0.0" }, { "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; T312461; " ".NET CLR 1.1.4322)", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; T312461; " - ".NET CLR 1.1.4322) chromeframe/0.0" + ".NET CLR 1.1.4322) chromeframe/0.0.0.0" }, { "Mozilla/4.0 (compatible; MSIE 5.0; Windows NT 4.0) Opera 5.11 [en]", "Mozilla/4.0 (compatible; MSIE 5.0; Windows NT 4.0) " - "Opera 5.11 [en] chromeframe/0.0" + "Opera 5.11 [en] chromeframe/0.0.0.0" }, { "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.2) " "Gecko/20030208 Netscape/7.02", "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.2) " - "Gecko/20030208 Netscape/7.02 chromeframe/0.0" + "Gecko/20030208 Netscape/7.02 chromeframe/0.0.0.0" }, { "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040612 " "Firefox/0.8", "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040612 " - "Firefox/0.8 chromeframe/0.0" + "Firefox/0.8 chromeframe/0.0.0.0" }, { "Mozilla/5.0 (compatible; Konqueror/3.2; Linux) (KHTML, like Gecko)", "Mozilla/5.0 (compatible; Konqueror/3.2; Linux) " - "(KHTML, like Gecko) chromeframe/0.0" + "(KHTML, like Gecko) chromeframe/0.0.0.0" }, { "Lynx/2.8.4rel.1 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.6h", "Lynx/2.8.4rel.1 libwww-FM/2.14 SSL-MM/1.4.1 " - "OpenSSL/0.9.6h chromeframe/0.0", + "OpenSSL/0.9.6h chromeframe/0.0.0.0", }, { "Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.7.10) " "Gecko/20050716 Firefox/1.0.6", "Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.7.10) " - "Gecko/20050716 Firefox/1.0.6 chromeframe/0.0" + "Gecko/20050716 Firefox/1.0.6 chromeframe/0.0.0.0" }, { "Invalid/1.1 ((((((", - "Invalid/1.1 (((((( chromeframe/0.0", + "Invalid/1.1 (((((( chromeframe/0.0.0.0", }, { "Invalid/1.1 ()))))", - "Invalid/1.1 ())))) chromeframe/0.0", + "Invalid/1.1 ())))) chromeframe/0.0.0.0", }, { "Strange/1.1 ()", - "Strange/1.1 () chromeframe/0.0", + "Strange/1.1 () chromeframe/0.0.0.0", } }; @@ -310,7 +310,7 @@ TEST_F(HtmlUtilUnittest, GetChromeFrameUserAgent) { // Expect static buffer since caller does no cleanup. EXPECT_EQ(call1, call2); std::string ua(call1); - EXPECT_EQ("chromeframe/0.0", ua); + EXPECT_EQ("chromeframe/0.0.0.0", ua); } TEST(HttpUtils, HasFrameBustingHeader) { |