Skip to content

Commit

Permalink
FBTF: Start cleaning up net/
Browse files Browse the repository at this point in the history
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
  • Loading branch information
erg@google.com committed Aug 11, 2010
1 parent 1430561 commit 277d594
Show file tree
Hide file tree
Showing 30 changed files with 100 additions and 19 deletions.
1 change: 1 addition & 0 deletions chrome/browser/download/download_file_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "chrome/browser/tab_contents/tab_util.h"
#include "chrome/browser/tab_contents/tab_contents.h"
#include "googleurl/src/gurl.h"
#include "net/base/io_buffer.h"

#if defined(OS_WIN)
#include "app/win_util.h"
Expand Down
1 change: 1 addition & 0 deletions chrome/browser/net/connection_tester.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "chrome/common/chrome_switches.h"
#include "net/base/cookie_monster.h"
#include "net/base/host_resolver_impl.h"
#include "net/base/io_buffer.h"
#include "net/base/net_errors.h"
#include "net/base/net_util.h"
#include "net/base/ssl_config_service_defaults.h"
Expand Down
1 change: 1 addition & 0 deletions chrome/browser/renderer_host/download_resource_handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "chrome/browser/renderer_host/resource_dispatcher_host.h"
#include "chrome/common/resource_response.h"
#include "net/base/io_buffer.h"
#include "net/http/http_response_headers.h"
#include "net/url_request/url_request_context.h"

DownloadResourceHandler::DownloadResourceHandler(
Expand Down
1 change: 1 addition & 0 deletions chrome/browser/renderer_host/resource_dispatcher_host.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "base/basictypes.h"
#include "base/gtest_prod_util.h"
#include "base/observer_list.h"
#include "base/scoped_ptr.h"
#include "base/timer.h"
#include "chrome/common/child_process_info.h"
#include "chrome/browser/renderer_host/resource_queue.h"
Expand Down
1 change: 1 addition & 0 deletions chrome/browser/renderer_host/resource_message_filter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
#include "gfx/native_widget_types.h"
#include "net/base/cookie_monster.h"
#include "net/base/file_stream.h"
#include "net/base/io_buffer.h"
#include "net/base/keygen_handler.h"
#include "net/base/load_flags.h"
#include "net/base/mime_util.h"
Expand Down
1 change: 1 addition & 0 deletions chrome/browser/renderer_host/resource_queue_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// found in the LICENSE file.

#include "base/message_loop.h"
#include "base/scoped_ptr.h"
#include "chrome/browser/chrome_thread.h"
#include "chrome/browser/renderer_host/global_request_id.h"
#include "chrome/browser/renderer_host/resource_dispatcher_host_request_info.h"
Expand Down
6 changes: 6 additions & 0 deletions net/http/http_auth_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down Expand Up @@ -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();
}
Expand Down
4 changes: 1 addition & 3 deletions net/http/http_auth_controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 5 additions & 1 deletion net/http/http_basic_stream.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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();
}

Expand Down
10 changes: 6 additions & 4 deletions net/http/http_basic_stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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);
Expand Down
1 change: 1 addition & 0 deletions net/http/http_network_transaction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions net/http/http_network_transaction_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions net/http/http_proxy_client_socket.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
9 changes: 9 additions & 0 deletions net/http/http_request_headers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
Expand Down
5 changes: 2 additions & 3 deletions net/http/http_request_headers.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
35 changes: 35 additions & 0 deletions net/http/http_response_info.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
14 changes: 9 additions & 5 deletions net/http/http_response_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions net/http/http_stream_parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
7 changes: 4 additions & 3 deletions net/http/http_stream_parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions net/socket/client_socket_pool_base_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "net/base/net_errors.h"
#include "net/base/request_priority.h"
#include "net/base/test_completion_callback.h"
#include "net/http/http_response_headers.h"
#include "net/socket/client_socket.h"
#include "net/socket/client_socket_factory.h"
#include "net/socket/client_socket_handle.h"
Expand Down
1 change: 1 addition & 0 deletions net/socket/ssl_client_socket_pool.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "net/socket/ssl_client_socket_pool.h"

#include "net/base/net_errors.h"
#include "net/base/ssl_cert_request_info.h"
#include "net/http/http_proxy_client_socket.h"
#include "net/http/http_proxy_client_socket_pool.h"
#include "net/socket/client_socket_factory.h"
Expand Down
1 change: 1 addition & 0 deletions net/socket_stream/socket_stream_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#include "base/callback.h"
#include "base/utf_string_conversions.h"
#include "net/base/auth.h"
#include "net/base/mock_host_resolver.h"
#include "net/base/net_log.h"
#include "net/base/net_log_unittest.h"
Expand Down
1 change: 1 addition & 0 deletions net/spdy/spdy_http_stream.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include "net/base/load_flags.h"
#include "net/base/net_util.h"
#include "net/http/http_request_info.h"
#include "net/http/http_response_headers.h"
#include "net/http/http_response_info.h"
#include "net/http/http_util.h"
#include "net/spdy/spdy_session.h"
Expand Down
1 change: 1 addition & 0 deletions net/websockets/websocket_handshake_handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "base/string_piece.h"
#include "base/string_util.h"
#include "googleurl/src/gurl.h"
#include "net/http/http_response_headers.h"
#include "net/http/http_util.h"

namespace {
Expand Down
1 change: 1 addition & 0 deletions net/websockets/websocket_handshake_handler_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "base/basictypes.h"
#include "base/string_util.h"
#include "googleurl/src/gurl.h"
#include "net/http/http_response_headers.h"
#include "net/http/http_util.h"
#include "net/websockets/websocket_handshake_handler.h"

Expand Down
1 change: 1 addition & 0 deletions webkit/appcache/appcache_response_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "base/waitable_event.h"
#include "net/base/io_buffer.h"
#include "net/base/net_errors.h"
#include "net/http/http_response_headers.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "webkit/appcache/appcache_response.h"
#include "webkit/appcache/mock_appcache_service.h"
Expand Down
1 change: 1 addition & 0 deletions webkit/appcache/appcache_update_job.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "net/base/load_flags.h"
#include "net/base/net_errors.h"
#include "net/http/http_request_headers.h"
#include "net/http/http_response_headers.h"
#include "webkit/appcache/appcache_group.h"
#include "webkit/appcache/appcache_policy.h"

Expand Down
1 change: 1 addition & 0 deletions webkit/appcache/appcache_update_job_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "base/thread.h"
#include "base/waitable_event.h"
#include "net/base/net_errors.h"
#include "net/http/http_response_headers.h"
#include "net/url_request/url_request_error_job.h"
#include "net/url_request/url_request_test_job.h"
#include "net/url_request/url_request_unittest.h"
Expand Down
1 change: 1 addition & 0 deletions webkit/appcache/appcache_url_request_job.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "net/base/net_errors.h"
#include "net/base/net_log.h"
#include "net/http/http_request_headers.h"
#include "net/http/http_response_headers.h"
#include "net/http/http_util.h"
#include "net/url_request/url_request.h"
#include "net/url_request/url_request_status.h"
Expand Down
1 change: 1 addition & 0 deletions webkit/appcache/appcache_url_request_job_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "base/thread.h"
#include "base/waitable_event.h"
#include "net/base/net_errors.h"
#include "net/http/http_response_headers.h"
#include "net/url_request/url_request.h"
#include "net/url_request/url_request_error_job.h"
#include "net/base/io_buffer.h"
Expand Down

0 comments on commit 277d594

Please sign in to comment.