Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: webkit/glue/user_agent.cc

Issue 6816027: Make the windows_version.h functions threadsafe by using a singleton. Add accessors to the singl... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "webkit/glue/user_agent.h" 5 #include "webkit/glue/user_agent.h"
6 6
7 #if defined(OS_POSIX) && !defined(OS_MACOSX) 7 #if defined(OS_POSIX) && !defined(OS_MACOSX)
8 #include <sys/utsname.h> 8 #include <sys/utsname.h>
9 #endif 9 #endif
10 10
11 #include "base/string_util.h" 11 #include "base/string_util.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 if (strcmp(unixinfo.machine, "x86_64") == 0 && 57 if (strcmp(unixinfo.machine, "x86_64") == 0 &&
58 sizeof(void*) == sizeof(int32)) { // NOLINT 58 sizeof(void*) == sizeof(int32)) { // NOLINT
59 cputype.assign("i686 (x86_64)"); 59 cputype.assign("i686 (x86_64)");
60 } else { 60 } else {
61 cputype.assign(unixinfo.machine); 61 cputype.assign(unixinfo.machine);
62 } 62 }
63 #endif 63 #endif
64 64
65 #if defined(OS_WIN) 65 #if defined(OS_WIN)
66 std::string architecture_token; 66 std::string architecture_token;
67 if (base::win::GetWOW64Status() == base::win::WOW64_ENABLED) { 67 base::win::OSInfo* os_info = base::win::OSInfo::GetInstance();
68 if (os_info->wow64_status() == base::win::OSInfo::WOW64_ENABLED) {
68 architecture_token = "; WOW64"; 69 architecture_token = "; WOW64";
69 } else { 70 } else {
70 base::win::WindowsArchitecture windows_architecture = 71 base::win::OSInfo::WindowsArchitecture windows_architecture =
71 base::win::GetWindowsArchitecture(); 72 os_info->architecture();
72 if (windows_architecture == base::win::X64_ARCHITECTURE) 73 if (windows_architecture == base::win::OSInfo::X64_ARCHITECTURE)
73 architecture_token = "; Win64; x64"; 74 architecture_token = "; Win64; x64";
74 else if (windows_architecture == base::win::IA64_ARCHITECTURE) 75 else if (windows_architecture == base::win::OSInfo::IA64_ARCHITECTURE)
75 architecture_token = "; Win64; IA64"; 76 architecture_token = "; Win64; IA64";
76 } 77 }
77 #endif 78 #endif
78 79
79 base::StringAppendF( 80 base::StringAppendF(
80 &os_cpu, 81 &os_cpu,
81 #if defined(OS_WIN) 82 #if defined(OS_WIN)
82 "Windows NT %d.%d%s", 83 "Windows NT %d.%d%s",
83 os_major_version, 84 os_major_version,
84 os_minor_version, 85 os_minor_version,
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 BuildOSCpuInfo().c_str(), 135 BuildOSCpuInfo().c_str(),
135 WEBKIT_VERSION_MAJOR, 136 WEBKIT_VERSION_MAJOR,
136 WEBKIT_VERSION_MINOR, 137 WEBKIT_VERSION_MINOR,
137 product.c_str(), 138 product.c_str(),
138 WEBKIT_VERSION_MAJOR, 139 WEBKIT_VERSION_MAJOR,
139 WEBKIT_VERSION_MINOR); 140 WEBKIT_VERSION_MINOR);
140 } 141 }
141 142
142 } // namespace webkit_glue 143 } // namespace webkit_glue
143 144
OLDNEW
« no previous file with comments | « sandbox/tests/validation_tests/unit_tests.cc ('k') | webkit/plugins/npapi/test/plugin_npobject_proxy_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698