Skip to content

Commit

Permalink
expose OS info in the user agent string
Browse files Browse the repository at this point in the history
  • Loading branch information
rogerwang committed Dec 28, 2012
1 parent 1beb314 commit d8777b5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion webkit/user_agent/user_agent_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ int GetWebKitMinorVersion() {
return WEBKIT_VERSION_MINOR;
}

std::string BuildUserAgentFromProduct(const std::string& product) {
std::string BuildOSInfo() {
const char kUserAgentPlatform[] =
#if defined(OS_WIN)
"";
Expand All @@ -162,6 +162,11 @@ std::string BuildUserAgentFromProduct(const std::string& product) {
std::string os_info;
base::StringAppendF(&os_info, "%s%s", kUserAgentPlatform,
webkit_glue::BuildOSCpuInfo().c_str());
return os_info;
}

std::string BuildUserAgentFromProduct(const std::string& product) {
std::string os_info = BuildOSInfo();
return BuildUserAgentFromOSAndProduct(os_info, product);
}

Expand Down
1 change: 1 addition & 0 deletions webkit/user_agent/user_agent_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ WEBKIT_USER_AGENT_EXPORT std::string BuildUserAgentFromOSAndProduct(
const std::string& os_info,
const std::string& product);

WEBKIT_USER_AGENT_EXPORT std::string BuildOSInfo();
} // namespace webkit_glue

#endif // WEBKIT_USER_AGENT_USER_AGENT_UTIL_H_

0 comments on commit d8777b5

Please sign in to comment.