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 <utility> | 7 #include <utility> |
8 | 8 |
9 #include "net/base/net_errors.h" | 9 #include "net/base/net_errors.h" |
10 #include "net/url_request/url_request_error_job.h" | 10 #include "net/url_request/url_request_error_job.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
42 URLRequestJob* AwURLRequestJobFactory::MaybeCreateJobWithProtocolHandler( | 42 URLRequestJob* AwURLRequestJobFactory::MaybeCreateJobWithProtocolHandler( |
43 const std::string& scheme, | 43 const std::string& scheme, |
44 URLRequest* request, | 44 URLRequest* request, |
45 NetworkDelegate* network_delegate) const { | 45 NetworkDelegate* network_delegate) const { |
46 URLRequestJob* job = next_factory_->MaybeCreateJobWithProtocolHandler( | 46 URLRequestJob* job = next_factory_->MaybeCreateJobWithProtocolHandler( |
47 scheme, request, network_delegate); | 47 scheme, request, network_delegate); |
48 | 48 |
49 if (job) | 49 if (job) |
50 return job; | 50 return job; |
51 | 51 |
52 // If URLRequest supports the scheme NULL should be returned from this method. | 52 // If a URLRequestJobManager built-in factory supports the scheme, NULL should |
53 // be returned from this method. | |
53 // In that case the built in handlers will then be used to create the job. | 54 // In that case the built in handlers will then be used to create the job. |
55 // TODO(mgersh): remove this check once HttpProtocolHandler exists and is | |
56 // added to the relevant URLRequestJobFactory. | |
mmenke
2016/04/21 19:13:33
Think you can remove this TODO? We'll have to kee
mgersh
2016/04/22 14:33:18
My understanding is that it's here only to allow t
mmenke
2016/04/22 14:54:36
I thought it was also here to distinguished "handl
mmenke
2016/04/22 14:56:00
Oh, I guess with that logic moved down to URLReque
| |
54 // NOTE(joth): See the assumption in IsHandledProtocol above. | 57 // NOTE(joth): See the assumption in IsHandledProtocol above. |
55 if (net::URLRequest::IsHandledProtocol(scheme)) | 58 if (next_factory_->IsHandledProtocol(scheme)) |
56 return NULL; | 59 return NULL; |
mmenke
2016/04/21 19:13:33
nit: While you're here, mind changing the NULL to
mgersh
2016/04/22 14:33:18
Not going to bother here, since I still think it c
| |
57 | 60 |
58 return new net::URLRequestErrorJob( | 61 return new net::URLRequestErrorJob( |
59 request, network_delegate, net::ERR_UNKNOWN_URL_SCHEME); | 62 request, network_delegate, net::ERR_UNKNOWN_URL_SCHEME); |
60 } | 63 } |
61 | 64 |
62 net::URLRequestJob* AwURLRequestJobFactory::MaybeInterceptRedirect( | 65 net::URLRequestJob* AwURLRequestJobFactory::MaybeInterceptRedirect( |
63 net::URLRequest* request, | 66 net::URLRequest* request, |
64 net::NetworkDelegate* network_delegate, | 67 net::NetworkDelegate* network_delegate, |
65 const GURL& location) const { | 68 const GURL& location) const { |
66 return next_factory_->MaybeInterceptRedirect( | 69 return next_factory_->MaybeInterceptRedirect( |
(...skipping 10 matching lines...) Expand all Loading... | |
77 const std::string& scheme, | 80 const std::string& scheme, |
78 std::unique_ptr<ProtocolHandler> protocol_handler) { | 81 std::unique_ptr<ProtocolHandler> protocol_handler) { |
79 return next_factory_->SetProtocolHandler(scheme, std::move(protocol_handler)); | 82 return next_factory_->SetProtocolHandler(scheme, std::move(protocol_handler)); |
80 } | 83 } |
81 | 84 |
82 bool AwURLRequestJobFactory::IsSafeRedirectTarget(const GURL& location) const { | 85 bool AwURLRequestJobFactory::IsSafeRedirectTarget(const GURL& location) const { |
83 return next_factory_->IsSafeRedirectTarget(location); | 86 return next_factory_->IsSafeRedirectTarget(location); |
84 } | 87 } |
85 | 88 |
86 } // namespace android_webview | 89 } // namespace android_webview |
OLD | NEW |