diff options
author | jar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-25 23:20:29 +0000 |
---|---|---|
committer | jar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-25 23:20:29 +0000 |
commit | dfabc13bc1933e5c4aadf4bd5e3fc2daa5e330b9 (patch) | |
tree | 1614365c3499729213da7006e7ce5cbcc03463bd /net/url_request | |
parent | 11423d456652ffcb1a5dc618ff70bb56581378ee (diff) | |
download | chromium_src-dfabc13bc1933e5c4aadf4bd5e3fc2daa5e330b9.zip chromium_src-dfabc13bc1933e5c4aadf4bd5e3fc2daa5e330b9.tar.gz chromium_src-dfabc13bc1933e5c4aadf4bd5e3fc2daa5e330b9.tar.bz2 |
Add virtual to some base classes that have virtual methods
This is defensive coding to avoid memory leaks.
bug=47469
r=wtc
Review URL: http://codereview.chromium.org/2869024
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50907 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/url_request')
-rw-r--r-- | net/url_request/https_prober.h | 4 | ||||
-rw-r--r-- | net/url_request/url_request_http_job.cc | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/net/url_request/https_prober.h b/net/url_request/https_prober.h index 2ab1f86..c1c9941 100644 --- a/net/url_request/https_prober.h +++ b/net/url_request/https_prober.h @@ -23,6 +23,8 @@ namespace net { class HTTPSProberDelegate { public: virtual void ProbeComplete(bool result) = 0; + protected: + virtual ~HTTPSProberDelegate() {} }; // HTTPSProber is a singleton object that manages HTTPS probes. A HTTPS probe @@ -30,7 +32,7 @@ class HTTPSProberDelegate { // transparently upgrading from HTTP to HTTPS (for example, for SPDY). class HTTPSProber : public URLRequest::Delegate { public: - HTTPSProber() { } + HTTPSProber() {} // HaveProbed returns true if the given host is known to have been probed // since the browser was last started. diff --git a/net/url_request/url_request_http_job.cc b/net/url_request/url_request_http_job.cc index 420100f..7041b8d 100644 --- a/net/url_request/url_request_http_job.cc +++ b/net/url_request/url_request_http_job.cc @@ -902,7 +902,7 @@ void URLRequestHttpJob::ProcessStrictTransportSecurityHeader() { continue; } - net::HTTPSProberDelegate* delegate = + HTTPSProberDelegate* delegate = new HTTPSProberDelegate(request_info_.url.host(), max_age, include_subdomains, ctx->transport_security_state()); |