diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/base/cookie_monster.cc | 2 | ||||
-rw-r--r-- | net/base/dnssec_chain_verifier.cc | 7 | ||||
-rw-r--r-- | net/base/x509_cert_types_mac.cc | 2 | ||||
-rw-r--r-- | net/base/x509_certificate_mac.cc | 2 | ||||
-rw-r--r-- | net/base/x509_certificate_win.cc | 2 | ||||
-rw-r--r-- | net/http/http_util.cc | 2 | ||||
-rw-r--r-- | net/socket/ssl_host_info.cc | 2 | ||||
-rw-r--r-- | net/tools/flip_server/balsa_headers.h | 2 | ||||
-rw-r--r-- | net/tools/flip_server/output_ordering.cc | 2 | ||||
-rw-r--r-- | net/url_request/url_request_job_tracker.cc | 2 | ||||
-rw-r--r-- | net/url_request/url_request_throttler_entry.cc | 2 | ||||
-rw-r--r-- | net/websockets/websocket_handshake_handler.cc | 22 | ||||
-rw-r--r-- | net/websockets/websocket_job.cc | 2 |
13 files changed, 24 insertions, 27 deletions
diff --git a/net/base/cookie_monster.cc b/net/base/cookie_monster.cc index 05e7355..b856f8a 100644 --- a/net/base/cookie_monster.cc +++ b/net/base/cookie_monster.cc @@ -1579,7 +1579,7 @@ CookieMonster::ParsedCookie::ParsedCookie(const std::string& cookie_line) } ParseTokenValuePairs(cookie_line); - if (pairs_.size() > 0) { + if (!pairs_.empty()) { is_valid_ = true; SetupAttributes(); } diff --git a/net/base/dnssec_chain_verifier.cc b/net/base/dnssec_chain_verifier.cc index 6e68365..c79efa8 100644 --- a/net/base/dnssec_chain_verifier.cc +++ b/net/base/dnssec_chain_verifier.cc @@ -732,12 +732,9 @@ DNSSECChainVerifier::Error DNSSECChainVerifier::ReadDSSet( } digest_types[i] = digest_type; - if (digest.size() > 0) { + lookahead[i] = digest.empty(); + if (!digest.empty()) (*rrdatas)[i] = digest; - lookahead[i] = false; - } else { - lookahead[i] = true; - } } base::StringPiece next_entry_key; diff --git a/net/base/x509_cert_types_mac.cc b/net/base/x509_cert_types_mac.cc index c672863..a45dc71 100644 --- a/net/base/x509_cert_types_mac.cc +++ b/net/base/x509_cert_types_mac.cc @@ -150,7 +150,7 @@ void SetSingle(const std::vector<std::string>& values, std::string* single_value) { // We don't expect to have more than one CN, L, S, and C. LOG_IF(WARNING, values.size() > 1) << "Didn't expect multiple values"; - if (values.size() > 0) + if (!values.empty()) *single_value = values[0]; } diff --git a/net/base/x509_certificate_mac.cc b/net/base/x509_certificate_mac.cc index f9023fd..839e91e 100644 --- a/net/base/x509_certificate_mac.cc +++ b/net/base/x509_certificate_mac.cc @@ -1128,7 +1128,7 @@ bool X509Certificate::GetSSLClientCertificates( // Make sure the issuer matches valid_issuers, if given. // But an explicit cert preference overrides this. if (!is_preferred && - valid_issuers.size() > 0 && + !valid_issuers.empty() && !cert->IsIssuedBy(valid_issuers)) continue; diff --git a/net/base/x509_certificate_win.cc b/net/base/x509_certificate_win.cc index fed56e3..98e3367 100644 --- a/net/base/x509_certificate_win.cc +++ b/net/base/x509_certificate_win.cc @@ -405,7 +405,7 @@ void ParsePrincipal(const std::string& description, for (int i = 0; i < arraysize(single_value_lists); ++i) { int length = static_cast<int>(single_value_lists[i]->size()); DCHECK(single_value_lists[i]->size() <= 1); - if (single_value_lists[i]->size() > 0) + if (!single_value_lists[i]->empty()) *(single_values[i]) = (*(single_value_lists[i]))[0]; } } diff --git a/net/http/http_util.cc b/net/http/http_util.cc index 0f28c83..fed74b6 100644 --- a/net/http/http_util.cc +++ b/net/http/http_util.cc @@ -281,7 +281,7 @@ bool HttpUtil::ParseRangeHeader(const std::string& ranges_specifier, return false; ranges->push_back(range); } - return ranges->size() > 0; + return !ranges->empty(); } // static diff --git a/net/socket/ssl_host_info.cc b/net/socket/ssl_host_info.cc index 5131949c..9d631bb 100644 --- a/net/socket/ssl_host_info.cc +++ b/net/socket/ssl_host_info.cc @@ -115,7 +115,7 @@ bool SSLHostInfo::ParseInner(const std::string& data) { state->npn_status = static_cast<SSLClientSocket::NextProtoStatus>(status); } - if (state->certs.size() > 0) { + if (!state->certs.empty()) { std::vector<base::StringPiece> der_certs(state->certs.size()); for (size_t i = 0; i < state->certs.size(); i++) der_certs[i] = state->certs[i]; diff --git a/net/tools/flip_server/balsa_headers.h b/net/tools/flip_server/balsa_headers.h index f2b7612..f06545d 100644 --- a/net/tools/flip_server/balsa_headers.h +++ b/net/tools/flip_server/balsa_headers.h @@ -816,7 +816,7 @@ class BalsaHeaders { const base::StringPiece& value) { // if the key is empty, we don't want to write the rest because it // will not be a well-formed header line. - if (key.size() > 0) { + if (!key.empty()) { buffer->Write(key.data(), key.size()); buffer->Write(": ", 2); buffer->Write(value.data(), value.size()); diff --git a/net/tools/flip_server/output_ordering.cc b/net/tools/flip_server/output_ordering.cc index 409ec0a..f5fb4cf 100644 --- a/net/tools/flip_server/output_ordering.cc +++ b/net/tools/flip_server/output_ordering.cc @@ -95,7 +95,7 @@ void OutputOrdering::AddToOutputOrder(const MemCacheIter& mci) { double think_time_in_s = server_think_time_in_s_; std::string x_server_latency = mci.file_data->headers->GetHeader("X-Server-Latency").as_string(); - if (x_server_latency.size() != 0) { + if (!x_server_latency.empty()) { char* endp; double tmp_think_time_in_s = strtod(x_server_latency.c_str(), &endp); if (endp != x_server_latency.c_str() + x_server_latency.size()) { diff --git a/net/url_request/url_request_job_tracker.cc b/net/url_request/url_request_job_tracker.cc index 49472d9..632d0a3 100644 --- a/net/url_request/url_request_job_tracker.cc +++ b/net/url_request/url_request_job_tracker.cc @@ -17,7 +17,7 @@ URLRequestJobTracker::URLRequestJobTracker() { } URLRequestJobTracker::~URLRequestJobTracker() { - DLOG_IF(WARNING, active_jobs_.size() != 0) << + DLOG_IF(WARNING, !active_jobs_.empty()) << "Leaking " << active_jobs_.size() << " URLRequestJob object(s), this " "could be because the URLRequest forgot to free it (bad), or if the " "program was terminated while a request was active (normal)."; diff --git a/net/url_request/url_request_throttler_entry.cc b/net/url_request/url_request_throttler_entry.cc index 6db76c3..033787b 100644 --- a/net/url_request/url_request_throttler_entry.cc +++ b/net/url_request/url_request_throttler_entry.cc @@ -74,7 +74,7 @@ bool URLRequestThrottlerEntry::IsEntryOutdated() const { // If there are send events in the sliding window period, we still need this // entry. - if (send_log_.size() > 0 && + if (!send_log_.empty() && send_log_.back() + sliding_window_period_ > now) { return false; } diff --git a/net/websockets/websocket_handshake_handler.cc b/net/websockets/websocket_handshake_handler.cc index 734b93e..68b0445 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()); diff --git a/net/websockets/websocket_job.cc b/net/websockets/websocket_job.cc index 44c944d..8379523 100644 --- a/net/websockets/websocket_job.cc +++ b/net/websockets/websocket_job.cc @@ -234,7 +234,7 @@ void WebSocketJob::OnReceivedData( receive_frame_handler_->GetCurrentBufferSize()); receive_frame_handler_->ReleaseCurrentBuffer(); } - if (delegate_ && received_data.size() > 0) + if (delegate_ && !received_data.empty()) delegate_->OnReceivedData( socket, received_data.data(), received_data.size()); } |