summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorerg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-31 18:00:53 +0000
committererg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-31 18:00:53 +0000
commit9349cfb12f1b27e30ebb5d4ffc994812cce26d59 (patch)
treec98a55495b06a5cd068c251d2e217cf89cef6c02 /net
parent1c77d22487ac4759f29d329be7493228671bc05f (diff)
downloadchromium_src-9349cfb12f1b27e30ebb5d4ffc994812cce26d59.zip
chromium_src-9349cfb12f1b27e30ebb5d4ffc994812cce26d59.tar.gz
chromium_src-9349cfb12f1b27e30ebb5d4ffc994812cce26d59.tar.bz2
FBTF: A giant cleanup to net/
This moves all sorts of code from h files to cc files and reduces header dependencies. BUG=none TEST=compiles Review URL: http://codereview.chromium.org/3212008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58020 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r--net/base/auth.cc28
-rw-r--r--net/base/auth.h15
-rw-r--r--net/base/host_resolver.cc10
-rw-r--r--net/base/host_resolver.h9
-rw-r--r--net/base/host_resolver_proc.cc3
-rw-r--r--net/base/host_resolver_proc.h2
-rw-r--r--net/base/net_log.cc3
-rw-r--r--net/base/net_log.h2
-rw-r--r--net/base/ssl_cert_request_info.cc17
-rw-r--r--net/base/ssl_cert_request_info.h4
-rw-r--r--net/base/ssl_info.cc47
-rw-r--r--net/base/ssl_info.h21
-rw-r--r--net/base/upload_data.cc62
-rw-r--r--net/base/upload_data.h51
-rw-r--r--net/base/upload_data_stream_unittest.cc4
-rw-r--r--net/http/http_cache_transaction.cc1
-rw-r--r--net/http/http_cache_unittest.cc1
-rw-r--r--net/http/http_network_session.cc1
-rw-r--r--net/http/http_network_transaction_unittest.cc6
-rw-r--r--net/http/http_response_headers.cc6
-rw-r--r--net/http/http_response_headers.h4
-rw-r--r--net/http/http_response_info.cc1
-rw-r--r--net/http/http_stream_handle.cc82
-rw-r--r--net/http/http_stream_handle.h68
-rw-r--r--net/net.gyp4
-rw-r--r--net/proxy/proxy_bypass_rules.cc12
-rw-r--r--net/proxy/proxy_bypass_rules.h4
-rw-r--r--net/socket/client_socket_pool_base.cc1
-rw-r--r--net/socket/ssl_client_socket_win.cc1
-rw-r--r--net/socket_stream/socket_stream.h1
-rw-r--r--net/tools/fetch/http_server.h1
-rw-r--r--net/url_request/url_request.cc48
-rw-r--r--net/url_request/url_request.h29
-rw-r--r--net/url_request/url_request_about_job.cc3
-rw-r--r--net/url_request/url_request_about_job.h2
-rw-r--r--net/url_request/url_request_context.cc15
-rw-r--r--net/url_request/url_request_context.h17
-rw-r--r--net/url_request/url_request_http_job.cc1
-rw-r--r--net/websockets/websocket.cc1
39 files changed, 421 insertions, 167 deletions
diff --git a/net/base/auth.cc b/net/base/auth.cc
new file mode 100644
index 0000000..08b869c
--- /dev/null
+++ b/net/base/auth.cc
@@ -0,0 +1,28 @@
+// Copyright (c) 2010 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.
+
+#include "net/base/auth.h"
+
+namespace net {
+
+AuthChallengeInfo::AuthChallengeInfo() : is_proxy(false) {
+}
+
+bool AuthChallengeInfo::operator==(const AuthChallengeInfo& that) const {
+ return (this->is_proxy == that.is_proxy &&
+ this->host_and_port == that.host_and_port &&
+ this->scheme == that.scheme &&
+ this->realm == that.realm);
+}
+
+AuthChallengeInfo::~AuthChallengeInfo() {
+}
+
+AuthData::AuthData() : state(AUTH_STATE_NEED_AUTH) {
+}
+
+AuthData::~AuthData() {
+}
+
+} // namespace net
diff --git a/net/base/auth.h b/net/base/auth.h
index 20c4f5c..908b7690 100644
--- a/net/base/auth.h
+++ b/net/base/auth.h
@@ -18,12 +18,9 @@ namespace net {
class AuthChallengeInfo :
public base::RefCountedThreadSafe<AuthChallengeInfo> {
public:
- bool operator==(const AuthChallengeInfo& that) const {
- return (this->is_proxy == that.is_proxy &&
- this->host_and_port == that.host_and_port &&
- this->scheme == that.scheme &&
- this->realm == that.realm);
- }
+ AuthChallengeInfo();
+
+ bool operator==(const AuthChallengeInfo& that) const;
bool operator!=(const AuthChallengeInfo& that) const {
return !(*this == that);
@@ -37,7 +34,7 @@ class AuthChallengeInfo :
private:
friend class base::RefCountedThreadSafe<AuthChallengeInfo>;
- ~AuthChallengeInfo() {}
+ ~AuthChallengeInfo();
};
// Authentication structures
@@ -56,11 +53,11 @@ class AuthData : public base::RefCountedThreadSafe<AuthData> {
string16 password; // the password supplied to us for auth.
// We wouldn't instantiate this class if we didn't need authentication.
- AuthData() : state(AUTH_STATE_NEED_AUTH) {}
+ AuthData();
private:
friend class base::RefCountedThreadSafe<AuthData>;
- ~AuthData() {}
+ ~AuthData();
};
} // namespace net
diff --git a/net/base/host_resolver.cc b/net/base/host_resolver.cc
index 320406c..596c7df 100644
--- a/net/base/host_resolver.cc
+++ b/net/base/host_resolver.cc
@@ -10,6 +10,16 @@
namespace net {
+HostResolver::RequestInfo::RequestInfo(const std::string& hostname, int port)
+ : hostname_(hostname),
+ address_family_(ADDRESS_FAMILY_UNSPECIFIED),
+ host_resolver_flags_(0),
+ port_(port),
+ allow_cached_response_(true),
+ is_speculative_(false),
+ priority_(MEDIUM) {
+}
+
SingleRequestHostResolver::SingleRequestHostResolver(HostResolver* resolver)
: resolver_(resolver),
cur_request_(NULL),
diff --git a/net/base/host_resolver.h b/net/base/host_resolver.h
index 664dfb3..61fbc3b 100644
--- a/net/base/host_resolver.h
+++ b/net/base/host_resolver.h
@@ -36,14 +36,7 @@ class HostResolver : public base::RefCounted<HostResolver> {
// the rest are optional (and have reasonable defaults).
class RequestInfo {
public:
- RequestInfo(const std::string& hostname, int port)
- : hostname_(hostname),
- address_family_(ADDRESS_FAMILY_UNSPECIFIED),
- host_resolver_flags_(0),
- port_(port),
- allow_cached_response_(true),
- is_speculative_(false),
- priority_(MEDIUM) {}
+ RequestInfo(const std::string& hostname, int port);
int port() const { return port_; }
void set_port(int port) {
diff --git a/net/base/host_resolver_proc.cc b/net/base/host_resolver_proc.cc
index 9ae4020..fd350df 100644
--- a/net/base/host_resolver_proc.cc
+++ b/net/base/host_resolver_proc.cc
@@ -62,6 +62,9 @@ HostResolverProc* HostResolverProc::GetDefault() {
return default_proc_;
}
+HostResolverProc::~HostResolverProc() {
+}
+
int HostResolverProc::ResolveUsingPrevious(
const std::string& host,
AddressFamily address_family,
diff --git a/net/base/host_resolver_proc.h b/net/base/host_resolver_proc.h
index d86e4559..f20d71a 100644
--- a/net/base/host_resolver_proc.h
+++ b/net/base/host_resolver_proc.h
@@ -39,7 +39,7 @@ class HostResolverProc : public base::RefCountedThreadSafe<HostResolverProc> {
protected:
friend class base::RefCountedThreadSafe<HostResolverProc>;
- virtual ~HostResolverProc() {}
+ virtual ~HostResolverProc();
// Asks the fallback procedure (if set) to do the resolve.
int ResolveUsingPrevious(const std::string& host,
diff --git a/net/base/net_log.cc b/net/base/net_log.cc
index c91306c..734cef1 100644
--- a/net/base/net_log.cc
+++ b/net/base/net_log.cc
@@ -161,6 +161,9 @@ NetLogStringParameter::NetLogStringParameter(const char* name,
: name_(name), value_(value) {
}
+NetLogStringParameter::~NetLogStringParameter() {
+}
+
Value* NetLogIntegerParameter::ToValue() const {
DictionaryValue* dict = new DictionaryValue();
dict->SetInteger(name_, value_);
diff --git a/net/base/net_log.h b/net/base/net_log.h
index fc6d9b5..d6eca7c 100644
--- a/net/base/net_log.h
+++ b/net/base/net_log.h
@@ -11,7 +11,6 @@
#include "base/basictypes.h"
#include "base/ref_counted.h"
-#include "base/values.h"
class Value;
@@ -198,6 +197,7 @@ class NetLogStringParameter : public NetLog::EventParameters {
public:
// |name| must be a string literal.
NetLogStringParameter(const char* name, const std::string& value);
+ virtual ~NetLogStringParameter();
const std::string& value() const {
return value_;
diff --git a/net/base/ssl_cert_request_info.cc b/net/base/ssl_cert_request_info.cc
new file mode 100644
index 0000000..bb91632
--- /dev/null
+++ b/net/base/ssl_cert_request_info.cc
@@ -0,0 +1,17 @@
+// Copyright (c) 2010 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.
+
+#include "net/base/ssl_cert_request_info.h"
+
+#include "net/base/x509_certificate.h"
+
+namespace net {
+
+SSLCertRequestInfo::SSLCertRequestInfo() {
+}
+
+SSLCertRequestInfo::~SSLCertRequestInfo() {
+}
+
+} // namespace net
diff --git a/net/base/ssl_cert_request_info.h b/net/base/ssl_cert_request_info.h
index feabb1e..22eecfe 100644
--- a/net/base/ssl_cert_request_info.h
+++ b/net/base/ssl_cert_request_info.h
@@ -20,6 +20,8 @@ class X509Certificate;
class SSLCertRequestInfo
: public base::RefCountedThreadSafe<SSLCertRequestInfo> {
public:
+ SSLCertRequestInfo();
+
// The host and port of the SSL server that requested client authentication.
std::string host_and_port;
@@ -42,7 +44,7 @@ class SSLCertRequestInfo
private:
friend class base::RefCountedThreadSafe<SSLCertRequestInfo>;
- ~SSLCertRequestInfo() {}
+ ~SSLCertRequestInfo();
};
} // namespace net
diff --git a/net/base/ssl_info.cc b/net/base/ssl_info.cc
new file mode 100644
index 0000000..1b60644
--- /dev/null
+++ b/net/base/ssl_info.cc
@@ -0,0 +1,47 @@
+// Copyright (c) 2010 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.
+
+#include "net/base/ssl_info.h"
+
+#include "net/base/cert_status_flags.h"
+#include "net/base/x509_certificate.h"
+
+namespace net {
+
+SSLInfo::SSLInfo()
+ : cert_status(0),
+ security_bits(-1),
+ connection_status(0) {
+}
+
+SSLInfo::SSLInfo(const SSLInfo& info)
+ : cert(info.cert),
+ cert_status(info.cert_status),
+ security_bits(info.security_bits),
+ connection_status(info.connection_status) {
+}
+
+SSLInfo::~SSLInfo() {
+}
+
+SSLInfo& SSLInfo::operator=(const SSLInfo& info) {
+ cert = info.cert;
+ cert_status = info.cert_status;
+ security_bits = info.security_bits;
+ connection_status = info.connection_status;
+ return *this;
+}
+
+void SSLInfo::Reset() {
+ cert = NULL;
+ cert_status = 0;
+ security_bits = -1;
+ connection_status = 0;
+}
+
+void SSLInfo::SetCertError(int error) {
+ cert_status |= MapNetErrorToCertStatus(error);
+}
+
+} // namespace net
diff --git a/net/base/ssl_info.h b/net/base/ssl_info.h
index d6103c9..1786b58 100644
--- a/net/base/ssl_info.h
+++ b/net/base/ssl_info.h
@@ -6,30 +6,27 @@
#define NET_BASE_SSL_INFO_H_
#pragma once
-#include "net/base/cert_status_flags.h"
-#include "net/base/x509_certificate.h"
+#include "base/ref_counted.h"
namespace net {
+class X509Certificate;
+
// SSL connection info.
// This is really a struct. All members are public.
class SSLInfo {
public:
- SSLInfo() : cert_status(0), security_bits(-1), connection_status(0) { }
+ SSLInfo();
+ SSLInfo(const SSLInfo& info);
+ ~SSLInfo();
+ SSLInfo& operator=(const SSLInfo& info);
- void Reset() {
- cert = NULL;
- cert_status = 0;
- security_bits = -1;
- connection_status = 0;
- }
+ void Reset();
bool is_valid() const { return cert != NULL; }
// Adds the specified |error| to the cert status.
- void SetCertError(int error) {
- cert_status |= MapNetErrorToCertStatus(error);
- }
+ void SetCertError(int error);
// The SSL certificate.
scoped_refptr<X509Certificate> cert;
diff --git a/net/base/upload_data.cc b/net/base/upload_data.cc
index f852d27..774dc5c 100644
--- a/net/base/upload_data.cc
+++ b/net/base/upload_data.cc
@@ -6,16 +6,23 @@
#include "base/file_util.h"
#include "base/logging.h"
+#include "net/base/file_stream.h"
#include "net/base/net_errors.h"
namespace net {
-uint64 UploadData::GetContentLength() {
- uint64 len = 0;
- std::vector<Element>::iterator it = elements_.begin();
- for (; it != elements_.end(); ++it)
- len += (*it).GetContentLength();
- return len;
+UploadData::Element::Element()
+ : type_(TYPE_BYTES),
+ file_range_offset_(0),
+ file_range_length_(kuint64max),
+ override_content_length_(false),
+ content_length_computed_(false),
+ file_stream_(NULL) {
+}
+
+UploadData::Element::~Element() {
+ // In the common case |file__stream_| will be null.
+ delete file_stream_;
}
uint64 UploadData::Element::GetContentLength() {
@@ -89,4 +96,47 @@ FileStream* UploadData::Element::NewFileStreamForReading() {
return file.release();
}
+UploadData::UploadData() : identifier_(0) {
+}
+
+void UploadData::AppendBytes(const char* bytes, int bytes_len) {
+ if (bytes_len > 0) {
+ elements_.push_back(Element());
+ elements_.back().SetToBytes(bytes, bytes_len);
+ }
+}
+
+void UploadData::AppendFile(const FilePath& file_path) {
+ elements_.push_back(Element());
+ elements_.back().SetToFilePath(file_path);
+}
+
+void UploadData::AppendFileRange(const FilePath& file_path,
+ uint64 offset, uint64 length,
+ const base::Time& expected_modification_time) {
+ elements_.push_back(Element());
+ elements_.back().SetToFilePathRange(file_path, offset, length,
+ expected_modification_time);
+}
+
+void UploadData::AppendBlob(const GURL& blob_url) {
+ elements_.push_back(Element());
+ elements_.back().SetToBlobUrl(blob_url);
+}
+
+uint64 UploadData::GetContentLength() {
+ uint64 len = 0;
+ std::vector<Element>::iterator it = elements_.begin();
+ for (; it != elements_.end(); ++it)
+ len += (*it).GetContentLength();
+ return len;
+}
+
+void UploadData::SetElements(const std::vector<Element>& elements) {
+ elements_ = elements;
+}
+
+UploadData::~UploadData() {
+}
+
} // namespace net
diff --git a/net/base/upload_data.h b/net/base/upload_data.h
index 53c5498..6f72162 100644
--- a/net/base/upload_data.h
+++ b/net/base/upload_data.h
@@ -13,15 +13,14 @@
#include "base/gtest_prod_util.h"
#include "base/ref_counted.h"
#include "googleurl/src/gurl.h"
-#include "net/base/file_stream.h"
#include "base/time.h"
namespace net {
+class FileStream;
+
class UploadData : public base::RefCounted<UploadData> {
public:
- UploadData() : identifier_(0) {}
-
enum Type {
TYPE_BYTES,
TYPE_FILE,
@@ -30,17 +29,8 @@ class UploadData : public base::RefCounted<UploadData> {
class Element {
public:
- Element() : type_(TYPE_BYTES), file_range_offset_(0),
- file_range_length_(kuint64max),
- override_content_length_(false),
- content_length_computed_(false),
- file_stream_(NULL) {
- }
-
- ~Element() {
- // In the common case |file__stream_| will be null.
- delete file_stream_;
- }
+ Element();
+ ~Element();
Type type() const { return type_; }
const std::vector<char>& bytes() const { return bytes_; }
@@ -117,30 +107,17 @@ class UploadData : public base::RefCounted<UploadData> {
UploadFileSmallerThanLength);
};
- void AppendBytes(const char* bytes, int bytes_len) {
- if (bytes_len > 0) {
- elements_.push_back(Element());
- elements_.back().SetToBytes(bytes, bytes_len);
- }
- }
+ UploadData();
- void AppendFile(const FilePath& file_path) {
- elements_.push_back(Element());
- elements_.back().SetToFilePath(file_path);
- }
+ void AppendBytes(const char* bytes, int bytes_len);
+
+ void AppendFile(const FilePath& file_path);
void AppendFileRange(const FilePath& file_path,
uint64 offset, uint64 length,
- const base::Time& expected_modification_time) {
- elements_.push_back(Element());
- elements_.back().SetToFilePathRange(file_path, offset, length,
- expected_modification_time);
- }
+ const base::Time& expected_modification_time);
- void AppendBlob(const GURL& blob_url) {
- elements_.push_back(Element());
- elements_.back().SetToBlobUrl(blob_url);
- }
+ void AppendBlob(const GURL& blob_url);
// Returns the total size in bytes of the data to upload.
uint64 GetContentLength();
@@ -149,9 +126,7 @@ class UploadData : public base::RefCounted<UploadData> {
return &elements_;
}
- void set_elements(const std::vector<Element>& elements) {
- elements_ = elements;
- }
+ void SetElements(const std::vector<Element>& elements);
void swap_elements(std::vector<Element>* elements) {
elements_.swap(*elements);
@@ -166,10 +141,12 @@ class UploadData : public base::RefCounted<UploadData> {
private:
friend class base::RefCounted<UploadData>;
- ~UploadData() {}
+ ~UploadData();
std::vector<Element> elements_;
int64 identifier_;
+
+ DISALLOW_COPY_AND_ASSIGN(UploadData);
};
#if defined(UNIT_TEST)
diff --git a/net/base/upload_data_stream_unittest.cc b/net/base/upload_data_stream_unittest.cc
index 92c065e..5fd9666 100644
--- a/net/base/upload_data_stream_unittest.cc
+++ b/net/base/upload_data_stream_unittest.cc
@@ -66,7 +66,7 @@ TEST_F(UploadDataStreamTest, FileSmallerThanLength) {
element.SetToFilePath(temp_file_path);
element.SetContentLength(kFakeSize);
elements.push_back(element);
- upload_data_->set_elements(elements);
+ upload_data_->SetElements(elements);
EXPECT_EQ(kFakeSize, upload_data_->GetContentLength());
scoped_ptr<UploadDataStream> stream(
@@ -92,7 +92,7 @@ void UploadDataStreamTest::FileChangedHelper(const FilePath& file_path,
UploadData::Element element;
element.SetToFilePathRange(file_path, 1, 2, time);
elements.push_back(element);
- upload_data_->set_elements(elements);
+ upload_data_->SetElements(elements);
int error_code;
scoped_ptr<UploadDataStream> stream(
diff --git a/net/http/http_cache_transaction.cc b/net/http/http_cache_transaction.cc
index 5632563..b7a56f6 100644
--- a/net/http/http_cache_transaction.cc
+++ b/net/http/http_cache_transaction.cc
@@ -18,6 +18,7 @@
#include "base/ref_counted.h"
#include "base/string_util.h"
#include "base/time.h"
+#include "net/base/cert_status_flags.h"
#include "net/base/io_buffer.h"
#include "net/base/load_flags.h"
#include "net/base/net_errors.h"
diff --git a/net/http/http_cache_unittest.cc b/net/http/http_cache_unittest.cc
index b5704cd..86b5e0f 100644
--- a/net/http/http_cache_unittest.cc
+++ b/net/http/http_cache_unittest.cc
@@ -9,6 +9,7 @@
#include "base/scoped_vector.h"
#include "base/string_util.h"
#include "net/base/cache_type.h"
+#include "net/base/cert_status_flags.h"
#include "net/base/net_errors.h"
#include "net/base/load_flags.h"
#include "net/base/net_log_unittest.h"
diff --git a/net/http/http_network_session.cc b/net/http/http_network_session.cc
index 718d2cd..9a563dc 100644
--- a/net/http/http_network_session.cc
+++ b/net/http/http_network_session.cc
@@ -9,6 +9,7 @@
#include "base/logging.h"
#include "base/stl_util-inl.h"
#include "base/string_util.h"
+#include "base/values.h"
#include "net/http/http_auth_handler_factory.h"
#include "net/http/url_security_manager.h"
#include "net/spdy/spdy_session_pool.h"
diff --git a/net/http/http_network_transaction_unittest.cc b/net/http/http_network_transaction_unittest.cc
index 81c26fa..5d21eba 100644
--- a/net/http/http_network_transaction_unittest.cc
+++ b/net/http/http_network_transaction_unittest.cc
@@ -5245,7 +5245,7 @@ TEST_F(HttpNetworkTransactionTest, UploadFileSmallerThanLength) {
element.SetToFilePath(temp_file_path);
element.SetContentLength(kFakeSize);
elements.push_back(element);
- request.upload_data->set_elements(elements);
+ request.upload_data->SetElements(elements);
EXPECT_EQ(kFakeSize, request.upload_data->GetContentLength());
MockRead data_reads[] = {
@@ -5302,7 +5302,7 @@ TEST_F(HttpNetworkTransactionTest, UploadUnreadableFile) {
UploadData::Element element;
element.SetToFilePath(temp_file);
elements.push_back(element);
- request.upload_data->set_elements(elements);
+ request.upload_data->SetElements(elements);
MockRead data_reads[] = {
MockRead("HTTP/1.0 200 OK\r\n\r\n"),
@@ -5357,7 +5357,7 @@ TEST_F(HttpNetworkTransactionTest, UnreadableUploadFileAfterAuthRestart) {
UploadData::Element element;
element.SetToFilePath(temp_file);
elements.push_back(element);
- request.upload_data->set_elements(elements);
+ request.upload_data->SetElements(elements);
MockRead data_reads[] = {
MockRead("HTTP/1.1 401 Unauthorized\r\n"),
diff --git a/net/http/http_response_headers.cc b/net/http/http_response_headers.cc
index ba85ac72..631b3a1 100644
--- a/net/http/http_response_headers.cc
+++ b/net/http/http_response_headers.cc
@@ -494,6 +494,12 @@ bool HttpResponseHeaders::HasHeader(const std::string& name) const {
return FindHeader(0, name) != std::string::npos;
}
+HttpResponseHeaders::HttpResponseHeaders() {
+}
+
+HttpResponseHeaders::~HttpResponseHeaders() {
+}
+
// Note: this implementation implicitly assumes that line_end points at a valid
// sentinel character (such as '\0').
// static
diff --git a/net/http/http_response_headers.h b/net/http/http_response_headers.h
index 5d116f6..8e011f8 100644
--- a/net/http/http_response_headers.h
+++ b/net/http/http_response_headers.h
@@ -251,8 +251,8 @@ class HttpResponseHeaders
typedef base::hash_set<std::string> HeaderSet;
- HttpResponseHeaders() {}
- ~HttpResponseHeaders() {}
+ HttpResponseHeaders();
+ ~HttpResponseHeaders();
// Initializes from the given raw headers.
void Parse(const std::string& raw_input);
diff --git a/net/http/http_response_info.cc b/net/http/http_response_info.cc
index a83a642..dc90d1f 100644
--- a/net/http/http_response_info.cc
+++ b/net/http/http_response_info.cc
@@ -11,6 +11,7 @@
#include "net/base/io_buffer.h"
#include "net/base/net_errors.h"
#include "net/base/ssl_cert_request_info.h"
+#include "net/base/x509_certificate.h"
#include "net/http/http_response_headers.h"
using base::Time;
diff --git a/net/http/http_stream_handle.cc b/net/http/http_stream_handle.cc
new file mode 100644
index 0000000..d2ad0f0
--- /dev/null
+++ b/net/http/http_stream_handle.cc
@@ -0,0 +1,82 @@
+// Copyright (c) 2010 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.
+
+#include "net/http/http_stream_handle.h"
+
+namespace net {
+
+HttpStreamHandle::HttpStreamHandle(ClientSocketHandle* connection,
+ HttpStream* stream)
+ : connection_(connection), stream_(stream) {
+ DCHECK(stream_.get());
+}
+
+HttpStreamHandle::~HttpStreamHandle() {
+}
+
+int HttpStreamHandle::InitializeStream(const HttpRequestInfo* request_info,
+ const BoundNetLog& net_log,
+ CompletionCallback* callback) {
+ return stream_->InitializeStream(request_info, net_log, callback);
+}
+
+int HttpStreamHandle::SendRequest(const std::string& request_headers,
+ UploadDataStream* request_body,
+ HttpResponseInfo* response,
+ CompletionCallback* callback) {
+ return stream_->SendRequest(request_headers, request_body, response,
+ callback);
+}
+
+uint64 HttpStreamHandle::GetUploadProgress() const {
+ return stream_->GetUploadProgress();
+}
+
+int HttpStreamHandle::ReadResponseHeaders(CompletionCallback* callback) {
+ return stream_->ReadResponseHeaders(callback);
+}
+
+const HttpResponseInfo* HttpStreamHandle::GetResponseInfo() const {
+ return stream_->GetResponseInfo();
+}
+
+int HttpStreamHandle::ReadResponseBody(IOBuffer* buf, int buf_len,
+ CompletionCallback* callback) {
+ return stream_->ReadResponseBody(buf, buf_len, callback);
+}
+
+void HttpStreamHandle::Close(bool not_reusable) {
+ stream_->Close(not_reusable);
+}
+
+bool HttpStreamHandle::IsResponseBodyComplete() const {
+ return stream_->IsResponseBodyComplete();
+}
+
+bool HttpStreamHandle::CanFindEndOfResponse() const {
+ return stream_->CanFindEndOfResponse();
+}
+
+bool HttpStreamHandle::IsMoreDataBuffered() const {
+ return stream_->IsMoreDataBuffered();
+}
+
+bool HttpStreamHandle::IsConnectionReused() const {
+ return stream_->IsConnectionReused();
+}
+
+void HttpStreamHandle::SetConnectionReused() {
+ stream_->SetConnectionReused();
+}
+
+void HttpStreamHandle::GetSSLInfo(SSLInfo* ssl_info) {
+ stream_->GetSSLInfo(ssl_info);
+}
+
+void HttpStreamHandle::GetSSLCertRequestInfo(
+ SSLCertRequestInfo* cert_request_info) {
+ stream_->GetSSLCertRequestInfo(cert_request_info);
+}
+
+} // namespace net
diff --git a/net/http/http_stream_handle.h b/net/http/http_stream_handle.h
index 07e7d69..a328ff2 100644
--- a/net/http/http_stream_handle.h
+++ b/net/http/http_stream_handle.h
@@ -1,15 +1,15 @@
// Copyright (c) 2010 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.
-//
+
#ifndef NET_HTTP_HTTP_STREAM_HANDLE_H_
#define NET_HTTP_HTTP_STREAM_HANDLE_H_
#pragma once
#include <string>
+#include "base/gtest_prod_util.h"
#include "net/http/http_stream.h"
-
#include "net/socket/client_socket_handle.h"
namespace net {
@@ -23,77 +23,45 @@ struct HttpRequestInfo;
// underlying ClientSocketHandle manually.
class HttpStreamHandle : public HttpStream {
public:
- HttpStreamHandle(ClientSocketHandle* connection, HttpStream* stream)
- : connection_(connection), stream_(stream) {
- DCHECK(stream_.get());
- }
- virtual ~HttpStreamHandle() {}
+ HttpStreamHandle(ClientSocketHandle* connection, HttpStream* stream);
+ virtual ~HttpStreamHandle();
HttpStream* stream() { return stream_.get(); }
// HttpStream interface
int InitializeStream(const HttpRequestInfo* request_info,
const BoundNetLog& net_log,
- CompletionCallback* callback) {
- return stream_->InitializeStream(request_info, net_log, callback);
- }
+ CompletionCallback* callback);
int SendRequest(const std::string& request_headers,
UploadDataStream* request_body,
HttpResponseInfo* response,
- CompletionCallback* callback) {
- return stream_->SendRequest(request_headers, request_body, response,
- callback);
- }
+ CompletionCallback* callback);
- uint64 GetUploadProgress() const {
- return stream_->GetUploadProgress();
- }
+ uint64 GetUploadProgress() const;
- int ReadResponseHeaders(CompletionCallback* callback) {
- return stream_->ReadResponseHeaders(callback);
- }
+ int ReadResponseHeaders(CompletionCallback* callback);
- const HttpResponseInfo* GetResponseInfo() const {
- return stream_->GetResponseInfo();
- }
+ const HttpResponseInfo* GetResponseInfo() const;
int ReadResponseBody(IOBuffer* buf, int buf_len,
- CompletionCallback* callback) {
- return stream_->ReadResponseBody(buf, buf_len, callback);
- }
+ CompletionCallback* callback);
- void Close(bool not_reusable) {
- stream_->Close(not_reusable);
- }
+ void Close(bool not_reusable);
- bool IsResponseBodyComplete() const {
- return stream_->IsResponseBodyComplete();
- }
+ bool IsResponseBodyComplete() const;
- bool CanFindEndOfResponse() const {
- return stream_->CanFindEndOfResponse();
- }
+ bool CanFindEndOfResponse() const;
- bool IsMoreDataBuffered() const {
- return stream_->IsMoreDataBuffered();
- }
+ bool IsMoreDataBuffered() const;
- bool IsConnectionReused() const {
- return stream_->IsConnectionReused();
- }
+ bool IsConnectionReused() const;
- void SetConnectionReused() {
- stream_->SetConnectionReused();
- }
+ void SetConnectionReused();
- void GetSSLInfo(SSLInfo* ssl_info) {
- stream_->GetSSLInfo(ssl_info);
- }
+ void GetSSLInfo(SSLInfo* ssl_info);
- void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info) {
- stream_->GetSSLCertRequestInfo(cert_request_info);
- }
+ void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info);
private:
FRIEND_TEST_ALL_PREFIXES(SpdyNetworkTransactionTest, WindowUpdateSent);
diff --git a/net/net.gyp b/net/net.gyp
index 57c6300..74a8638 100644
--- a/net/net.gyp
+++ b/net/net.gyp
@@ -26,6 +26,7 @@
'base/address_list.h',
'base/address_list_net_log_param.cc',
'base/address_list_net_log_param.h',
+ 'base/auth.cc',
'base/auth.h',
'base/cache_type.h',
'base/capturing_net_log.cc',
@@ -150,6 +151,7 @@
'base/sdch_filter.h',
'base/sdch_manager.cc',
'base/sdch_manager.h',
+ 'base/ssl_cert_request_info.cc',
'base/ssl_cert_request_info.h',
'base/ssl_cipher_suite_names.cc',
'base/ssl_cipher_suite_names.h',
@@ -162,6 +164,7 @@
'base/ssl_config_service_mac.h',
'base/ssl_config_service_win.cc',
'base/ssl_config_service_win.h',
+ 'base/ssl_info.cc',
'base/ssl_info.h',
'base/static_cookie_policy.cc',
'base/static_cookie_policy.h',
@@ -404,6 +407,7 @@
'http/http_stream.h',
'http/http_stream_factory.cc',
'http/http_stream_factory.h',
+ 'http/http_stream_handle.cc',
'http/http_stream_handle.h',
'http/http_stream_parser.cc',
'http/http_stream_parser.h',
diff --git a/net/proxy/proxy_bypass_rules.cc b/net/proxy/proxy_bypass_rules.cc
index 02d8e3f..987543a 100644
--- a/net/proxy/proxy_bypass_rules.cc
+++ b/net/proxy/proxy_bypass_rules.cc
@@ -123,9 +123,21 @@ bool IsIPAddress(const std::string& domain) {
} // namespace
+ProxyBypassRules::ProxyBypassRules() {
+}
+
+ProxyBypassRules::ProxyBypassRules(const ProxyBypassRules& rhs)
+ : rules_(rhs.rules_) {
+}
+
ProxyBypassRules::~ProxyBypassRules() {
}
+ProxyBypassRules& ProxyBypassRules::operator=(const ProxyBypassRules& rhs) {
+ rules_ = rhs.rules_;
+ return *this;
+}
+
bool ProxyBypassRules::Matches(const GURL& url) const {
for (RuleList::const_iterator it = rules_.begin(); it != rules_.end(); ++it) {
if ((*it)->Matches(url))
diff --git a/net/proxy/proxy_bypass_rules.h b/net/proxy/proxy_bypass_rules.h
index f66984b..9873154 100644
--- a/net/proxy/proxy_bypass_rules.h
+++ b/net/proxy/proxy_bypass_rules.h
@@ -43,8 +43,10 @@ class ProxyBypassRules {
typedef std::vector<scoped_refptr<Rule> > RuleList;
// Note: This class supports copy constructor and assignment.
-
+ ProxyBypassRules();
+ ProxyBypassRules(const ProxyBypassRules& rhs);
~ProxyBypassRules();
+ ProxyBypassRules& operator=(const ProxyBypassRules& rhs);
// Returns the current list of rules.
const RuleList& rules() const { return rules_; }
diff --git a/net/socket/client_socket_pool_base.cc b/net/socket/client_socket_pool_base.cc
index 379c041..2428afa 100644
--- a/net/socket/client_socket_pool_base.cc
+++ b/net/socket/client_socket_pool_base.cc
@@ -11,6 +11,7 @@
#include "base/stl_util-inl.h"
#include "base/string_util.h"
#include "base/time.h"
+#include "base/values.h"
#include "net/base/net_log.h"
#include "net/base/net_errors.h"
#include "net/socket/client_socket_handle.h"
diff --git a/net/socket/ssl_client_socket_win.cc b/net/socket/ssl_client_socket_win.cc
index cb6e91e..1bf704c 100644
--- a/net/socket/ssl_client_socket_win.cc
+++ b/net/socket/ssl_client_socket_win.cc
@@ -5,6 +5,7 @@
#include "net/socket/ssl_client_socket_win.h"
#include <schnlsp.h>
+#include <map>
#include "base/compiler_specific.h"
#include "base/lock.h"
diff --git a/net/socket_stream/socket_stream.h b/net/socket_stream/socket_stream.h
index edc616f..aaf48de 100644
--- a/net/socket_stream/socket_stream.h
+++ b/net/socket_stream/socket_stream.h
@@ -20,6 +20,7 @@
#include "net/base/io_buffer.h"
#include "net/base/net_log.h"
#include "net/base/net_errors.h"
+#include "net/base/ssl_config_service.h"
#include "net/http/http_auth.h"
#include "net/http/http_auth_cache.h"
#include "net/http/http_auth_handler.h"
diff --git a/net/tools/fetch/http_server.h b/net/tools/fetch/http_server.h
index 5b1692a..fc37728 100644
--- a/net/tools/fetch/http_server.h
+++ b/net/tools/fetch/http_server.h
@@ -7,6 +7,7 @@
#pragma once
#include "base/basictypes.h"
+#include "base/scoped_ptr.h"
#include "net/tools/fetch/http_session.h"
// Implements a simple, single-threaded HttpServer.
diff --git a/net/url_request/url_request.cc b/net/url_request/url_request.cc
index 3ed7d92..c87d9a3 100644
--- a/net/url_request/url_request.cc
+++ b/net/url_request/url_request.cc
@@ -45,6 +45,54 @@ void StripPostSpecificHeaders(net::HttpRequestHeaders* headers) {
} // namespace
///////////////////////////////////////////////////////////////////////////////
+// URLRequest::Interceptor
+
+URLRequestJob* URLRequest::Interceptor::MaybeInterceptRedirect(
+ URLRequest* request,
+ const GURL& location) {
+ return NULL;
+}
+
+URLRequestJob* URLRequest::Interceptor::MaybeInterceptResponse(
+ URLRequest* request) {
+ return NULL;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// URLRequest::Delegate
+
+void URLRequest::Delegate::OnReceivedRedirect(URLRequest* request,
+ const GURL& new_url,
+ bool* defer_redirect) {
+}
+
+void URLRequest::Delegate::OnAuthRequired(URLRequest* request,
+ net::AuthChallengeInfo* auth_info) {
+ request->CancelAuth();
+}
+
+void URLRequest::Delegate::OnCertificateRequested(
+ URLRequest* request,
+ net::SSLCertRequestInfo* cert_request_info) {
+ request->ContinueWithCertificate(NULL);
+}
+
+void URLRequest::Delegate::OnSSLCertificateError(URLRequest* request,
+ int cert_error,
+ net::X509Certificate* cert) {
+ request->Cancel();
+}
+
+void URLRequest::Delegate::OnGetCookies(URLRequest* request,
+ bool blocked_by_policy) {
+}
+
+void URLRequest::Delegate::OnSetCookie(URLRequest* request,
+ const std::string& cookie_line,
+ bool blocked_by_policy) {
+}
+
+///////////////////////////////////////////////////////////////////////////////
// URLRequest
URLRequest::URLRequest(const GURL& url, Delegate* delegate)
diff --git a/net/url_request/url_request.h b/net/url_request/url_request.h
index 3f06954..31b732e 100644
--- a/net/url_request/url_request.h
+++ b/net/url_request/url_request.h
@@ -90,9 +90,7 @@ class URLRequest : public NonThreadSafe {
// the delegate never sees the original redirect response, instead the
// response produced by the intercept job will be returned.
virtual URLRequestJob* MaybeInterceptRedirect(URLRequest* request,
- const GURL& location) {
- return NULL;
- }
+ const GURL& location);
// Called after having received a final response, but prior to the
// the request delegate being informed of the response. This is also
@@ -102,9 +100,7 @@ class URLRequest : public NonThreadSafe {
// continue. If a new job is provided, the delegate never sees the original
// response, instead the response produced by the intercept job will be
// returned.
- virtual URLRequestJob* MaybeInterceptResponse(URLRequest* request) {
- return NULL;
- }
+ virtual URLRequestJob* MaybeInterceptResponse(URLRequest* request);
};
// The delegate's methods are called from the message loop of the thread
@@ -152,8 +148,7 @@ class URLRequest : public NonThreadSafe {
// deferring redirect.
virtual void OnReceivedRedirect(URLRequest* request,
const GURL& new_url,
- bool* defer_redirect) {
- }
+ bool* defer_redirect);
// Called when we receive an authentication failure. The delegate should
// call request->SetAuth() with the user's credentials once it obtains them,
@@ -161,9 +156,7 @@ class URLRequest : public NonThreadSafe {
// When it does so, the request will be reissued, restarting the sequence
// of On* callbacks.
virtual void OnAuthRequired(URLRequest* request,
- net::AuthChallengeInfo* auth_info) {
- request->CancelAuth();
- }
+ net::AuthChallengeInfo* auth_info);
// Called when we receive an SSL CertificateRequest message for client
// authentication. The delegate should call
@@ -172,9 +165,7 @@ class URLRequest : public NonThreadSafe {
// handshake without a client certificate.
virtual void OnCertificateRequested(
URLRequest* request,
- net::SSLCertRequestInfo* cert_request_info) {
- request->ContinueWithCertificate(NULL);
- }
+ net::SSLCertRequestInfo* cert_request_info);
// Called when using SSL and the server responds with a certificate with
// an error, for example, whose common name does not match the common name
@@ -184,23 +175,19 @@ class URLRequest : public NonThreadSafe {
// indicating what's wrong with the certificate.
virtual void OnSSLCertificateError(URLRequest* request,
int cert_error,
- net::X509Certificate* cert) {
- request->Cancel();
- }
+ net::X509Certificate* cert);
// Called when reading cookies. |blocked_by_policy| is true if access to
// cookies was denied due to content settings. This method will never be
// invoked when LOAD_DO_NOT_SEND_COOKIES is specified.
- virtual void OnGetCookies(URLRequest* request, bool blocked_by_policy) {
- }
+ virtual void OnGetCookies(URLRequest* request, bool blocked_by_policy);
// Called when a cookie is set. |blocked_by_policy| is true if the cookie
// was rejected due to content settings. This method will never be invoked
// when LOAD_DO_NOT_SAVE_COOKIES is specified.
virtual void OnSetCookie(URLRequest* request,
const std::string& cookie_line,
- bool blocked_by_policy) {
- }
+ bool blocked_by_policy);
// After calling Start(), the delegate will receive an OnResponseStarted
// callback when the request has completed. If an error occurred, the
diff --git a/net/url_request/url_request_about_job.cc b/net/url_request/url_request_about_job.cc
index 917abf9..ac6aa01 100644
--- a/net/url_request/url_request_about_job.cc
+++ b/net/url_request/url_request_about_job.cc
@@ -32,6 +32,9 @@ bool URLRequestAboutJob::GetMimeType(std::string* mime_type) const {
return true;
}
+URLRequestAboutJob::~URLRequestAboutJob() {
+}
+
void URLRequestAboutJob::StartAsync() {
NotifyHeadersComplete();
}
diff --git a/net/url_request/url_request_about_job.h b/net/url_request/url_request_about_job.h
index f31ba0a..52a659e 100644
--- a/net/url_request/url_request_about_job.h
+++ b/net/url_request/url_request_about_job.h
@@ -21,7 +21,7 @@ class URLRequestAboutJob : public URLRequestJob {
static URLRequest::ProtocolFactory Factory;
private:
- ~URLRequestAboutJob() {}
+ ~URLRequestAboutJob();
void StartAsync();
};
diff --git a/net/url_request/url_request_context.cc b/net/url_request/url_request_context.cc
index b39843a..0ea8477 100644
--- a/net/url_request/url_request_context.cc
+++ b/net/url_request/url_request_context.cc
@@ -5,7 +5,22 @@
#include "net/url_request/url_request_context.h"
#include "base/string_util.h"
+#include "net/base/cookie_store.h"
+#include "net/base/host_resolver.h"
+
+URLRequestContext::URLRequestContext()
+ : net_log_(NULL),
+ http_transaction_factory_(NULL),
+ ftp_transaction_factory_(NULL),
+ http_auth_handler_factory_(NULL),
+ network_delegate_(NULL),
+ cookie_policy_(NULL),
+ transport_security_state_(NULL) {
+}
const std::string& URLRequestContext::GetUserAgent(const GURL& url) const {
return EmptyString();
}
+
+URLRequestContext::~URLRequestContext() {
+}
diff --git a/net/url_request/url_request_context.h b/net/url_request/url_request_context.h
index e72d27f..6ddc940 100644
--- a/net/url_request/url_request_context.h
+++ b/net/url_request/url_request_context.h
@@ -13,8 +13,6 @@
#include "base/non_thread_safe.h"
#include "base/ref_counted.h"
-#include "net/base/cookie_store.h"
-#include "net/base/host_resolver.h"
#include "net/base/net_log.h"
#include "net/base/ssl_config_service.h"
#include "net/base/transport_security_state.h"
@@ -23,10 +21,13 @@
namespace net {
class CookiePolicy;
+class CookieStore;
class FtpTransactionFactory;
+class HostResolver;
class HttpAuthHandlerFactory;
class HttpNetworkDelegate;
class HttpTransactionFactory;
+class SSLConfigService;
}
class URLRequest;
@@ -35,15 +36,7 @@ class URLRequestContext
: public base::RefCountedThreadSafe<URLRequestContext>,
public NonThreadSafe {
public:
- URLRequestContext()
- : net_log_(NULL),
- http_transaction_factory_(NULL),
- ftp_transaction_factory_(NULL),
- http_auth_handler_factory_(NULL),
- network_delegate_(NULL),
- cookie_policy_(NULL),
- transport_security_state_(NULL) {
- }
+ URLRequestContext();
net::NetLog* net_log() const {
return net_log_;
@@ -114,7 +107,7 @@ class URLRequestContext
protected:
friend class base::RefCountedThreadSafe<URLRequestContext>;
- virtual ~URLRequestContext() {}
+ virtual ~URLRequestContext();
// The following members are expected to be initialized and owned by
// subclasses.
diff --git a/net/url_request/url_request_http_job.cc b/net/url_request/url_request_http_job.cc
index cbccff2..11df1d0 100644
--- a/net/url_request/url_request_http_job.cc
+++ b/net/url_request/url_request_http_job.cc
@@ -14,6 +14,7 @@
#include "base/string_util.h"
#include "net/base/cert_status_flags.h"
#include "net/base/cookie_policy.h"
+#include "net/base/cookie_store.h"
#include "net/base/filter.h"
#include "net/base/transport_security_state.h"
#include "net/base/load_flags.h"
diff --git a/net/websockets/websocket.cc b/net/websockets/websocket.cc
index fa6f180..3bf1da8 100644
--- a/net/websockets/websocket.cc
+++ b/net/websockets/websocket.cc
@@ -8,6 +8,7 @@
#include "net/websockets/websocket.h"
#include "base/message_loop.h"
+#include "net/base/host_resolver.h"
#include "net/websockets/websocket_handshake.h"
#include "net/websockets/websocket_handshake_draft75.h"