diff options
author | shalev@chromium.org <shalev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-24 01:06:58 +0000 |
---|---|---|
committer | shalev@chromium.org <shalev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-24 01:06:58 +0000 |
commit | 9f170464e1ab4f1f75802a391db76408bc8998f2 (patch) | |
tree | 50ecf1c9c893ab12c59ee653d57732572128b7ed /webkit/blob | |
parent | 3dc4019ef862889073cf16e875050a512e93aa3a (diff) | |
download | chromium_src-9f170464e1ab4f1f75802a391db76408bc8998f2.zip chromium_src-9f170464e1ab4f1f75802a391db76408bc8998f2.tar.gz chromium_src-9f170464e1ab4f1f75802a391db76408bc8998f2.tar.bz2 |
Refactoring: ProtocolHandler::MaybeCreateJob and other functions take NetworkDelegate as argument
This change goes a long way to prepare for removing NetworkDelegate from URLRequestContext.
TBR=sky@chromium.org, michaeln@chromium.org, benjhayden@chromium.org, brettw@chromium.org, ben@chromium.org, davemoore@chromium.org, zelidrag@chromium.org, mnissler@chromium.org, thestig@chromium.org, asargent@chromium.org, jhawkins@chromium.org, bulach@chromium.org
BUG=crbug.com/142945
Review URL: https://chromiumcodereview.appspot.com/10855209
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@153133 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/blob')
-rw-r--r-- | webkit/blob/blob_url_request_job.cc | 3 | ||||
-rw-r--r-- | webkit/blob/blob_url_request_job.h | 1 | ||||
-rw-r--r-- | webkit/blob/blob_url_request_job_factory.cc | 5 | ||||
-rw-r--r-- | webkit/blob/blob_url_request_job_factory.h | 3 | ||||
-rw-r--r-- | webkit/blob/blob_url_request_job_unittest.cc | 2 | ||||
-rw-r--r-- | webkit/blob/view_blob_internals_job.cc | 6 | ||||
-rw-r--r-- | webkit/blob/view_blob_internals_job.h | 1 |
7 files changed, 15 insertions, 6 deletions
diff --git a/webkit/blob/blob_url_request_job.cc b/webkit/blob/blob_url_request_job.cc index edda7fc..642f955 100644 --- a/webkit/blob/blob_url_request_job.cc +++ b/webkit/blob/blob_url_request_job.cc @@ -48,9 +48,10 @@ const char kHTTPInternalErrorText[] = "Internal Server Error"; BlobURLRequestJob::BlobURLRequestJob( net::URLRequest* request, + net::NetworkDelegate* network_delegate, BlobData* blob_data, base::MessageLoopProxy* file_thread_proxy) - : net::URLRequestJob(request, request->context()->network_delegate()), + : net::URLRequestJob(request, network_delegate), ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)), blob_data_(blob_data), file_thread_proxy_(file_thread_proxy), diff --git a/webkit/blob/blob_url_request_job.h b/webkit/blob/blob_url_request_job.h index 676ebaf..d7080bc 100644 --- a/webkit/blob/blob_url_request_job.h +++ b/webkit/blob/blob_url_request_job.h @@ -31,6 +31,7 @@ class LocalFileStreamReader; class BLOB_EXPORT BlobURLRequestJob : public net::URLRequestJob { public: BlobURLRequestJob(net::URLRequest* request, + net::NetworkDelegate* network_delegate, BlobData* blob_data, base::MessageLoopProxy* resolving_message_loop_proxy); diff --git a/webkit/blob/blob_url_request_job_factory.cc b/webkit/blob/blob_url_request_job_factory.cc index 539570e..52f0874 100644 --- a/webkit/blob/blob_url_request_job_factory.cc +++ b/webkit/blob/blob_url_request_job_factory.cc @@ -26,13 +26,14 @@ BlobProtocolHandler::BlobProtocolHandler( BlobProtocolHandler::~BlobProtocolHandler() {} net::URLRequestJob* BlobProtocolHandler::MaybeCreateJob( - net::URLRequest* request) const { + net::URLRequest* request, net::NetworkDelegate* network_delegate) const { scoped_refptr<webkit_blob::BlobData> data = LookupBlobData(request); if (!data) { // This request is not coming through resource dispatcher host. data = blob_storage_controller_->GetBlobDataFromUrl(request->url()); } - return new webkit_blob::BlobURLRequestJob(request, data, file_loop_proxy_); + return new webkit_blob::BlobURLRequestJob( + request, network_delegate, data, file_loop_proxy_); } scoped_refptr<webkit_blob::BlobData> diff --git a/webkit/blob/blob_url_request_job_factory.h b/webkit/blob/blob_url_request_job_factory.h index 61d55094..cf7452a 100644 --- a/webkit/blob/blob_url_request_job_factory.h +++ b/webkit/blob/blob_url_request_job_factory.h @@ -33,7 +33,8 @@ class BLOB_EXPORT BlobProtocolHandler virtual ~BlobProtocolHandler(); virtual net::URLRequestJob* MaybeCreateJob( - net::URLRequest* request) const OVERRIDE; + net::URLRequest* request, + net::NetworkDelegate* network_delegate) const OVERRIDE; private: virtual scoped_refptr<BlobData> LookupBlobData( diff --git a/webkit/blob/blob_url_request_job_unittest.cc b/webkit/blob/blob_url_request_job_unittest.cc index a9462e6..3463d01 100644 --- a/webkit/blob/blob_url_request_job_unittest.cc +++ b/webkit/blob/blob_url_request_job_unittest.cc @@ -144,6 +144,7 @@ class BlobURLRequestJobTest : public testing::Test { static net::URLRequestJob* BlobURLRequestJobFactory( net::URLRequest* request, + net::NetworkDelegate* network_delegate, const std::string& scheme) { BlobURLRequestJob* temp = blob_url_request_job_; blob_url_request_job_ = NULL; @@ -248,6 +249,7 @@ class BlobURLRequestJobTest : public testing::Test { request_->set_method(method); blob_url_request_job_ = new BlobURLRequestJob( request_.get(), + empty_context_.network_delegate(), blob_data, base::MessageLoopProxy::current()); diff --git a/webkit/blob/view_blob_internals_job.cc b/webkit/blob/view_blob_internals_job.cc index 03029ef..dfbf3a0 100644 --- a/webkit/blob/view_blob_internals_job.cc +++ b/webkit/blob/view_blob_internals_job.cc @@ -98,8 +98,10 @@ void AddHTMLButton(const std::string& title, namespace webkit_blob { ViewBlobInternalsJob::ViewBlobInternalsJob( - net::URLRequest* request, BlobStorageController* blob_storage_controller) - : net::URLRequestSimpleJob(request), + net::URLRequest* request, + net::NetworkDelegate* network_delegate, + BlobStorageController* blob_storage_controller) + : net::URLRequestSimpleJob(request, network_delegate), blob_storage_controller_(blob_storage_controller), ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) { } diff --git a/webkit/blob/view_blob_internals_job.h b/webkit/blob/view_blob_internals_job.h index 24324ca..17c3cf9 100644 --- a/webkit/blob/view_blob_internals_job.h +++ b/webkit/blob/view_blob_internals_job.h @@ -25,6 +25,7 @@ class BlobStorageController; class BLOB_EXPORT ViewBlobInternalsJob : public net::URLRequestSimpleJob { public: ViewBlobInternalsJob(net::URLRequest* request, + net::NetworkDelegate* network_delegate, BlobStorageController* blob_storage_controller); virtual void Start() OVERRIDE; |