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

Unified Diff: net/http/http_version.h

Issue 527883002: Modified to resolve TODO in parseversion in http_response_headers.cc (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Modified to include overflow logic and other comments Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/http/http_response_headers_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_version.h
diff --git a/net/http/http_version.h b/net/http/http_version.h
index 127e7115bf9966614963d3403b4e570a884a79c4..40111cc01e25f537a879545b9bc528b6826b4286 100644
--- a/net/http/http_version.h
+++ b/net/http/http_version.h
@@ -16,17 +16,17 @@ class HttpVersion {
HttpVersion() : value_(0) { }
// Build from unsigned major/minor pair.
- HttpVersion(uint16 major, uint16 minor) : value_(major << 16 | minor) { }
+ HttpVersion(uint32 major, uint32 minor) {
+ value_ = major;
+ value_ <<= 32;
+ value_ |= minor;
+ }
// Major version number.
- uint16 major_value() const {
- return value_ >> 16;
- }
+ uint32 major_value() const { return value_ >> 32; }
// Minor version number.
- uint16 minor_value() const {
- return value_ & 0xffff;
- }
+ uint32 minor_value() const { return value_ & 0xffffffff; }
// Overloaded operators:
@@ -50,7 +50,7 @@ class HttpVersion {
}
private:
- uint32 value_; // Packed as <major>:<minor>
+ uint64 value_; // Packed as <major>:<minor>
};
} // namespace net
« no previous file with comments | « net/http/http_response_headers_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698