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 // An implementation of WebURLLoader in terms of ResourceLoaderBridge. | 5 // An implementation of WebURLLoader in terms of ResourceLoaderBridge. |
6 | 6 |
7 #include "webkit/child/weburlloader_impl.h" | 7 #include "webkit/child/weburlloader_impl.h" |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 #include "webkit/child/ftp_directory_listing_response_delegate.h" | 32 #include "webkit/child/ftp_directory_listing_response_delegate.h" |
33 #include "webkit/child/multipart_response_delegate.h" | 33 #include "webkit/child/multipart_response_delegate.h" |
34 #include "webkit/child/resource_loader_bridge.h" | 34 #include "webkit/child/resource_loader_bridge.h" |
35 #include "webkit/child/webkitplatformsupport_impl.h" | 35 #include "webkit/child/webkitplatformsupport_impl.h" |
36 #include "webkit/child/weburlrequest_extradata_impl.h" | 36 #include "webkit/child/weburlrequest_extradata_impl.h" |
37 #include "webkit/child/weburlresponse_extradata_impl.h" | 37 #include "webkit/child/weburlresponse_extradata_impl.h" |
38 #include "webkit/common/resource_request_body.h" | 38 #include "webkit/common/resource_request_body.h" |
39 | 39 |
40 using base::Time; | 40 using base::Time; |
41 using base::TimeTicks; | 41 using base::TimeTicks; |
42 using WebKit::WebData; | 42 using blink::WebData; |
43 using WebKit::WebHTTPBody; | 43 using blink::WebHTTPBody; |
44 using WebKit::WebHTTPHeaderVisitor; | 44 using blink::WebHTTPHeaderVisitor; |
45 using WebKit::WebHTTPLoadInfo; | 45 using blink::WebHTTPLoadInfo; |
46 using WebKit::WebReferrerPolicy; | 46 using blink::WebReferrerPolicy; |
47 using WebKit::WebSecurityPolicy; | 47 using blink::WebSecurityPolicy; |
48 using WebKit::WebString; | 48 using blink::WebString; |
49 using WebKit::WebURL; | 49 using blink::WebURL; |
50 using WebKit::WebURLError; | 50 using blink::WebURLError; |
51 using WebKit::WebURLLoadTiming; | 51 using blink::WebURLLoadTiming; |
52 using WebKit::WebURLLoader; | 52 using blink::WebURLLoader; |
53 using WebKit::WebURLLoaderClient; | 53 using blink::WebURLLoaderClient; |
54 using WebKit::WebURLRequest; | 54 using blink::WebURLRequest; |
55 using WebKit::WebURLResponse; | 55 using blink::WebURLResponse; |
56 | 56 |
57 namespace webkit_glue { | 57 namespace webkit_glue { |
58 | 58 |
59 // Utilities ------------------------------------------------------------------ | 59 // Utilities ------------------------------------------------------------------ |
60 | 60 |
61 namespace { | 61 namespace { |
62 | 62 |
63 const char kThrottledErrorDescription[] = | 63 const char kThrottledErrorDescription[] = |
64 "Request throttled. Visit http://dev.chromium.org/throttling for more " | 64 "Request throttled. Visit http://dev.chromium.org/throttling for more " |
65 "information."; | 65 "information."; |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 WebReferrerPolicy referrer_policy_; | 262 WebReferrerPolicy referrer_policy_; |
263 scoped_ptr<ResourceLoaderBridge> bridge_; | 263 scoped_ptr<ResourceLoaderBridge> bridge_; |
264 scoped_ptr<FtpDirectoryListingResponseDelegate> ftp_listing_delegate_; | 264 scoped_ptr<FtpDirectoryListingResponseDelegate> ftp_listing_delegate_; |
265 scoped_ptr<MultipartResponseDelegate> multipart_delegate_; | 265 scoped_ptr<MultipartResponseDelegate> multipart_delegate_; |
266 scoped_ptr<ResourceLoaderBridge> completed_bridge_; | 266 scoped_ptr<ResourceLoaderBridge> completed_bridge_; |
267 }; | 267 }; |
268 | 268 |
269 WebURLLoaderImpl::Context::Context(WebURLLoaderImpl* loader) | 269 WebURLLoaderImpl::Context::Context(WebURLLoaderImpl* loader) |
270 : loader_(loader), | 270 : loader_(loader), |
271 client_(NULL), | 271 client_(NULL), |
272 referrer_policy_(WebKit::WebReferrerPolicyDefault) { | 272 referrer_policy_(blink::WebReferrerPolicyDefault) { |
273 } | 273 } |
274 | 274 |
275 void WebURLLoaderImpl::Context::Cancel() { | 275 void WebURLLoaderImpl::Context::Cancel() { |
276 // The bridge will still send OnCompletedRequest, which will Release() us, so | 276 // The bridge will still send OnCompletedRequest, which will Release() us, so |
277 // we don't do that here. | 277 // we don't do that here. |
278 if (bridge_) | 278 if (bridge_) |
279 bridge_->Cancel(); | 279 bridge_->Cancel(); |
280 | 280 |
281 // Ensure that we do not notify the multipart delegate anymore as it has | 281 // Ensure that we do not notify the multipart delegate anymore as it has |
282 // its own pointer to the client. | 282 // its own pointer to the client. |
(...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
845 | 845 |
846 void WebURLLoaderImpl::setDefersLoading(bool value) { | 846 void WebURLLoaderImpl::setDefersLoading(bool value) { |
847 context_->SetDefersLoading(value); | 847 context_->SetDefersLoading(value); |
848 } | 848 } |
849 | 849 |
850 void WebURLLoaderImpl::didChangePriority(WebURLRequest::Priority new_priority) { | 850 void WebURLLoaderImpl::didChangePriority(WebURLRequest::Priority new_priority) { |
851 context_->DidChangePriority(new_priority); | 851 context_->DidChangePriority(new_priority); |
852 } | 852 } |
853 | 853 |
854 } // namespace webkit_glue | 854 } // namespace webkit_glue |
OLD | NEW |