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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 URLRequestJob* URLRequestJobFactoryImpl::MaybeInterceptResponse( | 70 URLRequestJob* URLRequestJobFactoryImpl::MaybeInterceptResponse( |
71 URLRequest* request, | 71 URLRequest* request, |
72 NetworkDelegate* network_delegate) const { | 72 NetworkDelegate* network_delegate) const { |
73 return nullptr; | 73 return nullptr; |
74 } | 74 } |
75 | 75 |
76 bool URLRequestJobFactoryImpl::IsHandledProtocol( | 76 bool URLRequestJobFactoryImpl::IsHandledProtocol( |
77 const std::string& scheme) const { | 77 const std::string& scheme) const { |
78 DCHECK(CalledOnValidThread()); | 78 DCHECK(CalledOnValidThread()); |
79 return base::ContainsKey(protocol_handler_map_, scheme) || | 79 return base::ContainsKey(protocol_handler_map_, scheme) || |
80 URLRequestJobManager::GetInstance()->SupportsScheme(scheme); | 80 URLRequestJobManager::SupportsScheme(scheme); |
81 } | 81 } |
82 | 82 |
83 bool URLRequestJobFactoryImpl::IsHandledURL(const GURL& url) const { | 83 bool URLRequestJobFactoryImpl::IsHandledURL(const GURL& url) const { |
84 if (!url.is_valid()) { | 84 if (!url.is_valid()) { |
85 // We handle error cases. | 85 // We handle error cases. |
86 return true; | 86 return true; |
87 } | 87 } |
88 return IsHandledProtocol(url.scheme()); | 88 return IsHandledProtocol(url.scheme()); |
89 } | 89 } |
90 | 90 |
(...skipping 15 matching lines...) Expand all Loading... |
106 | 106 |
107 // static | 107 // static |
108 void URLRequestJobFactoryImpl::SetInterceptorForTesting( | 108 void URLRequestJobFactoryImpl::SetInterceptorForTesting( |
109 URLRequestInterceptor* interceptor) { | 109 URLRequestInterceptor* interceptor) { |
110 DCHECK(!interceptor || !g_interceptor_for_testing); | 110 DCHECK(!interceptor || !g_interceptor_for_testing); |
111 | 111 |
112 g_interceptor_for_testing = interceptor; | 112 g_interceptor_for_testing = interceptor; |
113 } | 113 } |
114 | 114 |
115 } // namespace net | 115 } // namespace net |
OLD | NEW |