diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-22 03:39:36 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-22 03:39:36 +0000 |
commit | 81854c44c38df32b69393186007d4fe7ebb6c471 (patch) | |
tree | f7c81816ac395bc37e6ea69aeb4b56cb9c7d3431 /net/http | |
parent | cf0ee14c47a74c365e45bfba00eb2024b2e83b4f (diff) | |
download | chromium_src-81854c44c38df32b69393186007d4fe7ebb6c471.zip chromium_src-81854c44c38df32b69393186007d4fe7ebb6c471.tar.gz chromium_src-81854c44c38df32b69393186007d4fe7ebb6c471.tar.bz2 |
net: Fix incorrect style used in some enumerations.
Reason: They are using kConstantNaming, however the Chromium style is to use
UPPER_CASE_FOR_ENUMS.
Also convert some truly constants, like the following:
http/http_proxy_client_socket_pool.h:
enum { kDrainBodyBufferSize = 1024 };
To:
static const int kDrainBodyBufferSize = 1024;
BUG=55668
TEST=compiles locally.
Review URL: http://codereview.chromium.org/3421026
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60155 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http')
-rw-r--r-- | net/http/http_network_transaction.h | 2 | ||||
-rw-r--r-- | net/http/http_proxy_client_socket.h | 2 | ||||
-rw-r--r-- | net/http/http_proxy_client_socket_pool.cc | 44 | ||||
-rw-r--r-- | net/http/http_proxy_client_socket_pool.h | 14 | ||||
-rw-r--r-- | net/http/http_response_body_drainer.h | 4 |
5 files changed, 33 insertions, 33 deletions
diff --git a/net/http/http_network_transaction.h b/net/http/http_network_transaction.h index 4473d57..f0080e2 100644 --- a/net/http/http_network_transaction.h +++ b/net/http/http_network_transaction.h @@ -223,7 +223,7 @@ class HttpNetworkTransaction : public HttpTransaction, // The size in bytes of the buffer we use to drain the response body that // we want to throw away. The response body is typically a small error // page just a few hundred bytes long. - enum { kDrainBodyBufferSize = 1024 }; + static const int kDrainBodyBufferSize = 1024; // User buffer and length passed to the Read method. scoped_refptr<IOBuffer> read_buf_; diff --git a/net/http/http_proxy_client_socket.h b/net/http/http_proxy_client_socket.h index 11e0dc5..6530285 100644 --- a/net/http/http_proxy_client_socket.h +++ b/net/http/http_proxy_client_socket.h @@ -107,7 +107,7 @@ class HttpProxyClientSocket : public ClientSocket { // The size in bytes of the buffer we use to drain the response body that // we want to throw away. The response body is typically a small error // page just a few hundred bytes long. - enum { kDrainBodyBufferSize = 1024 }; + static const int kDrainBodyBufferSize = 1024; int PrepareForAuthRestart(); int DidDrainBodyForAuthRestart(bool keep_alive); diff --git a/net/http/http_proxy_client_socket_pool.cc b/net/http/http_proxy_client_socket_pool.cc index 047ee00..16f9597 100644 --- a/net/http/http_proxy_client_socket_pool.cc +++ b/net/http/http_proxy_client_socket_pool.cc @@ -79,13 +79,13 @@ HttpProxyConnectJob::~HttpProxyConnectJob() {} LoadState HttpProxyConnectJob::GetLoadState() const { switch (next_state_) { - case kStateTCPConnect: - case kStateTCPConnectComplete: - case kStateSSLConnect: - case kStateSSLConnectComplete: + case STATE_TCP_CONNECT: + case STATE_TCP_CONNECT_COMPLETE: + case STATE_SSL_CONNECT: + case STATE_SSL_CONNECT_COMPLETE: return transport_socket_handle_->GetLoadState(); - case kStateHttpProxyConnect: - case kStateHttpProxyConnectComplete: + case STATE_HTTP_PROXY_CONNECT: + case STATE_HTTP_PROXY_CONNECT_COMPLETE: return LOAD_STATE_ESTABLISHING_PROXY_TUNNEL; default: NOTREACHED(); @@ -95,9 +95,9 @@ LoadState HttpProxyConnectJob::GetLoadState() const { int HttpProxyConnectJob::ConnectInternal() { if (params_->tcp_params()) - next_state_ = kStateTCPConnect; + next_state_ = STATE_TCP_CONNECT; else - next_state_ = kStateSSLConnect; + next_state_ = STATE_SSL_CONNECT; return DoLoop(OK); } @@ -108,32 +108,32 @@ void HttpProxyConnectJob::OnIOComplete(int result) { } int HttpProxyConnectJob::DoLoop(int result) { - DCHECK_NE(next_state_, kStateNone); + DCHECK_NE(next_state_, STATE_NONE); int rv = result; do { State state = next_state_; - next_state_ = kStateNone; + next_state_ = STATE_NONE; switch (state) { - case kStateTCPConnect: + case STATE_TCP_CONNECT: DCHECK_EQ(OK, rv); rv = DoTCPConnect(); break; - case kStateTCPConnectComplete: + case STATE_TCP_CONNECT_COMPLETE: rv = DoTCPConnectComplete(rv); break; - case kStateSSLConnect: + case STATE_SSL_CONNECT: DCHECK_EQ(OK, rv); rv = DoSSLConnect(); break; - case kStateSSLConnectComplete: + case STATE_SSL_CONNECT_COMPLETE: rv = DoSSLConnectComplete(rv); break; - case kStateHttpProxyConnect: + case STATE_HTTP_PROXY_CONNECT: DCHECK_EQ(OK, rv); rv = DoHttpProxyConnect(); break; - case kStateHttpProxyConnectComplete: + case STATE_HTTP_PROXY_CONNECT_COMPLETE: rv = DoHttpProxyConnectComplete(rv); break; default: @@ -141,13 +141,13 @@ int HttpProxyConnectJob::DoLoop(int result) { rv = ERR_FAILED; break; } - } while (rv != ERR_IO_PENDING && next_state_ != kStateNone); + } while (rv != ERR_IO_PENDING && next_state_ != STATE_NONE); return rv; } int HttpProxyConnectJob::DoTCPConnect() { - next_state_ = kStateTCPConnectComplete; + next_state_ = STATE_TCP_CONNECT_COMPLETE; transport_socket_handle_.reset(new ClientSocketHandle()); return transport_socket_handle_->Init( group_name(), params_->tcp_params(), @@ -164,12 +164,12 @@ int HttpProxyConnectJob::DoTCPConnectComplete(int result) { // longer to timeout than it should. ResetTimer(base::TimeDelta::FromSeconds( kHttpProxyConnectJobTimeoutInSeconds)); - next_state_ = kStateHttpProxyConnect; + next_state_ = STATE_HTTP_PROXY_CONNECT; return result; } int HttpProxyConnectJob::DoSSLConnect() { - next_state_ = kStateSSLConnectComplete; + next_state_ = STATE_SSL_CONNECT_COMPLETE; transport_socket_handle_.reset(new ClientSocketHandle()); return transport_socket_handle_->Init( group_name(), params_->ssl_params(), @@ -198,12 +198,12 @@ int HttpProxyConnectJob::DoSSLConnectComplete(int result) { // longer to timeout than it should. ResetTimer(base::TimeDelta::FromSeconds( kHttpProxyConnectJobTimeoutInSeconds)); - next_state_ = kStateHttpProxyConnect; + next_state_ = STATE_HTTP_PROXY_CONNECT; return result; } int HttpProxyConnectJob::DoHttpProxyConnect() { - next_state_ = kStateHttpProxyConnectComplete; + next_state_ = STATE_HTTP_PROXY_CONNECT_COMPLETE; const HostResolver::RequestInfo& tcp_destination = params_->destination(); const HostPortPair& proxy_server = tcp_destination.host_port_pair(); diff --git a/net/http/http_proxy_client_socket_pool.h b/net/http/http_proxy_client_socket_pool.h index 7dc8bdb..cfeb9a3 100644 --- a/net/http/http_proxy_client_socket_pool.h +++ b/net/http/http_proxy_client_socket_pool.h @@ -94,13 +94,13 @@ class HttpProxyConnectJob : public ConnectJob { private: enum State { - kStateTCPConnect, - kStateTCPConnectComplete, - kStateSSLConnect, - kStateSSLConnectComplete, - kStateHttpProxyConnect, - kStateHttpProxyConnectComplete, - kStateNone, + STATE_TCP_CONNECT, + STATE_TCP_CONNECT_COMPLETE, + STATE_SSL_CONNECT, + STATE_SSL_CONNECT_COMPLETE, + STATE_HTTP_PROXY_CONNECT, + STATE_HTTP_PROXY_CONNECT_COMPLETE, + STATE_NONE, }; // Begins the tcp connection and the optional Http proxy tunnel. If the diff --git a/net/http/http_response_body_drainer.h b/net/http/http_response_body_drainer.h index dbcdd99..16a4c88 100644 --- a/net/http/http_response_body_drainer.h +++ b/net/http/http_response_body_drainer.h @@ -23,8 +23,8 @@ class HttpResponseBodyDrainer { // we want to throw away. The response body is typically a small page just a // few hundred bytes long. We set a limit to prevent it from taking too long, // since we may as well just create a new socket then. - enum { kDrainBodyBufferSize = 16384 }; - enum { kTimeoutInSeconds = 5 }; + static const int kDrainBodyBufferSize = 16384; + static const int kTimeoutInSeconds = 5; explicit HttpResponseBodyDrainer(HttpStream* stream); |