summaryrefslogtreecommitdiffstats
path: root/net/http
diff options
context:
space:
mode:
authorerg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-11 21:02:35 +0000
committererg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-11 21:02:35 +0000
commit277d5942c22b06bbcc6288a8d60721d5841be014 (patch)
tree75d980a9e5317b52ef6061c5576efd3607f62163 /net/http
parent1430561ede1be63543f07085b59ec17112b9b80b (diff)
downloadchromium_src-277d5942c22b06bbcc6288a8d60721d5841be014.zip
chromium_src-277d5942c22b06bbcc6288a8d60721d5841be014.tar.gz
chromium_src-277d5942c22b06bbcc6288a8d60721d5841be014.tar.bz2
FBTF: Start cleaning up net/
url_request.h and http_response_info.h are some of the most included headers from net/ in chrome. Do what forward declaration we can in those headers. BUG=none TEST=none Review URL: http://codereview.chromium.org/3150003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55780 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http')
-rw-r--r--net/http/http_auth_controller.cc6
-rw-r--r--net/http/http_auth_controller.h4
-rw-r--r--net/http/http_basic_stream.cc6
-rw-r--r--net/http/http_basic_stream.h10
-rw-r--r--net/http/http_network_transaction.cc1
-rw-r--r--net/http/http_network_transaction_unittest.cc1
-rw-r--r--net/http/http_proxy_client_socket.cc1
-rw-r--r--net/http/http_request_headers.cc9
-rw-r--r--net/http/http_request_headers.h5
-rw-r--r--net/http/http_response_info.cc35
-rw-r--r--net/http/http_response_info.h14
-rw-r--r--net/http/http_stream_parser.cc3
-rw-r--r--net/http/http_stream_parser.h7
13 files changed, 83 insertions, 19 deletions
diff --git a/net/http/http_auth_controller.cc b/net/http/http_auth_controller.cc
index 7f8e13c..71e08a3 100644
--- a/net/http/http_auth_controller.cc
+++ b/net/http/http_auth_controller.cc
@@ -5,12 +5,14 @@
#include "net/http/http_auth_controller.h"
#include "base/utf_string_conversions.h"
+#include "net/base/auth.h"
#include "net/base/host_resolver.h"
#include "net/base/net_util.h"
#include "net/http/http_auth_handler_factory.h"
#include "net/http/http_network_session.h"
#include "net/http/http_request_headers.h"
#include "net/http/http_request_info.h"
+#include "net/http/http_response_headers.h"
namespace net {
@@ -352,6 +354,10 @@ void HttpAuthController::OnIOComplete(int result) {
}
}
+scoped_refptr<AuthChallengeInfo> HttpAuthController::auth_info() {
+ return auth_info_;
+}
+
bool HttpAuthController::IsAuthSchemeDisabled(const std::string& scheme) const {
return disabled_schemes_.find(scheme) != disabled_schemes_.end();
}
diff --git a/net/http/http_auth_controller.h b/net/http/http_auth_controller.h
index be335ba..cb2c444 100644
--- a/net/http/http_auth_controller.h
+++ b/net/http/http_auth_controller.h
@@ -67,9 +67,7 @@ class HttpAuthController : public base::RefCounted<HttpAuthController> {
return handler_.get() && !identity_.invalid;
}
- virtual scoped_refptr<AuthChallengeInfo> auth_info() {
- return auth_info_;
- }
+ virtual scoped_refptr<AuthChallengeInfo> auth_info();
virtual bool IsAuthSchemeDisabled(const std::string& scheme) const;
virtual void DisableAuthScheme(const std::string& scheme);
diff --git a/net/http/http_basic_stream.cc b/net/http/http_basic_stream.cc
index 5ffa829..0e71b45 100644
--- a/net/http/http_basic_stream.cc
+++ b/net/http/http_basic_stream.cc
@@ -4,6 +4,10 @@
#include "net/http/http_basic_stream.h"
+#include "net/base/io_buffer.h"
+#include "net/base/net_errors.h"
+#include "net/http/http_stream_parser.h"
+
namespace net {
HttpBasicStream::HttpBasicStream(ClientSocketHandle* connection)
@@ -39,7 +43,7 @@ int HttpBasicStream::ReadResponseHeaders(CompletionCallback* callback) {
return parser_->ReadResponseHeaders(callback);
}
-HttpResponseInfo* HttpBasicStream::GetResponseInfo() const {
+const HttpResponseInfo* HttpBasicStream::GetResponseInfo() const {
return parser_->GetResponseInfo();
}
diff --git a/net/http/http_basic_stream.h b/net/http/http_basic_stream.h
index 443c020..0c1cbca 100644
--- a/net/http/http_basic_stream.h
+++ b/net/http/http_basic_stream.h
@@ -13,16 +13,18 @@
#include <string>
#include "base/basictypes.h"
-#include "net/base/io_buffer.h"
+#include "base/scoped_ptr.h"
#include "net/http/http_stream.h"
-#include "net/http/http_stream_parser.h"
namespace net {
class BoundNetLog;
class ClientSocketHandle;
-struct HttpRequestInfo;
+class GrowableIOBuffer;
class HttpResponseInfo;
+struct HttpRequestInfo;
+class HttpStreamParser;
+class IOBuffer;
class UploadDataStream;
class HttpBasicStream : public HttpStream {
@@ -44,7 +46,7 @@ class HttpBasicStream : public HttpStream {
virtual int ReadResponseHeaders(CompletionCallback* callback);
- virtual HttpResponseInfo* GetResponseInfo() const;
+ virtual const HttpResponseInfo* GetResponseInfo() const;
virtual int ReadResponseBody(IOBuffer* buf, int buf_len,
CompletionCallback* callback);
diff --git a/net/http/http_network_transaction.cc b/net/http/http_network_transaction.cc
index 7b2f944..05c32f2 100644
--- a/net/http/http_network_transaction.cc
+++ b/net/http/http_network_transaction.cc
@@ -18,6 +18,7 @@
#include "base/string_number_conversions.h"
#include "build/build_config.h"
#include "googleurl/src/gurl.h"
+#include "net/base/auth.h"
#include "net/base/connection_type_histograms.h"
#include "net/base/host_mapping_rules.h"
#include "net/base/io_buffer.h"
diff --git a/net/http/http_network_transaction_unittest.cc b/net/http/http_network_transaction_unittest.cc
index b5919e6..dc7c842 100644
--- a/net/http/http_network_transaction_unittest.cc
+++ b/net/http/http_network_transaction_unittest.cc
@@ -13,6 +13,7 @@
#include "base/file_util.h"
#include "base/scoped_ptr.h"
#include "base/utf_string_conversions.h"
+#include "net/base/auth.h"
#include "net/base/capturing_net_log.h"
#include "net/base/completion_callback.h"
#include "net/base/mock_host_resolver.h"
diff --git a/net/http/http_proxy_client_socket.cc b/net/http/http_proxy_client_socket.cc
index 1c76c36..aa58cfb 100644
--- a/net/http/http_proxy_client_socket.cc
+++ b/net/http/http_proxy_client_socket.cc
@@ -6,6 +6,7 @@
#include "base/string_util.h"
#include "googleurl/src/gurl.h"
+#include "net/base/auth.h"
#include "net/base/host_port_pair.h"
#include "net/base/io_buffer.h"
#include "net/base/net_log.h"
diff --git a/net/http/http_request_headers.cc b/net/http/http_request_headers.cc
index 29379c1..c534967 100644
--- a/net/http/http_request_headers.cc
+++ b/net/http/http_request_headers.cc
@@ -30,6 +30,15 @@ const char HttpRequestHeaders::kRange[] = "Range";
const char HttpRequestHeaders::kReferer[] = "Referer";
const char HttpRequestHeaders::kUserAgent[] = "User-Agent";
+HttpRequestHeaders::HeaderKeyValuePair::HeaderKeyValuePair() {
+}
+
+HttpRequestHeaders::HeaderKeyValuePair::HeaderKeyValuePair(
+ const base::StringPiece& key, const base::StringPiece& value)
+ : key(key.data(), key.size()), value(value.data(), value.size()) {
+}
+
+
HttpRequestHeaders::Iterator::Iterator(const HttpRequestHeaders& headers)
: started_(false),
curr_(headers.headers_.begin()),
diff --git a/net/http/http_request_headers.h b/net/http/http_request_headers.h
index 9563fa265..734194a 100644
--- a/net/http/http_request_headers.h
+++ b/net/http/http_request_headers.h
@@ -21,10 +21,9 @@ namespace net {
class HttpRequestHeaders {
public:
struct HeaderKeyValuePair {
- HeaderKeyValuePair() {}
+ HeaderKeyValuePair();
HeaderKeyValuePair(const base::StringPiece& key,
- const base::StringPiece& value)
- : key(key.data(), key.size()), value(value.data(), value.size()) {}
+ const base::StringPiece& value);
std::string key;
std::string value;
diff --git a/net/http/http_response_info.cc b/net/http/http_response_info.cc
index 0159caf..3e1075b 100644
--- a/net/http/http_response_info.cc
+++ b/net/http/http_response_info.cc
@@ -7,6 +7,10 @@
#include "base/logging.h"
#include "base/pickle.h"
#include "base/time.h"
+#include "net/base/auth.h"
+#include "net/base/io_buffer.h"
+#include "net/base/net_errors.h"
+#include "net/base/ssl_cert_request_info.h"
#include "net/http/http_response_headers.h"
using base::Time;
@@ -63,9 +67,40 @@ HttpResponseInfo::HttpResponseInfo()
was_fetched_via_proxy(false) {
}
+HttpResponseInfo::HttpResponseInfo(const HttpResponseInfo& rhs)
+ : was_cached(rhs.was_cached),
+ was_fetched_via_spdy(rhs.was_fetched_via_spdy),
+ was_npn_negotiated(rhs.was_npn_negotiated),
+ was_fetched_via_proxy(rhs.was_fetched_via_proxy),
+ request_time(rhs.request_time),
+ response_time(rhs.response_time),
+ auth_challenge(rhs.auth_challenge),
+ cert_request_info(rhs.cert_request_info),
+ ssl_info(rhs.ssl_info),
+ headers(rhs.headers),
+ vary_data(rhs.vary_data),
+ metadata(rhs.metadata) {
+}
+
HttpResponseInfo::~HttpResponseInfo() {
}
+HttpResponseInfo& HttpResponseInfo::operator=(const HttpResponseInfo& rhs) {
+ was_cached = rhs.was_cached;
+ was_fetched_via_spdy = rhs.was_fetched_via_spdy;
+ was_npn_negotiated = rhs.was_npn_negotiated;
+ was_fetched_via_proxy = rhs.was_fetched_via_proxy;
+ request_time = rhs.request_time;
+ response_time = rhs.response_time;
+ auth_challenge = rhs.auth_challenge;
+ cert_request_info = rhs.cert_request_info;
+ ssl_info = rhs.ssl_info;
+ headers = rhs.headers;
+ vary_data = rhs.vary_data;
+ metadata = rhs.metadata;
+ return *this;
+}
+
bool HttpResponseInfo::InitFromPickle(const Pickle& pickle,
bool* response_truncated) {
void* iter = NULL;
diff --git a/net/http/http_response_info.h b/net/http/http_response_info.h
index 52db066..cd66982 100644
--- a/net/http/http_response_info.h
+++ b/net/http/http_response_info.h
@@ -7,22 +7,26 @@
#pragma once
#include "base/time.h"
-#include "net/base/auth.h"
-#include "net/base/io_buffer.h"
-#include "net/base/ssl_cert_request_info.h"
#include "net/base/ssl_info.h"
-#include "net/http/http_response_headers.h"
#include "net/http/http_vary_data.h"
class Pickle;
namespace net {
+class AuthChallengeInfo;
+class HttpResponseHeaders;
+class IOBufferWithSize;
+class SSLCertRequestInfo;
+
class HttpResponseInfo {
public:
HttpResponseInfo();
+ HttpResponseInfo(const HttpResponseInfo& rhs);
~HttpResponseInfo();
- // Default copy-constructor and assignment operator are OK!
+ HttpResponseInfo& operator=(const HttpResponseInfo& rhs);
+ // Even though we could get away with the copy ctor and default operator=,
+ // that would prevent us from doing a bunch of forward declaration.
// The following is only defined if the request_time member is set.
// If this response was resurrected from cache, then this bool is set, and
diff --git a/net/http/http_stream_parser.cc b/net/http/http_stream_parser.cc
index 9e0c8ba..68f98b9 100644
--- a/net/http/http_stream_parser.cc
+++ b/net/http/http_stream_parser.cc
@@ -6,10 +6,13 @@
#include "base/compiler_specific.h"
#include "base/histogram.h"
+#include "net/base/auth.h"
#include "net/base/io_buffer.h"
+#include "net/base/ssl_cert_request_info.h"
#include "net/http/http_request_info.h"
#include "net/http/http_response_headers.h"
#include "net/http/http_util.h"
+#include "net/socket/client_socket_handle.h"
namespace net {
diff --git a/net/http/http_stream_parser.h b/net/http/http_stream_parser.h
index a658ce7..feb34e2 100644
--- a/net/http/http_stream_parser.h
+++ b/net/http/http_stream_parser.h
@@ -9,17 +9,18 @@
#include <string>
#include "base/basictypes.h"
-#include "net/base/io_buffer.h"
#include "net/base/net_log.h"
#include "net/base/upload_data_stream.h"
#include "net/http/http_chunked_decoder.h"
-#include "net/http/http_response_info.h"
-#include "net/socket/client_socket_handle.h"
namespace net {
class ClientSocketHandle;
+class DrainableIOBuffer;
+class GrowableIOBuffer;
struct HttpRequestInfo;
+class HttpResponseInfo;
+class IOBuffer;
class HttpStreamParser {
public: