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 "android_webview/browser/net/aw_url_request_job_factory.h" | 5 #include "android_webview/browser/net/aw_url_request_job_factory.h" |
6 | 6 |
7 #include "net/base/net_errors.h" | 7 #include "net/base/net_errors.h" |
8 #include "net/url_request/url_request_error_job.h" | 8 #include "net/url_request/url_request_error_job.h" |
9 #include "net/url_request/url_request_job_factory_impl.h" | 9 #include "net/url_request/url_request_job_factory_impl.h" |
10 #include "net/url_request/url_request_job_manager.h" | 10 #include "net/url_request/url_request_job_manager.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 // If the URLRequestJobManager supports the scheme NULL should be returned | 50 // If the URLRequestJobManager supports the scheme NULL should be returned |
51 // from this method. In that case the built in handlers in | 51 // from this method. In that case the built in handlers in |
52 // URLRequestJobManager will then be used to create the job. | 52 // URLRequestJobManager will then be used to create the job. |
53 if (net::URLRequestJobManager::GetInstance()->SupportsScheme(scheme)) | 53 if (net::URLRequestJobManager::GetInstance()->SupportsScheme(scheme)) |
54 return NULL; | 54 return NULL; |
55 | 55 |
56 return new net::URLRequestErrorJob( | 56 return new net::URLRequestErrorJob( |
57 request, network_delegate, net::ERR_UNKNOWN_URL_SCHEME); | 57 request, network_delegate, net::ERR_UNKNOWN_URL_SCHEME); |
58 } | 58 } |
59 | 59 |
60 bool AwURLRequestJobFactory::SetProtocolHandler( | |
61 const std::string& scheme, | |
62 ProtocolHandler* protocol_handler) { | |
63 return next_factory_->SetProtocolHandler(scheme, protocol_handler); | |
64 } | |
65 | |
66 void AwURLRequestJobFactory::AddInterceptor(Interceptor* interceptor) { | |
67 next_factory_->AddInterceptor(interceptor); | |
68 } | |
69 | |
70 URLRequestJob* AwURLRequestJobFactory::MaybeCreateJobWithInterceptor( | 60 URLRequestJob* AwURLRequestJobFactory::MaybeCreateJobWithInterceptor( |
71 URLRequest* request, NetworkDelegate* network_delegate) const { | 61 URLRequest* request, NetworkDelegate* network_delegate) const { |
72 return next_factory_->MaybeCreateJobWithInterceptor( | 62 return next_factory_->MaybeCreateJobWithInterceptor( |
73 request, network_delegate); | 63 request, network_delegate); |
74 } | 64 } |
75 | 65 |
76 URLRequestJob* AwURLRequestJobFactory::MaybeInterceptRedirect( | 66 URLRequestJob* AwURLRequestJobFactory::MaybeInterceptRedirect( |
77 const GURL& location, | 67 const GURL& location, |
78 URLRequest* request, | 68 URLRequest* request, |
79 NetworkDelegate* network_delegate) const { | 69 NetworkDelegate* network_delegate) const { |
80 return next_factory_->MaybeInterceptRedirect( | 70 return next_factory_->MaybeInterceptRedirect( |
81 location, request, network_delegate); | 71 location, request, network_delegate); |
82 } | 72 } |
83 | 73 |
84 URLRequestJob* AwURLRequestJobFactory::MaybeInterceptResponse( | 74 URLRequestJob* AwURLRequestJobFactory::MaybeInterceptResponse( |
85 URLRequest* request, | 75 URLRequest* request, |
86 NetworkDelegate* network_delegate) const { | 76 NetworkDelegate* network_delegate) const { |
87 return next_factory_->MaybeInterceptResponse(request, network_delegate); | 77 return next_factory_->MaybeInterceptResponse(request, network_delegate); |
88 } | 78 } |
89 | 79 |
| 80 bool AwURLRequestJobFactory::SetProtocolHandler( |
| 81 const std::string& scheme, |
| 82 ProtocolHandler* protocol_handler) { |
| 83 return next_factory_->SetProtocolHandler(scheme, protocol_handler); |
| 84 } |
| 85 |
| 86 void AwURLRequestJobFactory::AddInterceptor(Interceptor* interceptor) { |
| 87 next_factory_->AddInterceptor(interceptor); |
| 88 } |
| 89 |
90 } // namespace android_webview | 90 } // namespace android_webview |
OLD | NEW |