| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "content/child/web_url_loader_impl.h" | 7 #include "content/child/web_url_loader_impl.h" |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 void Cancel(); | 296 void Cancel(); |
| 297 void SetDefersLoading(bool value); | 297 void SetDefersLoading(bool value); |
| 298 void DidChangePriority(WebURLRequest::Priority new_priority, | 298 void DidChangePriority(WebURLRequest::Priority new_priority, |
| 299 int intra_priority_value); | 299 int intra_priority_value); |
| 300 bool AttachThreadedDataReceiver( | 300 bool AttachThreadedDataReceiver( |
| 301 blink::WebThreadedDataReceiver* threaded_data_receiver); | 301 blink::WebThreadedDataReceiver* threaded_data_receiver); |
| 302 void Start(const WebURLRequest& request, | 302 void Start(const WebURLRequest& request, |
| 303 SyncLoadResponse* sync_load_response); | 303 SyncLoadResponse* sync_load_response); |
| 304 | 304 |
| 305 // RequestPeer methods: | 305 // RequestPeer methods: |
| 306 virtual void OnUploadProgress(uint64 position, uint64 size) override; | 306 void OnUploadProgress(uint64 position, uint64 size) override; |
| 307 virtual bool OnReceivedRedirect(const net::RedirectInfo& redirect_info, | 307 bool OnReceivedRedirect(const net::RedirectInfo& redirect_info, |
| 308 const ResourceResponseInfo& info) override; | 308 const ResourceResponseInfo& info) override; |
| 309 virtual void OnReceivedResponse(const ResourceResponseInfo& info) override; | 309 void OnReceivedResponse(const ResourceResponseInfo& info) override; |
| 310 virtual void OnDownloadedData(int len, int encoded_data_length) override; | 310 void OnDownloadedData(int len, int encoded_data_length) override; |
| 311 virtual void OnReceivedData(const char* data, | 311 void OnReceivedData(const char* data, |
| 312 int data_length, | 312 int data_length, |
| 313 int encoded_data_length) override; | 313 int encoded_data_length) override; |
| 314 virtual void OnReceivedCachedMetadata(const char* data, int len) override; | 314 void OnReceivedCachedMetadata(const char* data, int len) override; |
| 315 virtual void OnCompletedRequest( | 315 void OnCompletedRequest(int error_code, |
| 316 int error_code, | 316 bool was_ignored_by_handler, |
| 317 bool was_ignored_by_handler, | 317 bool stale_copy_in_cache, |
| 318 bool stale_copy_in_cache, | 318 const std::string& security_info, |
| 319 const std::string& security_info, | 319 const base::TimeTicks& completion_time, |
| 320 const base::TimeTicks& completion_time, | 320 int64 total_transfer_size) override; |
| 321 int64 total_transfer_size) override; | |
| 322 | 321 |
| 323 private: | 322 private: |
| 324 friend class base::RefCounted<Context>; | 323 friend class base::RefCounted<Context>; |
| 325 virtual ~Context() {} | 324 ~Context() override {} |
| 326 | 325 |
| 327 // We can optimize the handling of data URLs in most cases. | 326 // We can optimize the handling of data URLs in most cases. |
| 328 bool CanHandleDataURLRequestLocally() const; | 327 bool CanHandleDataURLRequestLocally() const; |
| 329 void HandleDataURL(); | 328 void HandleDataURL(); |
| 330 | 329 |
| 331 WebURLLoaderImpl* loader_; | 330 WebURLLoaderImpl* loader_; |
| 332 WebURLRequest request_; | 331 WebURLRequest request_; |
| 333 WebURLLoaderClient* client_; | 332 WebURLLoaderClient* client_; |
| 334 ResourceDispatcher* resource_dispatcher_; | 333 ResourceDispatcher* resource_dispatcher_; |
| 335 WebReferrerPolicy referrer_policy_; | 334 WebReferrerPolicy referrer_policy_; |
| (...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 982 int intra_priority_value) { | 981 int intra_priority_value) { |
| 983 context_->DidChangePriority(new_priority, intra_priority_value); | 982 context_->DidChangePriority(new_priority, intra_priority_value); |
| 984 } | 983 } |
| 985 | 984 |
| 986 bool WebURLLoaderImpl::attachThreadedDataReceiver( | 985 bool WebURLLoaderImpl::attachThreadedDataReceiver( |
| 987 blink::WebThreadedDataReceiver* threaded_data_receiver) { | 986 blink::WebThreadedDataReceiver* threaded_data_receiver) { |
| 988 return context_->AttachThreadedDataReceiver(threaded_data_receiver); | 987 return context_->AttachThreadedDataReceiver(threaded_data_receiver); |
| 989 } | 988 } |
| 990 | 989 |
| 991 } // namespace content | 990 } // namespace content |
| OLD | NEW |