Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(887)

Unified Diff: content/browser/renderer_host/resource_dispatcher_host_unittest.cc

Issue 10855209: Refactoring: ProtocolHandler::MaybeCreateJob takes NetworkDelegate as argument (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Latest merge Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/net/view_http_cache_job_factory.cc ('k') | content/browser/resource_context_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/resource_dispatcher_host_unittest.cc
diff --git a/content/browser/renderer_host/resource_dispatcher_host_unittest.cc b/content/browser/renderer_host/resource_dispatcher_host_unittest.cc
index d22181dd92126a084911920a3ca4accedc85cf9d..6d9694913a2b2a1c68fdb6a177925d934b346aab 100644
--- a/content/browser/renderer_host/resource_dispatcher_host_unittest.cc
+++ b/content/browser/renderer_host/resource_dispatcher_host_unittest.cc
@@ -209,20 +209,27 @@ class ForwardingFilter : public ResourceMessageFilter {
// not complete start upon entry, only when specifically told to.
class URLRequestTestDelayedStartJob : public net::URLRequestTestJob {
public:
- URLRequestTestDelayedStartJob(net::URLRequest* request)
- : net::URLRequestTestJob(request) {
+ URLRequestTestDelayedStartJob(net::URLRequest* request,
+ net::NetworkDelegate* network_delegate)
+ : net::URLRequestTestJob(request, network_delegate) {
Init();
}
- URLRequestTestDelayedStartJob(net::URLRequest* request, bool auto_advance)
- : net::URLRequestTestJob(request, auto_advance) {
+ URLRequestTestDelayedStartJob(net::URLRequest* request,
+ net::NetworkDelegate* network_delegate,
+ bool auto_advance)
+ : net::URLRequestTestJob(request, network_delegate, auto_advance) {
Init();
}
URLRequestTestDelayedStartJob(net::URLRequest* request,
+ net::NetworkDelegate* network_delegate,
const std::string& response_headers,
const std::string& response_data,
bool auto_advance)
- : net::URLRequestTestJob(
- request, response_headers, response_data, auto_advance) {
+ : net::URLRequestTestJob(request,
+ network_delegate,
+ response_headers,
+ response_data,
+ auto_advance) {
Init();
}
@@ -286,17 +293,23 @@ URLRequestTestDelayedStartJob::list_head_ = NULL;
// returns IO_pending errors before every read, not just the first one.
class URLRequestTestDelayedCompletionJob : public net::URLRequestTestJob {
public:
- explicit URLRequestTestDelayedCompletionJob(net::URLRequest* request)
- : net::URLRequestTestJob(request) {}
URLRequestTestDelayedCompletionJob(net::URLRequest* request,
+ net::NetworkDelegate* network_delegate)
+ : net::URLRequestTestJob(request, network_delegate) {}
+ URLRequestTestDelayedCompletionJob(net::URLRequest* request,
+ net::NetworkDelegate* network_delegate,
bool auto_advance)
- : net::URLRequestTestJob(request, auto_advance) {}
+ : net::URLRequestTestJob(request, network_delegate, auto_advance) {}
URLRequestTestDelayedCompletionJob(net::URLRequest* request,
+ net::NetworkDelegate* network_delegate,
const std::string& response_headers,
const std::string& response_data,
bool auto_advance)
- : net::URLRequestTestJob(request, response_headers,
- response_data, auto_advance) {}
+ : net::URLRequestTestJob(request,
+ network_delegate,
+ response_headers,
+ response_data,
+ auto_advance) {}
protected:
~URLRequestTestDelayedCompletionJob() {}
@@ -307,8 +320,9 @@ class URLRequestTestDelayedCompletionJob : public net::URLRequestTestJob {
class URLRequestBigJob : public net::URLRequestSimpleJob {
public:
- URLRequestBigJob(net::URLRequest* request)
- : net::URLRequestSimpleJob(request) {
+ URLRequestBigJob(net::URLRequest* request,
+ net::NetworkDelegate* network_delegate)
+ : net::URLRequestSimpleJob(request, network_delegate) {
}
virtual int GetData(std::string* mime_type,
@@ -564,31 +578,35 @@ class ResourceDispatcherHostTest : public testing::Test,
// Our own net::URLRequestJob factory.
static net::URLRequestJob* Factory(net::URLRequest* request,
+ net::NetworkDelegate* network_delegate,
const std::string& scheme) {
if (test_fixture_->response_headers_.empty()) {
if (delay_start_) {
- return new URLRequestTestDelayedStartJob(request);
+ return new URLRequestTestDelayedStartJob(request, network_delegate);
} else if (delay_complete_) {
- return new URLRequestTestDelayedCompletionJob(request);
+ return new URLRequestTestDelayedCompletionJob(request,
+ network_delegate);
} else if (scheme == "big-job") {
- return new URLRequestBigJob(request);
+ return new URLRequestBigJob(request, network_delegate);
} else {
- return new net::URLRequestTestJob(request);
+ return new net::URLRequestTestJob(request, network_delegate);
}
} else {
if (delay_start_) {
return new URLRequestTestDelayedStartJob(
- request, test_fixture_->response_headers_,
- test_fixture_->response_data_, false);
+ request, network_delegate,
+ test_fixture_->response_headers_, test_fixture_->response_data_,
+ false);
} else if (delay_complete_) {
return new URLRequestTestDelayedCompletionJob(
- request, test_fixture_->response_headers_,
- test_fixture_->response_data_, false);
+ request, network_delegate,
+ test_fixture_->response_headers_, test_fixture_->response_data_,
+ false);
} else {
- return new net::URLRequestTestJob(request,
- test_fixture_->response_headers_,
- test_fixture_->response_data_,
- false);
+ return new net::URLRequestTestJob(
+ request, network_delegate,
+ test_fixture_->response_headers_, test_fixture_->response_data_,
+ false);
}
}
}
« no previous file with comments | « content/browser/net/view_http_cache_job_factory.cc ('k') | content/browser/resource_context_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698