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

Unified Diff: net/websockets/websocket_handshake_handler.cc

Issue 6609008: Change other usages of .size() to .empty() when applicable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Peter nits Created 9 years, 10 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/url_request/url_request_throttler_entry.cc ('k') | net/websockets/websocket_job.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/websockets/websocket_handshake_handler.cc
diff --git a/net/websockets/websocket_handshake_handler.cc b/net/websockets/websocket_handshake_handler.cc
index 734b93ec8d858d62650848a6dc41b5a0335a0ff0..68b0445fed1299f546a45fe84ebd0c5acd5c125e 100644
--- a/net/websockets/websocket_handshake_handler.cc
+++ b/net/websockets/websocket_handshake_handler.cc
@@ -174,14 +174,14 @@ size_t WebSocketHandshakeRequestHandler::original_length() const {
void WebSocketHandshakeRequestHandler::AppendHeaderIfMissing(
const std::string& name, const std::string& value) {
- DCHECK(headers_.size() > 0);
+ DCHECK(!headers_.empty());
HttpUtil::AppendHeaderIfMissing(name.c_str(), value, &headers_);
}
void WebSocketHandshakeRequestHandler::RemoveHeaders(
const char* const headers_to_remove[],
size_t headers_to_remove_len) {
- DCHECK(headers_.size() > 0);
+ DCHECK(!headers_.empty());
headers_ = FilterHeaders(
headers_, headers_to_remove, headers_to_remove_len);
}
@@ -267,8 +267,8 @@ bool WebSocketHandshakeRequestHandler::GetRequestHeaderBlock(
}
std::string WebSocketHandshakeRequestHandler::GetRawRequest() {
- DCHECK(status_line_.size() > 0);
- DCHECK(headers_.size() > 0);
+ DCHECK(!status_line_.empty());
+ DCHECK(!headers_.empty());
DCHECK_EQ(kRequestKey3Size, key3_.size());
std::string raw_request = status_line_ + headers_ + "\r\n" + key3_;
raw_length_ = raw_request.size();
@@ -290,8 +290,8 @@ size_t WebSocketHandshakeResponseHandler::ParseRawResponse(
const char* data, int length) {
DCHECK_GT(length, 0);
if (HasResponse()) {
- DCHECK(status_line_.size() > 0);
- DCHECK(headers_.size() > 0);
+ DCHECK(!status_line_.empty());
+ DCHECK(!headers_.empty());
DCHECK_EQ(kResponseKeySize, key_.size());
return 0;
}
@@ -397,8 +397,8 @@ void WebSocketHandshakeResponseHandler::GetHeaders(
size_t headers_to_get_len,
std::vector<std::string>* values) {
DCHECK(HasResponse());
- DCHECK(status_line_.size() > 0);
- DCHECK(headers_.size() > 0);
+ DCHECK(!status_line_.empty());
+ DCHECK(!headers_.empty());
DCHECK_EQ(kResponseKeySize, key_.size());
FetchHeaders(headers_, headers_to_get, headers_to_get_len, values);
@@ -408,8 +408,8 @@ void WebSocketHandshakeResponseHandler::RemoveHeaders(
const char* const headers_to_remove[],
size_t headers_to_remove_len) {
DCHECK(HasResponse());
- DCHECK(status_line_.size() > 0);
- DCHECK(headers_.size() > 0);
+ DCHECK(!status_line_.empty());
+ DCHECK(!headers_.empty());
DCHECK_EQ(kResponseKeySize, key_.size());
headers_ = FilterHeaders(headers_, headers_to_remove, headers_to_remove_len);
@@ -423,7 +423,7 @@ std::string WebSocketHandshakeResponseHandler::GetRawResponse() const {
std::string WebSocketHandshakeResponseHandler::GetResponse() {
DCHECK(HasResponse());
- DCHECK(status_line_.size() > 0);
+ DCHECK(!status_line_.empty());
// headers_ might be empty for wrong response from server.
DCHECK_EQ(kResponseKeySize, key_.size());
« no previous file with comments | « net/url_request/url_request_throttler_entry.cc ('k') | net/websockets/websocket_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698