Chromium Code Reviews| 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 #ifndef NET_URL_REQUEST_URL_REQUEST_JOB_FACTORY_IMPL_H_ | 5 #ifndef NET_URL_REQUEST_URL_REQUEST_JOB_FACTORY_IMPL_H_ |
| 6 #define NET_URL_REQUEST_URL_REQUEST_JOB_FACTORY_IMPL_H_ | 6 #define NET_URL_REQUEST_URL_REQUEST_JOB_FACTORY_IMPL_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| 11 | 11 |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "net/base/net_export.h" | 14 #include "net/base/net_export.h" |
| 15 #include "net/url_request/url_request_job_factory.h" | 15 #include "net/url_request/url_request_job_factory.h" |
| 16 | 16 |
| 17 namespace net { | 17 namespace net { |
| 18 | 18 |
| 19 class URLRequestInterceptor; | 19 class URLRequestInterceptor; |
| 20 | 20 |
| 21 class NET_EXPORT URLRequestJobFactoryImpl : public URLRequestJobFactory { | 21 class NET_EXPORT URLRequestJobFactoryImpl : public URLRequestJobFactory { |
| 22 public: | 22 public: |
| 23 URLRequestJobFactoryImpl(); | 23 URLRequestJobFactoryImpl(); |
| 24 ~URLRequestJobFactoryImpl() override; | 24 ~URLRequestJobFactoryImpl() override; |
| 25 | 25 |
| 26 static std::unique_ptr<URLRequestJobFactoryImpl> | |
| 27 CreateWithDefaultProtocolHandlers(); | |
|
mmenke
2016/04/21 20:58:01
Think this needs a comment mentioning what schemes
mmenke
2016/04/21 20:58:01
Maybe rename with CreateWithHttpProtocolHandlers?
mgersh
2016/04/22 20:27:15
Done.
mgersh
2016/04/22 20:27:15
Done.
| |
| 28 | |
| 26 // Sets the ProtocolHandler for a scheme. Returns true on success, false on | 29 // Sets the ProtocolHandler for a scheme. Returns true on success, false on |
| 27 // failure (a ProtocolHandler already exists for |scheme|). | 30 // failure (a ProtocolHandler already exists for |scheme|). |
| 28 bool SetProtocolHandler(const std::string& scheme, | 31 bool SetProtocolHandler(const std::string& scheme, |
| 29 std::unique_ptr<ProtocolHandler> protocol_handler); | 32 std::unique_ptr<ProtocolHandler> protocol_handler); |
| 30 | 33 |
| 31 // URLRequestJobFactory implementation | 34 // URLRequestJobFactory implementation |
| 32 URLRequestJob* MaybeCreateJobWithProtocolHandler( | 35 URLRequestJob* MaybeCreateJobWithProtocolHandler( |
| 33 const std::string& scheme, | 36 const std::string& scheme, |
| 34 URLRequest* request, | 37 URLRequest* request, |
| 35 NetworkDelegate* network_delegate) const override; | 38 NetworkDelegate* network_delegate) const override; |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 63 static void SetInterceptorForTesting(URLRequestInterceptor* interceptor); | 66 static void SetInterceptorForTesting(URLRequestInterceptor* interceptor); |
| 64 | 67 |
| 65 ProtocolHandlerMap protocol_handler_map_; | 68 ProtocolHandlerMap protocol_handler_map_; |
| 66 | 69 |
| 67 DISALLOW_COPY_AND_ASSIGN(URLRequestJobFactoryImpl); | 70 DISALLOW_COPY_AND_ASSIGN(URLRequestJobFactoryImpl); |
| 68 }; | 71 }; |
| 69 | 72 |
| 70 } // namespace net | 73 } // namespace net |
| 71 | 74 |
| 72 #endif // NET_URL_REQUEST_URL_REQUEST_JOB_FACTORY_IMPL_H_ | 75 #endif // NET_URL_REQUEST_URL_REQUEST_JOB_FACTORY_IMPL_H_ |
| OLD | NEW |