diff options
author | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-18 20:21:31 +0000 |
---|---|---|
committer | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-18 20:21:31 +0000 |
commit | b104b50ddb1d70d95ff9ace7a6fb30ec3b1aeb17 (patch) | |
tree | 0d35c3f624aec7c6de8824fab2b9521bfff1dbff /net | |
parent | d13509f32546e26332733ac6153d359fbd566eaa (diff) | |
download | chromium_src-b104b50ddb1d70d95ff9ace7a6fb30ec3b1aeb17.zip chromium_src-b104b50ddb1d70d95ff9ace7a6fb30ec3b1aeb17.tar.gz chromium_src-b104b50ddb1d70d95ff9ace7a6fb30ec3b1aeb17.tar.bz2 |
FBTF: Monster ctor patch after changing heuristics in clang plugin.
(Only 916k this time off Debug Linux .a files)
BUG=none
TEST=compiles
Review URL: http://codereview.chromium.org/3814013
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62967 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
43 files changed, 275 insertions, 106 deletions
diff --git a/net/disk_cache/disk_format.cc b/net/disk_cache/disk_format.cc new file mode 100644 index 0000000..5216b50 --- /dev/null +++ b/net/disk_cache/disk_format.cc @@ -0,0 +1,21 @@ +// 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/disk_cache/disk_format.h" + +namespace disk_cache { + +IndexHeader::IndexHeader() { + memset(this, 0, sizeof(*this)); + magic = kIndexMagic; + version = kCurrentVersion; +} + +BlockFileHeader::BlockFileHeader() { + memset(this, 0, sizeof(BlockFileHeader)); + magic = kBlockMagic; + version = kCurrentVersion; +} + +} // namespace disk_cache diff --git a/net/disk_cache/disk_format.h b/net/disk_cache/disk_format.h index ac4c6348..ffe36ae 100644 --- a/net/disk_cache/disk_format.h +++ b/net/disk_cache/disk_format.h @@ -80,6 +80,8 @@ struct LruData { // Header for the master index file. struct IndexHeader { + IndexHeader(); + uint32 magic; uint32 version; int32 num_entries; // Number of entries currently stored. @@ -93,11 +95,6 @@ struct IndexHeader { uint64 create_time; // Creation time for this set of files. int32 pad[52]; LruData lru; // Eviction control data. - IndexHeader() { - memset(this, 0, sizeof(*this)); - magic = kIndexMagic; - version = kCurrentVersion; - }; }; // The structure of the whole index file. @@ -177,6 +174,8 @@ typedef uint32 AllocBitmap[kMaxBlocks / 32]; // from the beginning every time). // This Structure is the header of a block-file: struct BlockFileHeader { + BlockFileHeader(); + uint32 magic; uint32 version; int16 this_file; // Index of this file. @@ -189,11 +188,6 @@ struct BlockFileHeader { volatile int32 updating; // Keep track of updates to the header. int32 user[5]; AllocBitmap allocation_map; - BlockFileHeader() { - memset(this, 0, sizeof(BlockFileHeader)); - magic = kBlockMagic; - version = kCurrentVersion; - }; }; COMPILE_ASSERT(sizeof(BlockFileHeader) == kBlockHeaderSize, bad_header); diff --git a/net/disk_cache/file.cc b/net/disk_cache/file.cc new file mode 100644 index 0000000..6b56951 --- /dev/null +++ b/net/disk_cache/file.cc @@ -0,0 +1,16 @@ +// 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/disk_cache/file.h" + +namespace disk_cache { + +// Cross platform constructors. Platform specific code is in +// file_{win,posix}.cc. + +File::File() : init_(false), mixed_(false) {} + +File::File(bool mixed_mode) : init_(false), mixed_(mixed_mode) {} + +} // namespace disk_cache diff --git a/net/disk_cache/file.h b/net/disk_cache/file.h index 43ba5c1..c266311 100644 --- a/net/disk_cache/file.h +++ b/net/disk_cache/file.h @@ -29,9 +29,9 @@ class FileIOCallback { class File : public base::RefCounted<File> { friend class base::RefCounted<File>; public: - File() : init_(false), mixed_(false) {} + File(); // mixed_mode set to true enables regular synchronous operations for the file. - explicit File(bool mixed_mode) : init_(false), mixed_(mixed_mode) {} + explicit File(bool mixed_mode); // Initializes the object to use the passed in file instead of opening it with // the Init() call. No asynchronous operations can be performed with this diff --git a/net/disk_cache/mem_backend_impl.cc b/net/disk_cache/mem_backend_impl.cc index fe57d7d..288a66e 100644 --- a/net/disk_cache/mem_backend_impl.cc +++ b/net/disk_cache/mem_backend_impl.cc @@ -62,6 +62,8 @@ bool MemBackendImpl::Init() { return true; } +MemBackendImpl::MemBackendImpl() : max_size_(0), current_size_(0) {} + MemBackendImpl::~MemBackendImpl() { EntryMap::iterator it = entries_.begin(); while (it != entries_.end()) { diff --git a/net/disk_cache/mem_backend_impl.h b/net/disk_cache/mem_backend_impl.h index 62ed3c5..c78c670 100644 --- a/net/disk_cache/mem_backend_impl.h +++ b/net/disk_cache/mem_backend_impl.h @@ -21,7 +21,7 @@ class MemEntryImpl; // the operations of the cache without writing to disk. class MemBackendImpl : public Backend { public: - MemBackendImpl() : max_size_(0), current_size_(0) {} + MemBackendImpl(); ~MemBackendImpl(); // Returns an instance of a Backend implemented only in memory. The returned diff --git a/net/disk_cache/sparse_control.cc b/net/disk_cache/sparse_control.cc index 2934184..e94a1bc 100644 --- a/net/disk_cache/sparse_control.cc +++ b/net/disk_cache/sparse_control.cc @@ -142,6 +142,17 @@ void ChildrenDeleter::DeleteChildren() { namespace disk_cache { +SparseControl::SparseControl(EntryImpl* entry) + : entry_(entry), + child_(NULL), + operation_(kNoOperation), + init_(false), + child_map_(child_data_.bitmap, kNumSparseBits, kNumSparseBits / 32), + ALLOW_THIS_IN_INITIALIZER_LIST( + child_callback_(this, &SparseControl::OnChildIOCompleted)), + user_callback_(NULL) { +} + SparseControl::~SparseControl() { if (child_) CloseChild(); diff --git a/net/disk_cache/sparse_control.h b/net/disk_cache/sparse_control.h index 88a012b..15704df 100644 --- a/net/disk_cache/sparse_control.h +++ b/net/disk_cache/sparse_control.h @@ -40,12 +40,7 @@ class SparseControl { kGetRangeOperation }; - explicit SparseControl(EntryImpl* entry) - : entry_(entry), child_(NULL), operation_(kNoOperation), init_(false), - child_map_(child_data_.bitmap, kNumSparseBits, kNumSparseBits / 32), - ALLOW_THIS_IN_INITIALIZER_LIST( - child_callback_(this, &SparseControl::OnChildIOCompleted)), - user_callback_(NULL) {} + explicit SparseControl(EntryImpl* entry); ~SparseControl(); // Initializes the object for the current entry. If this entry already stores diff --git a/net/ftp/ftp_ctrl_response_buffer.cc b/net/ftp/ftp_ctrl_response_buffer.cc index c9ee5dd..950e1e0 100644 --- a/net/ftp/ftp_ctrl_response_buffer.cc +++ b/net/ftp/ftp_ctrl_response_buffer.cc @@ -14,6 +14,14 @@ namespace net { // static const int FtpCtrlResponse::kInvalidStatusCode = -1; +FtpCtrlResponse::FtpCtrlResponse() : status_code(kInvalidStatusCode) {} + +FtpCtrlResponse::~FtpCtrlResponse() {} + +FtpCtrlResponseBuffer::FtpCtrlResponseBuffer() : multiline_(false) {} + +FtpCtrlResponseBuffer::~FtpCtrlResponseBuffer() {} + int FtpCtrlResponseBuffer::ConsumeData(const char* data, int data_length) { buffer_.append(data, data_length); ExtractFullLinesFromBuffer(); @@ -64,6 +72,19 @@ int FtpCtrlResponseBuffer::ConsumeData(const char* data, int data_length) { return OK; } +FtpCtrlResponse FtpCtrlResponseBuffer::PopResponse() { + FtpCtrlResponse result = responses_.front(); + responses_.pop(); + return result; +} + +FtpCtrlResponseBuffer::ParsedLine::ParsedLine() + : has_status_code(false), + is_multiline(false), + is_complete(false), + status_code(FtpCtrlResponse::kInvalidStatusCode) { +} + // static FtpCtrlResponseBuffer::ParsedLine FtpCtrlResponseBuffer::ParseLine( const std::string& line) { diff --git a/net/ftp/ftp_ctrl_response_buffer.h b/net/ftp/ftp_ctrl_response_buffer.h index b98f494..219a2d4 100644 --- a/net/ftp/ftp_ctrl_response_buffer.h +++ b/net/ftp/ftp_ctrl_response_buffer.h @@ -18,7 +18,8 @@ namespace net { struct FtpCtrlResponse { static const int kInvalidStatusCode; - FtpCtrlResponse() : status_code(kInvalidStatusCode) {} + FtpCtrlResponse(); + ~FtpCtrlResponse(); int status_code; // Three-digit status code. std::vector<std::string> lines; // Response lines, without CRLFs. @@ -26,7 +27,8 @@ struct FtpCtrlResponse { class FtpCtrlResponseBuffer { public: - FtpCtrlResponseBuffer() : multiline_(false) {} + FtpCtrlResponseBuffer(); + ~FtpCtrlResponseBuffer(); // Called when data is received from the control socket. Returns error code. int ConsumeData(const char* data, int data_length); @@ -37,20 +39,11 @@ class FtpCtrlResponseBuffer { // Returns the next response. It is an error to call this function // unless ResponseAvailable returns true. - FtpCtrlResponse PopResponse() { - FtpCtrlResponse result = responses_.front(); - responses_.pop(); - return result; - } + FtpCtrlResponse PopResponse(); private: struct ParsedLine { - ParsedLine() - : has_status_code(false), - is_multiline(false), - is_complete(false), - status_code(FtpCtrlResponse::kInvalidStatusCode) { - } + ParsedLine(); // Indicates that this line begins with a valid 3-digit status code. bool has_status_code; diff --git a/net/ftp/ftp_directory_listing_parser_hprc.cc b/net/ftp/ftp_directory_listing_parser_hprc.cc index b65ec68..621aba1 100644 --- a/net/ftp/ftp_directory_listing_parser_hprc.cc +++ b/net/ftp/ftp_directory_listing_parser_hprc.cc @@ -14,6 +14,8 @@ FtpDirectoryListingParserHprc::FtpDirectoryListingParserHprc( : current_time_(current_time) { } +FtpDirectoryListingParserHprc::~FtpDirectoryListingParserHprc() {} + FtpServerType FtpDirectoryListingParserHprc::GetServerType() const { return SERVER_HPRC; } diff --git a/net/ftp/ftp_directory_listing_parser_hprc.h b/net/ftp/ftp_directory_listing_parser_hprc.h index 73b5195..d153810 100644 --- a/net/ftp/ftp_directory_listing_parser_hprc.h +++ b/net/ftp/ftp_directory_listing_parser_hprc.h @@ -22,6 +22,7 @@ class FtpDirectoryListingParserHprc : public FtpDirectoryListingParser { // that we don't know, |current_time| will be used. This allows passing // a specific date during testing. explicit FtpDirectoryListingParserHprc(const base::Time& current_time); + virtual ~FtpDirectoryListingParserHprc(); // FtpDirectoryListingParser methods: virtual FtpServerType GetServerType() const; diff --git a/net/ftp/ftp_directory_listing_parser_ls.cc b/net/ftp/ftp_directory_listing_parser_ls.cc index 9fd2400..89fc3d8 100644 --- a/net/ftp/ftp_directory_listing_parser_ls.cc +++ b/net/ftp/ftp_directory_listing_parser_ls.cc @@ -89,6 +89,8 @@ FtpDirectoryListingParserLs::FtpDirectoryListingParserLs( current_time_(current_time) { } +FtpDirectoryListingParserLs::~FtpDirectoryListingParserLs() {} + bool FtpDirectoryListingParserLs::ConsumeLine(const string16& line) { if (line.empty() && !received_nonempty_line_) { // Allow empty lines only at the beginning of the listing. For example VMS diff --git a/net/ftp/ftp_directory_listing_parser_ls.h b/net/ftp/ftp_directory_listing_parser_ls.h index 54856c1..6cb3655 100644 --- a/net/ftp/ftp_directory_listing_parser_ls.h +++ b/net/ftp/ftp_directory_listing_parser_ls.h @@ -20,6 +20,7 @@ class FtpDirectoryListingParserLs : public FtpDirectoryListingParser { // date strings, |current_time| will be used. This allows passing a specific // date during testing. explicit FtpDirectoryListingParserLs(const base::Time& current_time); + virtual ~FtpDirectoryListingParserLs(); // FtpDirectoryListingParser methods: virtual FtpServerType GetServerType() const { return SERVER_LS; } diff --git a/net/ftp/ftp_directory_listing_parser_mlsd.cc b/net/ftp/ftp_directory_listing_parser_mlsd.cc index dc6dace..fa9a44e 100644 --- a/net/ftp/ftp_directory_listing_parser_mlsd.cc +++ b/net/ftp/ftp_directory_listing_parser_mlsd.cc @@ -48,8 +48,9 @@ bool MlsdDateListingToTime(const string16& text, base::Time* time) { namespace net { -FtpDirectoryListingParserMlsd::FtpDirectoryListingParserMlsd() { -} +FtpDirectoryListingParserMlsd::FtpDirectoryListingParserMlsd() {} + +FtpDirectoryListingParserMlsd::~FtpDirectoryListingParserMlsd() {} bool FtpDirectoryListingParserMlsd::ConsumeLine(const string16& line) { // The first space indicates where the filename begins. diff --git a/net/ftp/ftp_directory_listing_parser_mlsd.h b/net/ftp/ftp_directory_listing_parser_mlsd.h index 94df607..c3e3acf 100644 --- a/net/ftp/ftp_directory_listing_parser_mlsd.h +++ b/net/ftp/ftp_directory_listing_parser_mlsd.h @@ -17,6 +17,7 @@ namespace net { class FtpDirectoryListingParserMlsd : public FtpDirectoryListingParser { public: FtpDirectoryListingParserMlsd(); + virtual ~FtpDirectoryListingParserMlsd(); // FtpDirectoryListingParser methods: virtual FtpServerType GetServerType() const { return SERVER_MLSD; } diff --git a/net/ftp/ftp_directory_listing_parser_netware.cc b/net/ftp/ftp_directory_listing_parser_netware.cc index 3cd0c8f..ab7fb6d 100644 --- a/net/ftp/ftp_directory_listing_parser_netware.cc +++ b/net/ftp/ftp_directory_listing_parser_netware.cc @@ -40,6 +40,8 @@ FtpDirectoryListingParserNetware::FtpDirectoryListingParserNetware( current_time_(current_time) { } +FtpDirectoryListingParserNetware::~FtpDirectoryListingParserNetware() {} + bool FtpDirectoryListingParserNetware::ConsumeLine(const string16& line) { if (!received_first_line_) { received_first_line_ = true; diff --git a/net/ftp/ftp_directory_listing_parser_netware.h b/net/ftp/ftp_directory_listing_parser_netware.h index e05b55d..5fdcd84 100644 --- a/net/ftp/ftp_directory_listing_parser_netware.h +++ b/net/ftp/ftp_directory_listing_parser_netware.h @@ -20,6 +20,7 @@ class FtpDirectoryListingParserNetware : public FtpDirectoryListingParser { // date strings, |current_time| will be used. This allows passing a specific // date during testing. explicit FtpDirectoryListingParserNetware(const base::Time& current_time); + virtual ~FtpDirectoryListingParserNetware(); // FtpDirectoryListingParser methods: virtual FtpServerType GetServerType() const { return SERVER_NETWARE; } diff --git a/net/ftp/ftp_directory_listing_parser_vms.cc b/net/ftp/ftp_directory_listing_parser_vms.cc index 3702a14..ed12665 100644 --- a/net/ftp/ftp_directory_listing_parser_vms.cc +++ b/net/ftp/ftp_directory_listing_parser_vms.cc @@ -168,6 +168,8 @@ FtpDirectoryListingParserVms::FtpDirectoryListingParserVms() last_is_directory_(false) { } +FtpDirectoryListingParserVms::~FtpDirectoryListingParserVms() {} + bool FtpDirectoryListingParserVms::ConsumeLine(const string16& line) { switch (state_) { case STATE_INITIAL: diff --git a/net/ftp/ftp_directory_listing_parser_vms.h b/net/ftp/ftp_directory_listing_parser_vms.h index 1b1f082..12f8dc7 100644 --- a/net/ftp/ftp_directory_listing_parser_vms.h +++ b/net/ftp/ftp_directory_listing_parser_vms.h @@ -16,6 +16,7 @@ namespace net { class FtpDirectoryListingParserVms : public FtpDirectoryListingParser { public: FtpDirectoryListingParserVms(); + virtual ~FtpDirectoryListingParserVms(); // FtpDirectoryListingParser methods: virtual FtpServerType GetServerType() const { return SERVER_VMS; } diff --git a/net/ftp/ftp_directory_listing_parser_windows.cc b/net/ftp/ftp_directory_listing_parser_windows.cc index d2bbdaa..e3211739 100644 --- a/net/ftp/ftp_directory_listing_parser_windows.cc +++ b/net/ftp/ftp_directory_listing_parser_windows.cc @@ -72,8 +72,9 @@ bool WindowsDateListingToTime(const std::vector<string16>& columns, namespace net { -FtpDirectoryListingParserWindows::FtpDirectoryListingParserWindows() { -} +FtpDirectoryListingParserWindows::FtpDirectoryListingParserWindows() {} + +FtpDirectoryListingParserWindows::~FtpDirectoryListingParserWindows() {} bool FtpDirectoryListingParserWindows::ConsumeLine(const string16& line) { std::vector<string16> columns; diff --git a/net/ftp/ftp_directory_listing_parser_windows.h b/net/ftp/ftp_directory_listing_parser_windows.h index cf869c3..91ffe36 100644 --- a/net/ftp/ftp_directory_listing_parser_windows.h +++ b/net/ftp/ftp_directory_listing_parser_windows.h @@ -15,6 +15,7 @@ namespace net { class FtpDirectoryListingParserWindows : public FtpDirectoryListingParser { public: FtpDirectoryListingParserWindows(); + virtual ~FtpDirectoryListingParserWindows(); // FtpDirectoryListingParser methods: virtual FtpServerType GetServerType() const { return SERVER_WINDOWS; } diff --git a/net/ftp/ftp_network_session.cc b/net/ftp/ftp_network_session.cc new file mode 100644 index 0000000..65dd218 --- /dev/null +++ b/net/ftp/ftp_network_session.cc @@ -0,0 +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. + +#include "net/ftp/ftp_network_session.h" + +namespace net { + +FtpNetworkSession::FtpNetworkSession(HostResolver* host_resolver) + : host_resolver_(host_resolver) {} + +FtpNetworkSession::~FtpNetworkSession() {} + +} // namespace net + diff --git a/net/ftp/ftp_network_session.h b/net/ftp/ftp_network_session.h index 3eab4ff..b53b5c0 100644 --- a/net/ftp/ftp_network_session.h +++ b/net/ftp/ftp_network_session.h @@ -16,8 +16,7 @@ class HostResolver; // This class holds session objects used by FtpNetworkTransaction objects. class FtpNetworkSession : public base::RefCounted<FtpNetworkSession> { public: - explicit FtpNetworkSession(HostResolver* host_resolver) - : host_resolver_(host_resolver) {} + explicit FtpNetworkSession(HostResolver* host_resolver); HostResolver* host_resolver() { return host_resolver_; } FtpAuthCache* auth_cache() { return &auth_cache_; } @@ -25,7 +24,7 @@ class FtpNetworkSession : public base::RefCounted<FtpNetworkSession> { private: friend class base::RefCounted<FtpNetworkSession>; - ~FtpNetworkSession() {} + virtual ~FtpNetworkSession(); HostResolver* const host_resolver_; FtpAuthCache auth_cache_; diff --git a/net/http/http_cache.cc b/net/http/http_cache.cc index 867d003..a62c84e 100644 --- a/net/http/http_cache.cc +++ b/net/http/http_cache.cc @@ -36,6 +36,23 @@ namespace net { +HttpCache::DefaultBackend::DefaultBackend(CacheType type, + const FilePath& path, + int max_bytes, + base::MessageLoopProxy* thread) + : type_(type), + path_(path), + max_bytes_(max_bytes), + thread_(thread) { +} + +HttpCache::DefaultBackend::~DefaultBackend() {} + +// static +HttpCache::BackendFactory* HttpCache::DefaultBackend::InMemory(int max_bytes) { + return new DefaultBackend(MEMORY_CACHE, FilePath(), max_bytes, NULL); +} + int HttpCache::DefaultBackend::CreateBackend(disk_cache::Backend** backend, CompletionCallback* callback) { DCHECK_GE(max_bytes_, 0); diff --git a/net/http/http_cache.h b/net/http/http_cache.h index 775d035..1eeacdd 100644 --- a/net/http/http_cache.h +++ b/net/http/http_cache.h @@ -96,13 +96,11 @@ class HttpCache : public HttpTransactionFactory, // |cache_thread| is the thread where disk operations should take place. If // |max_bytes| is zero, a default value will be calculated automatically. DefaultBackend(CacheType type, const FilePath& path, int max_bytes, - base::MessageLoopProxy* thread) - : type_(type), path_(path), max_bytes_(max_bytes), thread_(thread) {} + base::MessageLoopProxy* thread); + virtual ~DefaultBackend(); // Returns a factory for an in-memory cache. - static BackendFactory* InMemory(int max_bytes) { - return new DefaultBackend(MEMORY_CACHE, FilePath(), max_bytes, NULL); - } + static BackendFactory* InMemory(int max_bytes); // BackendFactory implementation. virtual int CreateBackend(disk_cache::Backend** backend, diff --git a/net/http/http_net_log_params.cc b/net/http/http_net_log_params.cc new file mode 100644 index 0000000..989d30d --- /dev/null +++ b/net/http/http_net_log_params.cc @@ -0,0 +1,59 @@ +// 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_net_log_params.h" + +#include "base/stringprintf.h" +#include "base/values.h" +#include "net/http/http_response_headers.h" + +namespace net { + +NetLogHttpRequestParameter::NetLogHttpRequestParameter( + const std::string& line, + const HttpRequestHeaders& headers) + : line_(line) { + headers_.CopyFrom(headers); +} + +Value* NetLogHttpRequestParameter::ToValue() const { + DictionaryValue* dict = new DictionaryValue(); + dict->SetString("line", line_); + ListValue* headers = new ListValue(); + HttpRequestHeaders::Iterator iterator(headers_); + while (iterator.GetNext()) { + headers->Append( + new StringValue(base::StringPrintf("%s: %s", + iterator.name().c_str(), + iterator.value().c_str()))); + } + dict->Set("headers", headers); + return dict; +} + +NetLogHttpRequestParameter::~NetLogHttpRequestParameter() {} + +NetLogHttpResponseParameter::NetLogHttpResponseParameter( + const scoped_refptr<HttpResponseHeaders>& headers) + : headers_(headers) {} + +Value* NetLogHttpResponseParameter::ToValue() const { + DictionaryValue* dict = new DictionaryValue(); + ListValue* headers = new ListValue(); + headers->Append(new StringValue(headers_->GetStatusLine())); + void* iterator = NULL; + std::string name; + std::string value; + while (headers_->EnumerateHeaderLines(&iterator, &name, &value)) { + headers->Append( + new StringValue(base::StringPrintf("%s: %s", name.c_str(), + value.c_str()))); + } + dict->Set("headers", headers); + return dict; +} + +NetLogHttpResponseParameter::~NetLogHttpResponseParameter() {} + +} // namespace net diff --git a/net/http/http_net_log_params.h b/net/http/http_net_log_params.h index 4331a0f..403b6a7 100644 --- a/net/http/http_net_log_params.h +++ b/net/http/http_net_log_params.h @@ -10,43 +10,28 @@ #include "base/basictypes.h" #include "base/ref_counted.h" -#include "base/stringprintf.h" -#include "base/values.h" #include "net/base/net_log.h" #include "net/http/http_request_headers.h" -#include "net/http/http_response_headers.h" + +class Value; namespace net { +class HttpResponseHeaders; + class NetLogHttpRequestParameter : public NetLog::EventParameters { public: NetLogHttpRequestParameter(const std::string& line, - const HttpRequestHeaders& headers) - : line_(line) { - headers_.CopyFrom(headers); - } + const HttpRequestHeaders& headers); - Value* ToValue() const { - DictionaryValue* dict = new DictionaryValue(); - dict->SetString("line", line_); - ListValue* headers = new ListValue(); - HttpRequestHeaders::Iterator iterator(headers_); - while (iterator.GetNext()) { - headers->Append( - new StringValue(base::StringPrintf("%s: %s", - iterator.name().c_str(), - iterator.value().c_str()))); - } - dict->Set("headers", headers); - return dict; - } + Value* ToValue() const; const HttpRequestHeaders& GetHeaders() const { return headers_; } private: - ~NetLogHttpRequestParameter() {} + virtual ~NetLogHttpRequestParameter(); const std::string line_; HttpRequestHeaders headers_; @@ -57,31 +42,16 @@ class NetLogHttpRequestParameter : public NetLog::EventParameters { class NetLogHttpResponseParameter : public NetLog::EventParameters { public: explicit NetLogHttpResponseParameter( - const scoped_refptr<HttpResponseHeaders>& headers) - : headers_(headers) {} - - Value* ToValue() const { - DictionaryValue* dict = new DictionaryValue(); - ListValue* headers = new ListValue(); - headers->Append(new StringValue(headers_->GetStatusLine())); - void* iterator = NULL; - std::string name; - std::string value; - while (headers_->EnumerateHeaderLines(&iterator, &name, &value)) { - headers->Append( - new StringValue(base::StringPrintf("%s: %s", name.c_str(), - value.c_str()))); - } - dict->Set("headers", headers); - return dict; - } + const scoped_refptr<HttpResponseHeaders>& headers); + + Value* ToValue() const; const HttpResponseHeaders& GetHeaders() const { return *headers_; } private: - ~NetLogHttpResponseParameter() {} + virtual ~NetLogHttpResponseParameter(); const scoped_refptr<HttpResponseHeaders> headers_; diff --git a/net/http/http_proxy_client_socket.cc b/net/http/http_proxy_client_socket.cc index 2da59b7..b5ede3d 100644 --- a/net/http/http_proxy_client_socket.cc +++ b/net/http/http_proxy_client_socket.cc @@ -16,6 +16,7 @@ #include "net/http/http_network_session.h" #include "net/http/http_proxy_utils.h" #include "net/http/http_request_info.h" +#include "net/http/http_response_headers.h" #include "net/http/http_stream_parser.h" #include "net/socket/client_socket_handle.h" diff --git a/net/http/partial_data.cc b/net/http/partial_data.cc index 799c3fa..68d8048 100644 --- a/net/http/partial_data.cc +++ b/net/http/partial_data.cc @@ -106,6 +106,15 @@ void PartialData::Core::OnIOComplete(int result) { // ----------------------------------------------------------------------------- +PartialData::PartialData() + : range_present_(false), + final_range_(false), + sparse_entry_(true), + truncated_(false), + core_(NULL), + callback_(NULL) { +} + PartialData::~PartialData() { if (core_) core_->Cancel(); diff --git a/net/http/partial_data.h b/net/http/partial_data.h index 45bef31..4726d10 100644 --- a/net/http/partial_data.h +++ b/net/http/partial_data.h @@ -31,9 +31,7 @@ class IOBuffer; // of those individual network / cache requests. class PartialData { public: - PartialData() - : range_present_(false), final_range_(false), sparse_entry_(true), - truncated_(false), core_(NULL), callback_(NULL) {} + PartialData(); ~PartialData(); // Performs initialization of the object by examining the request |headers| diff --git a/net/http/url_security_manager.cc b/net/http/url_security_manager.cc index d848644..4ff0f65 100644 --- a/net/http/url_security_manager.cc +++ b/net/http/url_security_manager.cc @@ -15,6 +15,8 @@ URLSecurityManagerWhitelist::URLSecurityManagerWhitelist( whitelist_delegate_(whitelist_delegate) { } +URLSecurityManagerWhitelist::~URLSecurityManagerWhitelist() {} + bool URLSecurityManagerWhitelist::CanUseDefaultCredentials( const GURL& auth_origin) const { if (whitelist_default_.get()) diff --git a/net/http/url_security_manager.h b/net/http/url_security_manager.h index 5e148b4..c6a5ec9 100644 --- a/net/http/url_security_manager.h +++ b/net/http/url_security_manager.h @@ -61,6 +61,7 @@ class URLSecurityManagerWhitelist : public URLSecurityManager { // The URLSecurityManagerWhitelist takes ownership of the whitelists. URLSecurityManagerWhitelist(const HttpAuthFilter* whitelist_default, const HttpAuthFilter* whitelist_delegation); + virtual ~URLSecurityManagerWhitelist(); // URLSecurityManager methods. virtual bool CanUseDefaultCredentials(const GURL& auth_origin) const; diff --git a/net/net.gyp b/net/net.gyp index 699f093..2f19dbc 100644 --- a/net/net.gyp +++ b/net/net.gyp @@ -336,6 +336,7 @@ 'disk_cache/cache_util_posix.cc', 'disk_cache/cache_util_win.cc', 'disk_cache/disk_cache.h', + 'disk_cache/disk_format.cc', 'disk_cache/disk_format.h', 'disk_cache/entry_impl.cc', 'disk_cache/entry_impl.h', @@ -343,6 +344,7 @@ 'disk_cache/eviction.cc', 'disk_cache/eviction.h', 'disk_cache/experiments.h', + 'disk_cache/file.cc', 'disk_cache/file.h', 'disk_cache/file_block.h', 'disk_cache/file_lock.cc', @@ -399,6 +401,7 @@ 'ftp/ftp_directory_listing_parser_windows.h', 'ftp/ftp_network_layer.cc', 'ftp/ftp_network_layer.h', + 'ftp/ftp_network_session.cc', 'ftp/ftp_network_session.h', 'ftp/ftp_network_transaction.cc', 'ftp/ftp_network_transaction.h', @@ -454,6 +457,7 @@ 'http/http_cache_transaction.h', 'http/http_chunked_decoder.cc', 'http/http_chunked_decoder.h', + 'http/http_net_log_params.cc', 'http/http_net_log_params.h', 'http/http_network_delegate.h', 'http/http_network_layer.cc', diff --git a/net/proxy/proxy_resolver_script_data.cc b/net/proxy/proxy_resolver_script_data.cc index fd8c399..0314fc3 100644 --- a/net/proxy/proxy_resolver_script_data.cc +++ b/net/proxy/proxy_resolver_script_data.cc @@ -45,4 +45,14 @@ const GURL& ProxyResolverScriptData::url() const { return url_; } +ProxyResolverScriptData::ProxyResolverScriptData(Type type, + const GURL& url, + const string16& utf16) + : type_(type), + url_(url), + utf16_(utf16) { +} + +ProxyResolverScriptData::~ProxyResolverScriptData() {} + } // namespace net diff --git a/net/proxy/proxy_resolver_script_data.h b/net/proxy/proxy_resolver_script_data.h index 72092e1..7b8118f 100644 --- a/net/proxy/proxy_resolver_script_data.h +++ b/net/proxy/proxy_resolver_script_data.h @@ -54,13 +54,12 @@ class ProxyResolverScriptData const GURL& url() const; private: + friend class base::RefCountedThreadSafe<ProxyResolverScriptData>; ProxyResolverScriptData(Type type, const GURL& url, - const string16& utf16) - : type_(type), - url_(url), - utf16_(utf16) { - } + const string16& utf16); + virtual ~ProxyResolverScriptData(); + const Type type_; const GURL url_; diff --git a/net/spdy/spdy_proxy_client_socket.cc b/net/spdy/spdy_proxy_client_socket.cc index 9973f86..c8a0153 100644 --- a/net/spdy/spdy_proxy_client_socket.cc +++ b/net/spdy/spdy_proxy_client_socket.cc @@ -16,6 +16,7 @@ #include "net/http/http_auth_handler_factory.h" #include "net/http/http_net_log_params.h" #include "net/http/http_proxy_utils.h" +#include "net/http/http_response_headers.h" #include "net/spdy/spdy_http_utils.h" namespace net { diff --git a/net/url_request/url_request_job_manager.cc b/net/url_request/url_request_job_manager.cc index 0615280..edc9f75 100644 --- a/net/url_request/url_request_job_manager.cc +++ b/net/url_request/url_request_job_manager.cc @@ -43,6 +43,8 @@ URLRequestJobManager::URLRequestJobManager() { #endif } +URLRequestJobManager::~URLRequestJobManager() {} + URLRequestJob* URLRequestJobManager::CreateJob(URLRequest* request) const { #ifndef NDEBUG DCHECK(IsAllowedThread()); diff --git a/net/url_request/url_request_job_manager.h b/net/url_request/url_request_job_manager.h index 51de77a..c93df76 100644 --- a/net/url_request/url_request_job_manager.h +++ b/net/url_request/url_request_job_manager.h @@ -27,6 +27,7 @@ class URLRequestJobManager { public: URLRequestJobManager(); + ~URLRequestJobManager(); // Instantiate an URLRequestJob implementation based on the registered // interceptors and protocol factories. This will always succeed in diff --git a/net/url_request/url_request_job_metrics.cc b/net/url_request/url_request_job_metrics.cc index e0726da..8e7b70b 100644 --- a/net/url_request/url_request_job_metrics.cc +++ b/net/url_request/url_request_job_metrics.cc @@ -10,6 +10,14 @@ using base::TimeDelta; +URLRequestJobMetrics::URLRequestJobMetrics() + : total_bytes_read_(0), + number_of_read_IO_(0), + success_(false) { +} + +URLRequestJobMetrics::~URLRequestJobMetrics() {} + void URLRequestJobMetrics::AppendText(std::wstring* text) { if (!text) return; diff --git a/net/url_request/url_request_job_metrics.h b/net/url_request/url_request_job_metrics.h index 2f52c7f..ce0e4bf 100644 --- a/net/url_request/url_request_job_metrics.h +++ b/net/url_request/url_request_job_metrics.h @@ -18,11 +18,8 @@ class URLRequestJobMetrics { public: - URLRequestJobMetrics() - : total_bytes_read_(0), - number_of_read_IO_(0), - success_(false) { } - ~URLRequestJobMetrics() { } + URLRequestJobMetrics(); + ~URLRequestJobMetrics(); // The original url the job has been created for. scoped_ptr<GURL> original_url_; diff --git a/net/url_request/view_cache_helper.cc b/net/url_request/view_cache_helper.cc index 92701b7..4a3ad02 100644 --- a/net/url_request/view_cache_helper.cc +++ b/net/url_request/view_cache_helper.cc @@ -73,6 +73,22 @@ std::string FormatEntryInfo(disk_cache::Entry* entry, namespace net { +ViewCacheHelper::ViewCacheHelper() + : disk_cache_(NULL), + entry_(NULL), + iter_(NULL), + buf_len_(0), + index_(0), + data_(NULL), + callback_(NULL), + next_state_(STATE_NONE), + ALLOW_THIS_IN_INITIALIZER_LIST( + cache_callback_(this, &ViewCacheHelper::OnIOComplete)), + ALLOW_THIS_IN_INITIALIZER_LIST( + entry_callback_(new CancelableCompletionCallback<ViewCacheHelper>( + this, &ViewCacheHelper::OnIOComplete))) { +} + ViewCacheHelper::~ViewCacheHelper() { if (entry_) entry_->Close(); diff --git a/net/url_request/view_cache_helper.h b/net/url_request/view_cache_helper.h index dd960a9..03af714 100644 --- a/net/url_request/view_cache_helper.h +++ b/net/url_request/view_cache_helper.h @@ -22,14 +22,7 @@ namespace net { class ViewCacheHelper { public: - ViewCacheHelper() - : disk_cache_(NULL), entry_(NULL), iter_(NULL), buf_len_(0), index_(0), - data_(NULL), callback_(NULL), next_state_(STATE_NONE), - ALLOW_THIS_IN_INITIALIZER_LIST( - cache_callback_(this, &ViewCacheHelper::OnIOComplete)), - ALLOW_THIS_IN_INITIALIZER_LIST( - entry_callback_(new CancelableCompletionCallback<ViewCacheHelper>( - this, &ViewCacheHelper::OnIOComplete))) {} + ViewCacheHelper(); ~ViewCacheHelper(); // Formats the cache information for |key| as HTML. Returns a net error code. |