summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-01 00:46:33 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-01 00:46:33 +0000
commitd643172a8573e7e75f325bec2125de8071bfd0fc (patch)
tree16d43bab4652624b87e1e7acfbecb63310a6e736 /net
parentf5e7e8e162433ab6e8223c8b3da4feb64abddc33 (diff)
downloadchromium_src-d643172a8573e7e75f325bec2125de8071bfd0fc.zip
chromium_src-d643172a8573e7e75f325bec2125de8071bfd0fc.tar.gz
chromium_src-d643172a8573e7e75f325bec2125de8071bfd0fc.tar.bz2
Reduce number of unnamed-type-template-args violations (mostly when passing values to DCHECK(), ASSERT_EQ(), etc.), generally by naming previously-anonymous enums. We've decided not to eliminate the warning entirely because doing so is only possible with tons of ugly static_cast<>()s in Mac code.
BUG=92247 TEST=Compiles Review URL: http://codereview.chromium.org/7605019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@99086 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r--net/base/x509_cert_types_mac.cc12
-rw-r--r--net/http/http_stream_parser.h6
-rw-r--r--net/proxy/proxy_config.cc2
-rw-r--r--net/proxy/proxy_config.h4
-rw-r--r--net/proxy/proxy_info.cc2
-rw-r--r--net/proxy/proxy_service.cc6
6 files changed, 16 insertions, 16 deletions
diff --git a/net/base/x509_cert_types_mac.cc b/net/base/x509_cert_types_mac.cc
index a45dc71..8fb0d8d 100644
--- a/net/base/x509_cert_types_mac.cc
+++ b/net/base/x509_cert_types_mac.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -36,11 +36,7 @@ const CSSM_OID* kOIDs[] = {
// BER DistinguishedName structure.
struct KeyValuePair {
- CSSM_OID key;
- int value_type;
- CSSM_DATA value;
-
- enum {
+ enum ValueType {
kTypeOther = 0,
kTypePrintableString,
kTypeIA5String,
@@ -49,6 +45,10 @@ struct KeyValuePair {
kTypeBMPString,
kTypeUniversalString,
};
+
+ CSSM_OID key;
+ ValueType value_type;
+ CSSM_DATA value;
};
const SecAsn1Template kStringValueTemplate[] = {
diff --git a/net/http/http_stream_parser.h b/net/http/http_stream_parser.h
index 40a4a0a..8853728 100644
--- a/net/http/http_stream_parser.h
+++ b/net/http/http_stream_parser.h
@@ -94,16 +94,16 @@ class HttpStreamParser : public ChunkCallback {
// The number of bytes by which the header buffer is grown when it reaches
// capacity.
- enum { kHeaderBufInitialSize = 4096 };
+ static const int kHeaderBufInitialSize = 4 * 1024; // 4K
// |kMaxHeaderBufSize| is the number of bytes that the response headers can
// grow to. If the body start is not found within this range of the
// response, the transaction will fail with ERR_RESPONSE_HEADERS_TOO_BIG.
// Note: |kMaxHeaderBufSize| should be a multiple of |kHeaderBufInitialSize|.
- enum { kMaxHeaderBufSize = 256 * 1024 }; // 256 kilobytes.
+ static const int kMaxHeaderBufSize = kHeaderBufInitialSize * 64; // 256K
// The maximum sane buffer size.
- enum { kMaxBufSize = 2 * 1024 * 1024 }; // 2 megabytes.
+ static const int kMaxBufSize = 2 * 1024 * 1024; // 2M
// Handle callbacks.
void OnIOComplete(int result);
diff --git a/net/proxy/proxy_config.cc b/net/proxy/proxy_config.cc
index 42589a9..d160fa4 100644
--- a/net/proxy/proxy_config.cc
+++ b/net/proxy/proxy_config.cc
@@ -159,7 +159,7 @@ ProxyServer* ProxyConfig::ProxyRules::MapUrlSchemeToProxyNoFallback(
}
ProxyConfig::ProxyConfig()
- : auto_detect_(false), pac_mandatory_(false), id_(INVALID_ID) {
+ : auto_detect_(false), pac_mandatory_(false), id_(kInvalidConfigID) {
}
ProxyConfig::ProxyConfig(const ProxyConfig& config)
diff --git a/net/proxy/proxy_config.h b/net/proxy/proxy_config.h
index 0c353ce..f666e93 100644
--- a/net/proxy/proxy_config.h
+++ b/net/proxy/proxy_config.h
@@ -110,7 +110,7 @@ class NET_EXPORT ProxyConfig {
typedef int ID;
// Indicates an invalid proxy config.
- enum { INVALID_ID = 0 };
+ static const ID kInvalidConfigID = 0;
ProxyConfig();
ProxyConfig(const ProxyConfig& config);
@@ -120,7 +120,7 @@ class NET_EXPORT ProxyConfig {
// Used to numerically identify this configuration.
ID id() const { return id_; }
void set_id(int id) { id_ = id; }
- bool is_valid() const { return id_ != INVALID_ID; }
+ bool is_valid() const { return id_ != kInvalidConfigID; }
// Returns true if the given config is equivalent to this config.
bool Equals(const ProxyConfig& other) const;
diff --git a/net/proxy/proxy_info.cc b/net/proxy/proxy_info.cc
index 85d6cae..b7d40a0 100644
--- a/net/proxy/proxy_info.cc
+++ b/net/proxy/proxy_info.cc
@@ -8,7 +8,7 @@
namespace net {
-ProxyInfo::ProxyInfo() : config_id_(ProxyConfig::INVALID_ID) {
+ProxyInfo::ProxyInfo() : config_id_(ProxyConfig::kInvalidConfigID) {
}
ProxyInfo::~ProxyInfo() {
diff --git a/net/proxy/proxy_service.cc b/net/proxy/proxy_service.cc
index 643b9be..c8f3620 100644
--- a/net/proxy/proxy_service.cc
+++ b/net/proxy/proxy_service.cc
@@ -308,7 +308,7 @@ class ProxyService::PacRequest
results_(results),
url_(url),
resolve_job_(NULL),
- config_id_(ProxyConfig::INVALID_ID),
+ config_id_(ProxyConfig::kInvalidConfigID),
net_log_(net_log) {
DCHECK(user_callback);
}
@@ -375,7 +375,7 @@ class ProxyService::PacRequest
// Reset the state associated with in-progress-resolve.
resolve_job_ = NULL;
- config_id_ = ProxyConfig::INVALID_ID;
+ config_id_ = ProxyConfig::kInvalidConfigID;
return service_->DidFinishResolvingProxy(results_, result_code, net_log_);
}
@@ -599,7 +599,7 @@ int ProxyService::TryToCompleteSynchronously(const GURL& url,
if (current_state_ != STATE_READY)
return ERR_IO_PENDING; // Still initializing.
- DCHECK_NE(config_.id(), ProxyConfig::INVALID_ID);
+ DCHECK_NE(config_.id(), ProxyConfig::kInvalidConfigID);
// If it was impossible to fetch or parse the PAC script, we cannot complete
// the request here and bail out.