diff options
author | earthdok@chromium.org <earthdok@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-19 13:14:29 +0000 |
---|---|---|
committer | earthdok@chromium.org <earthdok@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-19 13:14:29 +0000 |
commit | 255620da4ddf6f59947d9e77529f54ad02d9af12 (patch) | |
tree | 3259bcf1524fa26fd8099e409af35422d82f9871 /net/url_request/file_protocol_handler.h | |
parent | 6a1162f6cff7d33880f5e03fb9bb3909d84e7beb (diff) | |
download | chromium_src-255620da4ddf6f59947d9e77529f54ad02d9af12.zip chromium_src-255620da4ddf6f59947d9e77529f54ad02d9af12.tar.gz chromium_src-255620da4ddf6f59947d9e77529f54ad02d9af12.tar.bz2 |
Remove WorkerPool dependency from URLRequestFileJob.
Make net::URLRequestFileJob pass a TaskRunner to FileStream, instead of using a deprecated FileStream constructor that depends on WorkerPool. This TaskRunner is obtained from the blocking pool where possible. Also, remove two explicit uses of WorkerPool in net/url_request/ and chrome/browser/.
Removes dependency on deprecated code. Also fixes memory leaks in unit tests caused by FileStream destruction tasks not running to completion in WorkerPool.
BUG=248513, 251774
Review URL: https://chromiumcodereview.appspot.com/22795006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@218273 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/url_request/file_protocol_handler.h')
-rw-r--r-- | net/url_request/file_protocol_handler.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/net/url_request/file_protocol_handler.h b/net/url_request/file_protocol_handler.h index 8087a6e..78956a9 100644 --- a/net/url_request/file_protocol_handler.h +++ b/net/url_request/file_protocol_handler.h @@ -7,10 +7,15 @@ #include "base/basictypes.h" #include "base/compiler_specific.h" +#include "base/memory/ref_counted.h" #include "net/url_request/url_request_job_factory.h" class GURL; +namespace base { +class TaskRunner; +} + namespace net { class NetworkDelegate; @@ -21,12 +26,15 @@ class URLRequestJob; class NET_EXPORT FileProtocolHandler : public URLRequestJobFactory::ProtocolHandler { public: - FileProtocolHandler(); + explicit FileProtocolHandler( + const scoped_refptr<base::TaskRunner>& file_task_runner); + virtual ~FileProtocolHandler(); virtual URLRequestJob* MaybeCreateJob( URLRequest* request, NetworkDelegate* network_delegate) const OVERRIDE; virtual bool IsSafeRedirectTarget(const GURL& location) const OVERRIDE; private: + const scoped_refptr<base::TaskRunner> file_task_runner_; DISALLOW_COPY_AND_ASSIGN(FileProtocolHandler); }; |