| 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 #ifndef CONTENT_BROWSER_RENDERER_HOST_RESOURCE_LOADER_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RESOURCE_LOADER_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_RESOURCE_LOADER_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_RESOURCE_LOADER_H_ |
| 7 #pragma once |
| 7 | 8 |
| 8 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| 10 #include "content/browser/renderer_host/resource_handler.h" | 11 #include "content/browser/renderer_host/resource_handler.h" |
| 11 #include "content/browser/ssl/ssl_error_handler.h" | 12 #include "content/browser/ssl/ssl_error_handler.h" |
| 12 #include "content/public/browser/resource_controller.h" | 13 #include "content/public/browser/resource_controller.h" |
| 13 #include "net/url_request/url_request.h" | 14 #include "net/url_request/url_request.h" |
| 14 | 15 |
| 15 class SSLClientAuthHandler; | 16 class SSLClientAuthHandler; |
| 16 | 17 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 int error, | 72 int error, |
| 72 const net::SSLInfo* ssl_info) OVERRIDE; | 73 const net::SSLInfo* ssl_info) OVERRIDE; |
| 73 virtual void ContinueSSLRequest(const GlobalRequestID& id) OVERRIDE; | 74 virtual void ContinueSSLRequest(const GlobalRequestID& id) OVERRIDE; |
| 74 | 75 |
| 75 // ResourceController implementation: | 76 // ResourceController implementation: |
| 76 virtual void Resume() OVERRIDE; | 77 virtual void Resume() OVERRIDE; |
| 77 virtual void Cancel() OVERRIDE; | 78 virtual void Cancel() OVERRIDE; |
| 78 | 79 |
| 79 void StartRequestInternal(); | 80 void StartRequestInternal(); |
| 80 void CancelRequestInternal(int error, bool from_renderer); | 81 void CancelRequestInternal(int error, bool from_renderer); |
| 81 bool CompleteResponseStarted(); | 82 void CompleteResponseStarted(); |
| 82 void StartReading(); | 83 void StartReading(bool is_continuation); |
| 83 bool ReadMore(int* bytes_read); | 84 void ResumeReading(); |
| 84 bool CompleteRead(int* bytes_read); | 85 void ReadMore(int* bytes_read); |
| 86 void CompleteRead(int bytes_read); |
| 85 void ResponseCompleted(); | 87 void ResponseCompleted(); |
| 86 bool PauseRequestIfNeeded(); | |
| 87 void PauseRequest(bool pause); | |
| 88 void ResumeRequest(); | |
| 89 void CallDidFinishLoading(); | 88 void CallDidFinishLoading(); |
| 90 | 89 |
| 90 bool is_deferred() const { return deferred_stage_ != DEFERRED_NONE; } |
| 91 |
| 91 enum DeferredStage { | 92 enum DeferredStage { |
| 92 DEFERRED_NONE, | 93 DEFERRED_NONE, |
| 93 DEFERRED_START, | 94 DEFERRED_START, |
| 94 DEFERRED_REDIRECT, | 95 DEFERRED_REDIRECT, |
| 95 DEFERRED_RESPONSE, | |
| 96 DEFERRED_READ, | 96 DEFERRED_READ, |
| 97 DEFERRED_FINISH | 97 DEFERRED_FINISH |
| 98 }; | 98 }; |
| 99 DeferredStage deferred_stage_; | 99 DeferredStage deferred_stage_; |
| 100 | 100 |
| 101 scoped_ptr<net::URLRequest> request_; | 101 scoped_ptr<net::URLRequest> request_; |
| 102 scoped_ptr<ResourceHandler> handler_; | 102 scoped_ptr<ResourceHandler> handler_; |
| 103 ResourceLoaderDelegate* delegate_; | 103 ResourceLoaderDelegate* delegate_; |
| 104 | 104 |
| 105 scoped_refptr<ResourceDispatcherHostLoginDelegate> login_delegate_; | 105 scoped_refptr<ResourceDispatcherHostLoginDelegate> login_delegate_; |
| 106 scoped_refptr<SSLClientAuthHandler> ssl_client_auth_handler_; | 106 scoped_refptr<SSLClientAuthHandler> ssl_client_auth_handler_; |
| 107 | 107 |
| 108 uint64 last_upload_position_; | 108 uint64 last_upload_position_; |
| 109 bool waiting_for_upload_progress_ack_; | 109 bool waiting_for_upload_progress_ack_; |
| 110 base::TimeTicks last_upload_ticks_; | 110 base::TimeTicks last_upload_ticks_; |
| 111 | 111 |
| 112 bool called_on_response_started_; | |
| 113 bool has_started_reading_; | |
| 114 | |
| 115 bool is_paused_; | |
| 116 int pause_count_; | |
| 117 int paused_read_bytes_; | |
| 118 | |
| 119 // Indicates that we are in a state of being transferred to a new downstream | 112 // Indicates that we are in a state of being transferred to a new downstream |
| 120 // consumer. We are waiting for a notification to complete the transfer, at | 113 // consumer. We are waiting for a notification to complete the transfer, at |
| 121 // which point we'll receive a new ResourceHandler. | 114 // which point we'll receive a new ResourceHandler. |
| 122 bool is_transferring_; | 115 bool is_transferring_; |
| 123 | 116 |
| 124 DISALLOW_COPY_AND_ASSIGN(ResourceLoader); | 117 DISALLOW_COPY_AND_ASSIGN(ResourceLoader); |
| 125 }; | 118 }; |
| 126 | 119 |
| 127 } // namespace content | 120 } // namespace content |
| 128 | 121 |
| 129 #endif // CONTENT_BROWSER_RENDERER_HOST_RESOURCE_LOADER_H_ | 122 #endif // CONTENT_BROWSER_RENDERER_HOST_RESOURCE_LOADER_H_ |
| OLD | NEW |