OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/url_request/url_request_job_manager.h" | 5 #include "net/url_request/url_request_job_manager.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/memory/singleton.h" | 9 #include "base/memory/singleton.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 // TODO(willchan): Remove this in favor of URLRequestJobFactory::Interceptor. | 85 // TODO(willchan): Remove this in favor of URLRequestJobFactory::Interceptor. |
86 if (!(request->load_flags() & LOAD_DISABLE_INTERCEPT)) { | 86 if (!(request->load_flags() & LOAD_DISABLE_INTERCEPT)) { |
87 InterceptorList::const_iterator i; | 87 InterceptorList::const_iterator i; |
88 for (i = interceptors_.begin(); i != interceptors_.end(); ++i) { | 88 for (i = interceptors_.begin(); i != interceptors_.end(); ++i) { |
89 URLRequestJob* job = (*i)->MaybeIntercept(request); | 89 URLRequestJob* job = (*i)->MaybeIntercept(request); |
90 if (job) | 90 if (job) |
91 return job; | 91 return job; |
92 } | 92 } |
93 } | 93 } |
94 | 94 |
| 95 if (scheme == "http" || scheme == "https") { |
| 96 FactoryMap::const_iterator i = factories_.find(scheme); |
| 97 if (i != factories_.end()) { |
| 98 URLRequestJob* job = i->second(request, scheme); |
| 99 if (job) |
| 100 return job; |
| 101 } |
| 102 } |
| 103 |
95 if (job_factory) { | 104 if (job_factory) { |
96 URLRequestJob* job = | 105 URLRequestJob* job = |
97 job_factory->MaybeCreateJobWithProtocolHandler(scheme, request); | 106 job_factory->MaybeCreateJobWithProtocolHandler(scheme, request); |
98 if (job) | 107 if (job) |
99 return job; | 108 return job; |
100 } | 109 } |
101 | 110 |
102 // TODO(willchan): Remove this in favor of | 111 // TODO(willchan): Remove this in favor of |
103 // URLRequestJobFactory::ProtocolHandler. | 112 // URLRequestJobFactory::ProtocolHandler. |
104 // See if the request should be handled by a registered protocol factory. | 113 // See if the request should be handled by a registered protocol factory. |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 } | 272 } |
264 | 273 |
265 URLRequestJobManager::URLRequestJobManager() | 274 URLRequestJobManager::URLRequestJobManager() |
266 : allowed_thread_(0), | 275 : allowed_thread_(0), |
267 allowed_thread_initialized_(false) { | 276 allowed_thread_initialized_(false) { |
268 } | 277 } |
269 | 278 |
270 URLRequestJobManager::~URLRequestJobManager() {} | 279 URLRequestJobManager::~URLRequestJobManager() {} |
271 | 280 |
272 } // namespace net | 281 } // namespace net |
OLD | NEW |