diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-05 23:34:24 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-05 23:34:24 +0000 |
commit | 5389bc7ba5360633af04b9cf15497d56ce640ead (patch) | |
tree | 4518c05f3bad18a5b2f4739fc1a1c187651f9799 /net/url_request | |
parent | 4070a6b1efcb2dbea12508a0b912cfa3bc86f47e (diff) | |
download | chromium_src-5389bc7ba5360633af04b9cf15497d56ce640ead.zip chromium_src-5389bc7ba5360633af04b9cf15497d56ce640ead.tar.gz chromium_src-5389bc7ba5360633af04b9cf15497d56ce640ead.tar.bz2 |
Second patch in making destructors of refcounted objects private.
BUG=26749
Review URL: http://codereview.chromium.org/368001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31165 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/url_request')
-rw-r--r-- | net/url_request/url_request_about_job.h | 2 | ||||
-rw-r--r-- | net/url_request/url_request_data_job.h | 3 | ||||
-rw-r--r-- | net/url_request/url_request_error_job.h | 2 | ||||
-rw-r--r-- | net/url_request/url_request_file_dir_job.h | 3 | ||||
-rw-r--r-- | net/url_request/url_request_file_job.cc | 4 | ||||
-rw-r--r-- | net/url_request/url_request_file_job.h | 3 | ||||
-rw-r--r-- | net/url_request/url_request_ftp_job.h | 4 | ||||
-rw-r--r-- | net/url_request/url_request_http_job.h | 5 | ||||
-rw-r--r-- | net/url_request/url_request_inet_job.h | 5 | ||||
-rw-r--r-- | net/url_request/url_request_job.h | 4 | ||||
-rw-r--r-- | net/url_request/url_request_new_ftp_job.h | 4 | ||||
-rw-r--r-- | net/url_request/url_request_redirect_job.h | 2 | ||||
-rw-r--r-- | net/url_request/url_request_simple_job.h | 2 | ||||
-rw-r--r-- | net/url_request/url_request_test_job.h | 4 | ||||
-rw-r--r-- | net/url_request/url_request_unittest.cc | 7 | ||||
-rw-r--r-- | net/url_request/url_request_unittest.h | 19 | ||||
-rw-r--r-- | net/url_request/url_request_view_net_internals_job.h | 2 |
17 files changed, 56 insertions, 19 deletions
diff --git a/net/url_request/url_request_about_job.h b/net/url_request/url_request_about_job.h index 651a053..70822d2 100644 --- a/net/url_request/url_request_about_job.h +++ b/net/url_request/url_request_about_job.h @@ -20,6 +20,8 @@ class URLRequestAboutJob : public URLRequestJob { static URLRequest::ProtocolFactory Factory; private: + ~URLRequestAboutJob() {} + void StartAsync(); }; diff --git a/net/url_request/url_request_data_job.h b/net/url_request/url_request_data_job.h index 44dc327..1c1dbaa 100644 --- a/net/url_request/url_request_data_job.h +++ b/net/url_request/url_request_data_job.h @@ -22,6 +22,9 @@ class URLRequestDataJob : public URLRequestSimpleJob { static URLRequest::ProtocolFactory Factory; + private: + ~URLRequestDataJob() {} + DISALLOW_COPY_AND_ASSIGN(URLRequestDataJob); }; diff --git a/net/url_request/url_request_error_job.h b/net/url_request/url_request_error_job.h index 1810bb2..396c38d 100644 --- a/net/url_request/url_request_error_job.h +++ b/net/url_request/url_request_error_job.h @@ -17,6 +17,8 @@ class URLRequestErrorJob : public URLRequestJob { virtual void Start(); private: + ~URLRequestErrorJob() {} + int error_; void StartAsync(); }; diff --git a/net/url_request/url_request_file_dir_job.h b/net/url_request/url_request_file_dir_job.h index 52a6d61..24a6c72 100644 --- a/net/url_request/url_request_file_dir_job.h +++ b/net/url_request/url_request_file_dir_job.h @@ -17,7 +17,6 @@ class URLRequestFileDirJob public net::DirectoryLister::DirectoryListerDelegate { public: URLRequestFileDirJob(URLRequest* request, const FilePath& dir_path); - virtual ~URLRequestFileDirJob(); // URLRequestJob methods: virtual void Start(); @@ -35,6 +34,8 @@ class URLRequestFileDirJob bool list_complete() const { return list_complete_; } private: + virtual ~URLRequestFileDirJob(); + void CloseLister(); // When we have data and a read has been pending, this function // will fill the response buffer and notify the request diff --git a/net/url_request/url_request_file_job.cc b/net/url_request/url_request_file_job.cc index aa3ee56..8e1b7dc 100644 --- a/net/url_request/url_request_file_job.cc +++ b/net/url_request/url_request_file_job.cc @@ -60,6 +60,10 @@ class URLRequestFileJob::AsyncResolver : } private: + friend class base::RefCountedThreadSafe<URLRequestFileJob::AsyncResolver>; + + ~AsyncResolver() {} + void ReturnResults(bool exists, const file_util::FileInfo& file_info) { if (owner_) owner_->DidResolve(exists, file_info); diff --git a/net/url_request/url_request_file_job.h b/net/url_request/url_request_file_job.h index f7da8c1..8cb28bd 100644 --- a/net/url_request/url_request_file_job.h +++ b/net/url_request/url_request_file_job.h @@ -22,7 +22,6 @@ struct FileInfo; class URLRequestFileJob : public URLRequestJob { public: URLRequestFileJob(URLRequest* request, const FilePath& file_path); - virtual ~URLRequestFileJob(); virtual void Start(); virtual void Kill(); @@ -36,6 +35,8 @@ class URLRequestFileJob : public URLRequestJob { static URLRequest::ProtocolFactory Factory; protected: + virtual ~URLRequestFileJob(); + // The OS-specific full path name of the file FilePath file_path_; diff --git a/net/url_request/url_request_ftp_job.h b/net/url_request/url_request_ftp_job.h index b85a06d..a2b2aea 100644 --- a/net/url_request/url_request_ftp_job.h +++ b/net/url_request/url_request_ftp_job.h @@ -14,8 +14,6 @@ class URLRequestFtpJob : public URLRequestInetJob { public: static URLRequestJob* Factory(URLRequest* request, const std::string& scheme); - virtual ~URLRequestFtpJob(); - // URLRequestJob methods: virtual void Start(); virtual bool GetMimeType(std::string* mime_type) const; @@ -38,6 +36,8 @@ class URLRequestFtpJob : public URLRequestInetJob { virtual bool IsRedirectResponse(GURL* location, int* http_status_code); private: + virtual ~URLRequestFtpJob(); + // Called after InternetConnect successfully connects to server. void OnConnect(); diff --git a/net/url_request/url_request_http_job.h b/net/url_request/url_request_http_job.h index f8cc55e..b3ccbd1 100644 --- a/net/url_request/url_request_http_job.h +++ b/net/url_request/url_request_http_job.h @@ -27,8 +27,6 @@ class URLRequestHttpJob : public URLRequestJob { public: static URLRequestJob* Factory(URLRequest* request, const std::string& scheme); - virtual ~URLRequestHttpJob(); - protected: explicit URLRequestHttpJob(URLRequest* request); @@ -116,6 +114,9 @@ class URLRequestHttpJob : public URLRequestJob { // For recording of stats, we need to remember if this is cached content. bool is_cached_content_; + private: + virtual ~URLRequestHttpJob(); + DISALLOW_COPY_AND_ASSIGN(URLRequestHttpJob); }; diff --git a/net/url_request/url_request_inet_job.h b/net/url_request/url_request_inet_job.h index c5777ba..1870485 100644 --- a/net/url_request/url_request_inet_job.h +++ b/net/url_request/url_request_inet_job.h @@ -22,7 +22,6 @@ class MessageLoop; class URLRequestInetJob : public URLRequestJob { public: URLRequestInetJob(URLRequest* request); - virtual ~URLRequestInetJob(); virtual void SetExtraRequestHeaders(const std::string& headers) { extra_request_headers_ = headers; @@ -57,7 +56,9 @@ class URLRequestInetJob : public URLRequestJob { HINTERNET request_handle() const { return request_handle_; } -protected: + protected: + virtual ~URLRequestInetJob(); + // Called by this class and subclasses to send or resend this request. virtual void SendRequest() = 0; diff --git a/net/url_request/url_request_job.h b/net/url_request/url_request_job.h index 9a34f4a..4ee7953 100644 --- a/net/url_request/url_request_job.h +++ b/net/url_request/url_request_job.h @@ -41,7 +41,6 @@ class URLRequestJob : public base::RefCountedThreadSafe<URLRequestJob>, static const size_t kSdchPacketHistogramCount = 5; explicit URLRequestJob(URLRequest* request); - virtual ~URLRequestJob(); // Returns the request that owns this job. THIS POINTER MAY BE NULL if the // request was destroyed. @@ -218,6 +217,9 @@ class URLRequestJob : public base::RefCountedThreadSafe<URLRequestJob>, virtual void RecordPacketStats(StatisticSelector statistic) const; protected: + friend class base::RefCountedThreadSafe<URLRequestJob>; + virtual ~URLRequestJob(); + // Notifies the job that headers have been received. void NotifyHeadersComplete(); diff --git a/net/url_request/url_request_new_ftp_job.h b/net/url_request/url_request_new_ftp_job.h index 95b0a3b..9b7a1a8 100644 --- a/net/url_request/url_request_new_ftp_job.h +++ b/net/url_request/url_request_new_ftp_job.h @@ -26,14 +26,14 @@ class URLRequestNewFtpJob : public URLRequestJob { explicit URLRequestNewFtpJob(URLRequest* request); - virtual ~URLRequestNewFtpJob(); - static URLRequestJob* Factory(URLRequest* request, const std::string& scheme); // URLRequestJob methods: virtual bool GetMimeType(std::string* mime_type) const; private: + virtual ~URLRequestNewFtpJob(); + // URLRequestJob methods: virtual void Start(); virtual void Kill(); diff --git a/net/url_request/url_request_redirect_job.h b/net/url_request/url_request_redirect_job.h index d7395a7..8a13204 100644 --- a/net/url_request/url_request_redirect_job.h +++ b/net/url_request/url_request_redirect_job.h @@ -21,6 +21,8 @@ class URLRequestRedirectJob : public URLRequestJob { bool IsRedirectResponse(GURL* location, int* http_status_code); private: + ~URLRequestRedirectJob() {} + void StartAsync(); GURL redirect_destination_; diff --git a/net/url_request/url_request_simple_job.h b/net/url_request/url_request_simple_job.h index 88f54c2..786d2e4 100644 --- a/net/url_request/url_request_simple_job.h +++ b/net/url_request/url_request_simple_job.h @@ -21,6 +21,8 @@ class URLRequestSimpleJob : public URLRequestJob { virtual bool GetCharset(std::string* charset); protected: + ~URLRequestSimpleJob() {} + // subclasses must override the way response data is determined. virtual bool GetData(std::string* mime_type, std::string* charset, diff --git a/net/url_request/url_request_test_job.h b/net/url_request/url_request_test_job.h index bfde712a..4daabf6 100644 --- a/net/url_request/url_request_test_job.h +++ b/net/url_request/url_request_test_job.h @@ -50,8 +50,6 @@ class URLRequestTestJob : public URLRequestJob { const std::string& response_data, bool auto_advance); - virtual ~URLRequestTestJob(); - // The three canned URLs this handler will respond to without having been // explicitly initialized with response headers and data. // FIXME(brettw): we should probably also have a redirect one @@ -102,6 +100,8 @@ class URLRequestTestJob : public URLRequestJob { // When the stage is DONE, this job will not be put on the queue. enum Stage { WAITING, DATA_AVAILABLE, ALL_DATA, DONE }; + virtual ~URLRequestTestJob(); + // Call to process the next opeation, usually sending a notification, and // advancing the stage if necessary. THIS MAY DELETE THE OBJECT. void ProcessNextOperation(); diff --git a/net/url_request/url_request_unittest.cc b/net/url_request/url_request_unittest.cc index 6aee61a..a8b47d2 100644 --- a/net/url_request/url_request_unittest.cc +++ b/net/url_request/url_request_unittest.cc @@ -66,6 +66,7 @@ class URLRequestTestContext : public URLRequestContext { accept_charset_ = "iso-8859-1,*,utf-8"; } + private: virtual ~URLRequestTestContext() { delete ftp_transaction_factory_; delete http_transaction_factory_; @@ -1433,6 +1434,8 @@ class RestartTestJob : public URLRequestTestJob { virtual void StartAsync() { this->NotifyRestartRequired(); } + private: + ~RestartTestJob() {} }; class CancelTestJob : public URLRequestTestJob { @@ -1443,6 +1446,8 @@ class CancelTestJob : public URLRequestTestJob { virtual void StartAsync() { request_->Cancel(); } + private: + ~CancelTestJob() {} }; class CancelThenRestartTestJob : public URLRequestTestJob { @@ -1455,6 +1460,8 @@ class CancelThenRestartTestJob : public URLRequestTestJob { request_->Cancel(); this->NotifyRestartRequired(); } + private: + ~CancelThenRestartTestJob() {} }; // An Interceptor for use with interceptor tests diff --git a/net/url_request/url_request_unittest.h b/net/url_request/url_request_unittest.h index 362f5889..b4a17ca 100644 --- a/net/url_request/url_request_unittest.h +++ b/net/url_request/url_request_unittest.h @@ -63,7 +63,8 @@ class TestURLRequestContext : public URLRequestContext { proxy_service_, ssl_config_service_); } - virtual ~TestURLRequestContext() { + protected: + ~TestURLRequestContext() { delete http_transaction_factory_; } }; @@ -244,8 +245,6 @@ class BaseTestServer : public base::RefCounted<BaseTestServer> { : launcher_(connection_attempts, connection_timeout) { } public: - virtual ~BaseTestServer() { } - void set_forking(bool forking) { launcher_.set_forking(forking); } @@ -295,6 +294,9 @@ class BaseTestServer : public base::RefCounted<BaseTestServer> { } protected: + friend class base::RefCounted<BaseTestServer>; + virtual ~BaseTestServer() { } + bool Start(net::TestServerLauncher::Protocol protocol, const std::string& host_name, int port, const FilePath& document_root, @@ -356,6 +358,8 @@ class HTTPTestServer : public BaseTestServer { : BaseTestServer(connection_attempts, connection_timeout), loop_(NULL) { } + virtual ~HTTPTestServer() {} + public: // Creates and returns a new HTTPTestServer. If |loop| is non-null, requests // are serviced on it, otherwise a new thread and message loop are created. @@ -560,11 +564,11 @@ class HTTPSTestServer : public HTTPTestServer { return test_server; } - virtual ~HTTPSTestServer() { - } - protected: std::wstring cert_path_; + + private: + virtual ~HTTPSTestServer() {} }; @@ -600,6 +604,9 @@ class FTPTestServer : public BaseTestServer { return true; } + + private: + ~FTPTestServer() {} }; #endif // NET_URL_REQUEST_URL_REQUEST_UNITTEST_H_ diff --git a/net/url_request/url_request_view_net_internals_job.h b/net/url_request/url_request_view_net_internals_job.h index 967d20c..9f23f96 100644 --- a/net/url_request/url_request_view_net_internals_job.h +++ b/net/url_request/url_request_view_net_internals_job.h @@ -27,6 +27,8 @@ class URLRequestViewNetInternalsJob : public URLRequestSimpleJob { std::string* data) const; private: + ~URLRequestViewNetInternalsJob() {} + URLFormat* url_format_; }; |