summaryrefslogtreecommitdiffstats
path: root/net/http/http_version.h
diff options
context:
space:
mode:
authormaruel@google.com <maruel@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-23 16:29:05 +0000
committermaruel@google.com <maruel@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-23 16:29:05 +0000
commit6e13b1df93d706045f2da60a61ffebda047385ce (patch)
treef1d5803b278cfcfe08ce12328a50d711cfbe71e7 /net/http/http_version.h
parent3285544e4190d671613e871ca27341268d0776a5 (diff)
downloadchromium_src-6e13b1df93d706045f2da60a61ffebda047385ce.zip
chromium_src-6e13b1df93d706045f2da60a61ffebda047385ce.tar.gz
chromium_src-6e13b1df93d706045f2da60a61ffebda047385ce.tar.bz2
HttpVersion had to be changed because glibc defines macros named "major" and "minor" which was causing compilation problems.
Patch contributed by James Vega <vega.james@gmail.com>. Note: Took the leasure to make some globals const. Review URL: http://codereview.chromium.org/4217 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2491 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/http_version.h')
-rw-r--r--net/http/http_version.h31
1 files changed, 15 insertions, 16 deletions
diff --git a/net/http/http_version.h b/net/http/http_version.h
index 9f4cfba..8ea8fd5 100644
--- a/net/http/http_version.h
+++ b/net/http/http_version.h
@@ -11,49 +11,48 @@ namespace net {
// Wrapper for an HTTP (major,minor) version pair.
class HttpVersion {
- private:
- uint32 value; // Packed as <major>:<minor>
-
public:
// Default constructor (major=0, minor=0).
- HttpVersion() : value(0) { }
+ HttpVersion() : value_(0) { }
// Build from unsigned major/minor pair.
- HttpVersion(uint16 major, uint16 minor) : value(major << 16 | minor) { }
+ HttpVersion(uint16 major, uint16 minor) : value_(major << 16 | minor) { }
// Major version number.
- uint16 major() const {
- return value >> 16;
+ uint16 major_value() const {
+ return value_ >> 16;
}
// Minor version number.
- uint16 minor() const {
- return value & 0xffff;
+ uint16 minor_value() const {
+ return value_ & 0xffff;
}
// Overloaded operators:
bool operator==(const HttpVersion& v) const {
- return value == v.value;
+ return value_ == v.value_;
}
bool operator!=(const HttpVersion& v) const {
- return value != v.value;
+ return value_ != v.value_;
}
bool operator>(const HttpVersion& v) const {
- return value > v.value;
+ return value_ > v.value_;
}
bool operator>=(const HttpVersion& v) const {
- return value >= v.value;
+ return value_ >= v.value_;
}
bool operator<(const HttpVersion& v) const {
- return value < v.value;
+ return value_ < v.value_;
}
bool operator<=(const HttpVersion& v) const {
- return value <= v.value;
+ return value_ <= v.value_;
}
+
+ private:
+ uint32 value_; // Packed as <major>:<minor>
};
} // namespace net
#endif // NET_HTTP_VERSION_H_
-