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

Unified Diff: net/url_request/url_request_job_manager.cc

Issue 1888963004: Add HttpProtocolHandler and convert everything to use it (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove-supports-scheme
Patch Set: rebase (needs fixing) Created 4 years, 2 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 | « net/url_request/url_request_job_manager.h ('k') | net/url_request/url_request_test_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request_job_manager.cc
diff --git a/net/url_request/url_request_job_manager.cc b/net/url_request/url_request_job_manager.cc
index c760e7fe68189c7582bbad233003ec4dd630c1a0..fd893564913a3483868e93bdda5f293a95c888ee 100644
--- a/net/url_request/url_request_job_manager.cc
+++ b/net/url_request/url_request_job_manager.cc
@@ -14,31 +14,10 @@
#include "net/base/network_delegate.h"
#include "net/url_request/url_request_context.h"
#include "net/url_request/url_request_error_job.h"
-#include "net/url_request/url_request_http_job.h"
#include "net/url_request/url_request_job_factory.h"
namespace net {
-// The built-in set of protocol factories
-namespace {
-
-struct SchemeToFactory {
- const char* scheme;
- URLRequest::ProtocolFactory* factory;
-};
-
-} // namespace
-
-static const SchemeToFactory kBuiltinFactories[] = {
- {"http", URLRequestHttpJob::Factory},
- {"https", URLRequestHttpJob::Factory},
-
-#if defined(ENABLE_WEBSOCKETS)
- {"ws", URLRequestHttpJob::Factory},
- {"wss", URLRequestHttpJob::Factory},
-#endif // defined(ENABLE_WEBSOCKETS)
-};
-
// static
URLRequestJobManager* URLRequestJobManager::GetInstance() {
return base::Singleton<URLRequestJobManager>::get();
@@ -73,16 +52,6 @@ URLRequestJob* URLRequestJobManager::CreateJob(
if (job)
return job;
- // See if the request should be handled by a built-in protocol factory.
- for (size_t i = 0; i < arraysize(kBuiltinFactories); ++i) {
- if (scheme == kBuiltinFactories[i].scheme) {
- URLRequestJob* new_job =
- (kBuiltinFactories[i].factory)(request, network_delegate, scheme);
- DCHECK(new_job); // The built-in factories are not expected to fail!
- return new_job;
- }
- }
-
// If we reached here, then it means that a registered protocol factory
// wasn't interested in handling the URL. That is fairly unexpected, and we
// don't have a specific error to report here :-(
@@ -140,18 +109,6 @@ URLRequestJob* URLRequestJobManager::MaybeInterceptResponse(
return NULL;
}
-// TODO(mgersh): remove this and fix remaining callers once HttpProtocolHandler
-// exists
-// static
-bool URLRequestJobManager::SupportsScheme(const std::string& scheme) {
- for (size_t i = 0; i < arraysize(kBuiltinFactories); ++i) {
- if (base::LowerCaseEqualsASCII(scheme, kBuiltinFactories[i].scheme))
- return true;
- }
-
- return false;
-}
-
URLRequestJobManager::URLRequestJobManager() {
}
« no previous file with comments | « net/url_request/url_request_job_manager.h ('k') | net/url_request/url_request_test_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698