Commit ebb7c1fd authored by jnd@chromium.org's avatar jnd@chromium.org

Make the SpawnerCommunicator destructor virtual since it inherits from net::URLRequest::Delegate

Also make BaseTestServer's dtor virtual protected to prevent the BaseTestServer pointer being directly deleted.

BUG=None
TEST=net_unittests should pass.
Review URL: https://chromiumcodereview.appspot.com/9704008

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@126865 0039d316-1c4b-4281-b951-d872f2087c98
parent 01b84957
...@@ -119,8 +119,6 @@ class BaseTestServer { ...@@ -119,8 +119,6 @@ class BaseTestServer {
// Initialize a HTTPS TestServer with a specific set of HTTPSOptions. // Initialize a HTTPS TestServer with a specific set of HTTPSOptions.
explicit BaseTestServer(const HTTPSOptions& https_options); explicit BaseTestServer(const HTTPSOptions& https_options);
~BaseTestServer();
// Returns the host port pair used by current Python based test server only // Returns the host port pair used by current Python based test server only
// if the server is started. // if the server is started.
const HostPortPair& host_port_pair() const; const HostPortPair& host_port_pair() const;
...@@ -145,6 +143,7 @@ class BaseTestServer { ...@@ -145,6 +143,7 @@ class BaseTestServer {
std::string* replacement_path); std::string* replacement_path);
protected: protected:
virtual ~BaseTestServer();
Type type() const { return type_; } Type type() const { return type_; }
// Gets port currently assigned to host_port_pair_ without checking // Gets port currently assigned to host_port_pair_ without checking
......
...@@ -35,7 +35,7 @@ class LocalTestServer : public BaseTestServer { ...@@ -35,7 +35,7 @@ class LocalTestServer : public BaseTestServer {
LocalTestServer(const HTTPSOptions& https_options, LocalTestServer(const HTTPSOptions& https_options,
const FilePath& document_root); const FilePath& document_root);
~LocalTestServer(); virtual ~LocalTestServer();
bool Start() WARN_UNUSED_RESULT; bool Start() WARN_UNUSED_RESULT;
......
...@@ -29,7 +29,7 @@ class RemoteTestServer : public BaseTestServer { ...@@ -29,7 +29,7 @@ class RemoteTestServer : public BaseTestServer {
RemoteTestServer(const HTTPSOptions& https_options, RemoteTestServer(const HTTPSOptions& https_options,
const FilePath& document_root); const FilePath& document_root);
~RemoteTestServer(); virtual ~RemoteTestServer();
// Starts the Python test server on the host, instead of on the device. // Starts the Python test server on the host, instead of on the device.
bool Start() WARN_UNUSED_RESULT; bool Start() WARN_UNUSED_RESULT;
......
...@@ -62,7 +62,7 @@ class ScopedPortException; ...@@ -62,7 +62,7 @@ class ScopedPortException;
class SpawnerCommunicator : public net::URLRequest::Delegate { class SpawnerCommunicator : public net::URLRequest::Delegate {
public: public:
explicit SpawnerCommunicator(uint16 port); explicit SpawnerCommunicator(uint16 port);
~SpawnerCommunicator(); virtual ~SpawnerCommunicator();
// Starts an instance of the Python test server on the host/ machine. // Starts an instance of the Python test server on the host/ machine.
// If successfully started, returns true, setting |*port| to the port // If successfully started, returns true, setting |*port| to the port
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment