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

Unified Diff: net/url_request/url_request_job_factory_impl.cc

Issue 10836248: Turned job_factory into a pure virtual class (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed includes 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
Index: net/url_request/url_request_job_factory_impl.cc
diff --git a/net/url_request/url_request_job_factory.cc b/net/url_request/url_request_job_factory_impl.cc
similarity index 76%
copy from net/url_request/url_request_job_factory.cc
copy to net/url_request/url_request_job_factory_impl.cc
index 44bc0024170c3ae68135b5e73ee65839b29fee28..ce066b10caebf1ce9cbcf2bece60d83ca4248498 100644
--- a/net/url_request/url_request_job_factory.cc
+++ b/net/url_request/url_request_job_factory_impl.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "net/url_request/url_request_job_factory.h"
+#include "net/url_request/url_request_job_factory_impl.h"
#include "base/stl_util.h"
#include "googleurl/src/gurl.h"
@@ -11,23 +11,14 @@
namespace net {
-URLRequestJobFactory::ProtocolHandler::~ProtocolHandler() {}
+URLRequestJobFactoryImpl::URLRequestJobFactoryImpl() {}
-URLRequestJobFactory::Interceptor::~Interceptor() {}
-
-bool URLRequestJobFactory::Interceptor::WillHandleProtocol(
- const std::string& protocol) const {
- return false;
-}
-
-URLRequestJobFactory::URLRequestJobFactory() {}
-
-URLRequestJobFactory::~URLRequestJobFactory() {
+URLRequestJobFactoryImpl::~URLRequestJobFactoryImpl() {
STLDeleteValues(&protocol_handler_map_);
STLDeleteElements(&interceptors_);
}
-bool URLRequestJobFactory::SetProtocolHandler(
+bool URLRequestJobFactoryImpl::SetProtocolHandler(
const std::string& scheme,
ProtocolHandler* protocol_handler) {
DCHECK(CalledOnValidThread());
@@ -48,14 +39,14 @@ bool URLRequestJobFactory::SetProtocolHandler(
return true;
}
-void URLRequestJobFactory::AddInterceptor(Interceptor* interceptor) {
+void URLRequestJobFactoryImpl::AddInterceptor(Interceptor* interceptor) {
DCHECK(CalledOnValidThread());
CHECK(interceptor);
interceptors_.push_back(interceptor);
}
-URLRequestJob* URLRequestJobFactory::MaybeCreateJobWithInterceptor(
+URLRequestJob* URLRequestJobFactoryImpl::MaybeCreateJobWithInterceptor(
URLRequest* request) const {
DCHECK(CalledOnValidThread());
URLRequestJob* job = NULL;
@@ -71,7 +62,7 @@ URLRequestJob* URLRequestJobFactory::MaybeCreateJobWithInterceptor(
return NULL;
}
-URLRequestJob* URLRequestJobFactory::MaybeCreateJobWithProtocolHandler(
+URLRequestJob* URLRequestJobFactoryImpl::MaybeCreateJobWithProtocolHandler(
const std::string& scheme,
URLRequest* request) const {
DCHECK(CalledOnValidThread());
@@ -81,7 +72,7 @@ URLRequestJob* URLRequestJobFactory::MaybeCreateJobWithProtocolHandler(
return it->second->MaybeCreateJob(request);
}
-URLRequestJob* URLRequestJobFactory::MaybeInterceptRedirect(
+URLRequestJob* URLRequestJobFactoryImpl::MaybeInterceptRedirect(
const GURL& location,
URLRequest* request) const {
DCHECK(CalledOnValidThread());
@@ -98,7 +89,7 @@ URLRequestJob* URLRequestJobFactory::MaybeInterceptRedirect(
return NULL;
}
-URLRequestJob* URLRequestJobFactory::MaybeInterceptResponse(
+URLRequestJob* URLRequestJobFactoryImpl::MaybeInterceptResponse(
URLRequest* request) const {
DCHECK(CalledOnValidThread());
URLRequestJob* job = NULL;
@@ -114,7 +105,8 @@ URLRequestJob* URLRequestJobFactory::MaybeInterceptResponse(
return NULL;
}
-bool URLRequestJobFactory::IsHandledProtocol(const std::string& scheme) const {
+bool URLRequestJobFactoryImpl::IsHandledProtocol(
+ const std::string& scheme) const {
DCHECK(CalledOnValidThread());
InterceptorList::const_iterator i;
for (i = interceptors_.begin(); i != interceptors_.end(); ++i) {
@@ -125,7 +117,7 @@ bool URLRequestJobFactory::IsHandledProtocol(const std::string& scheme) const {
URLRequestJobManager::GetInstance()->SupportsScheme(scheme);
}
-bool URLRequestJobFactory::IsHandledURL(const GURL& url) const {
+bool URLRequestJobFactoryImpl::IsHandledURL(const GURL& url) const {
if (!url.is_valid()) {
// We handle error cases.
return true;

Powered by Google App Engine
This is Rietveld 408576698