| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_factory_impl.h" | 5 #include "net/url_request/url_request_job_factory_impl.h" |
| 6 | 6 |
| 7 #include "base/stl_util.h" | 7 #include "base/stl_util.h" |
| 8 #include "net/base/load_flags.h" | 8 #include "net/base/load_flags.h" |
| 9 #include "net/url_request/url_request_interceptor.h" | 9 #include "net/url_request/url_request_interceptor.h" |
| 10 #include "net/url_request/url_request_job_manager.h" | 10 #include "net/url_request/url_request_job_manager.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 if (job) | 56 if (job) |
| 57 return job; | 57 return job; |
| 58 } | 58 } |
| 59 | 59 |
| 60 ProtocolHandlerMap::const_iterator it = protocol_handler_map_.find(scheme); | 60 ProtocolHandlerMap::const_iterator it = protocol_handler_map_.find(scheme); |
| 61 if (it == protocol_handler_map_.end()) | 61 if (it == protocol_handler_map_.end()) |
| 62 return NULL; | 62 return NULL; |
| 63 return it->second->MaybeCreateJob(request, network_delegate); | 63 return it->second->MaybeCreateJob(request, network_delegate); |
| 64 } | 64 } |
| 65 | 65 |
| 66 URLRequestJob* URLRequestJobFactoryImpl::MaybeInterceptRedirect( |
| 67 URLRequest* request, |
| 68 NetworkDelegate* network_delegate, |
| 69 const GURL& location) const { |
| 70 return nullptr; |
| 71 } |
| 72 |
| 73 URLRequestJob* URLRequestJobFactoryImpl::MaybeInterceptResponse( |
| 74 URLRequest* request, |
| 75 NetworkDelegate* network_delegate) const { |
| 76 return nullptr; |
| 77 } |
| 78 |
| 66 bool URLRequestJobFactoryImpl::IsHandledProtocol( | 79 bool URLRequestJobFactoryImpl::IsHandledProtocol( |
| 67 const std::string& scheme) const { | 80 const std::string& scheme) const { |
| 68 DCHECK(CalledOnValidThread()); | 81 DCHECK(CalledOnValidThread()); |
| 69 return ContainsKey(protocol_handler_map_, scheme) || | 82 return ContainsKey(protocol_handler_map_, scheme) || |
| 70 URLRequestJobManager::GetInstance()->SupportsScheme(scheme); | 83 URLRequestJobManager::GetInstance()->SupportsScheme(scheme); |
| 71 } | 84 } |
| 72 | 85 |
| 73 bool URLRequestJobFactoryImpl::IsHandledURL(const GURL& url) const { | 86 bool URLRequestJobFactoryImpl::IsHandledURL(const GURL& url) const { |
| 74 if (!url.is_valid()) { | 87 if (!url.is_valid()) { |
| 75 // We handle error cases. | 88 // We handle error cases. |
| (...skipping 20 matching lines...) Expand all Loading... |
| 96 | 109 |
| 97 // static | 110 // static |
| 98 void URLRequestJobFactoryImpl::SetInterceptorForTesting( | 111 void URLRequestJobFactoryImpl::SetInterceptorForTesting( |
| 99 URLRequestInterceptor* interceptor) { | 112 URLRequestInterceptor* interceptor) { |
| 100 DCHECK(!interceptor || !g_interceptor_for_testing); | 113 DCHECK(!interceptor || !g_interceptor_for_testing); |
| 101 | 114 |
| 102 g_interceptor_for_testing = interceptor; | 115 g_interceptor_for_testing = interceptor; |
| 103 } | 116 } |
| 104 | 117 |
| 105 } // namespace net | 118 } // namespace net |
| OLD | NEW |