| 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_LOADER_RESOURCE_LOADER_H_ | 5 #ifndef CONTENT_BROWSER_LOADER_RESOURCE_LOADER_H_ |
| 6 #define CONTENT_BROWSER_LOADER_RESOURCE_LOADER_H_ | 6 #define CONTENT_BROWSER_LOADER_RESOURCE_LOADER_H_ |
| 7 | 7 |
| 8 #include "base/gtest_prod_util.h" | 8 #include "base/gtest_prod_util.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| 11 #include "content/browser/loader/resource_handler.h" | 11 #include "content/browser/loader/resource_handler.h" |
| 12 #include "content/browser/ssl/ssl_error_handler.h" | 12 #include "content/browser/ssl/ssl_error_handler.h" |
| 13 #include "content/common/content_export.h" | 13 #include "content/common/content_export.h" |
| 14 #include "content/public/browser/resource_controller.h" | 14 #include "content/public/browser/resource_controller.h" |
| 15 #include "net/url_request/url_request.h" | 15 #include "net/url_request/url_request.h" |
| 16 | 16 |
| 17 namespace net { | |
| 18 class ClientCertStore; | |
| 19 } | |
| 20 | |
| 21 namespace content { | 17 namespace content { |
| 22 class ResourceDispatcherHostLoginDelegate; | 18 class ResourceDispatcherHostLoginDelegate; |
| 23 class ResourceLoaderDelegate; | 19 class ResourceLoaderDelegate; |
| 24 class ResourceRequestInfoImpl; | 20 class ResourceRequestInfoImpl; |
| 25 class SSLClientAuthHandler; | 21 class SSLClientAuthHandler; |
| 26 | 22 |
| 27 // This class is responsible for driving the URLRequest (i.e., calling Start, | 23 // This class is responsible for driving the URLRequest (i.e., calling Start, |
| 28 // Read, and servicing events). It has a ResourceHandler, which is typically a | 24 // Read, and servicing events). It has a ResourceHandler, which is typically a |
| 29 // chain of ResourceHandlers, and is the ResourceController for its handler. | 25 // chain of ResourceHandlers, and is the ResourceController for its handler. |
| 30 class CONTENT_EXPORT ResourceLoader : public net::URLRequest::Delegate, | 26 class CONTENT_EXPORT ResourceLoader : public net::URLRequest::Delegate, |
| (...skipping 19 matching lines...) Expand all Loading... |
| 50 | 46 |
| 51 void ClearLoginDelegate(); | 47 void ClearLoginDelegate(); |
| 52 void ClearSSLClientAuthHandler(); | 48 void ClearSSLClientAuthHandler(); |
| 53 | 49 |
| 54 // IPC message handlers: | 50 // IPC message handlers: |
| 55 void OnUploadProgressACK(); | 51 void OnUploadProgressACK(); |
| 56 | 52 |
| 57 private: | 53 private: |
| 58 FRIEND_TEST_ALL_PREFIXES(ResourceLoaderTest, ClientCertStoreLookup); | 54 FRIEND_TEST_ALL_PREFIXES(ResourceLoaderTest, ClientCertStoreLookup); |
| 59 | 55 |
| 60 ResourceLoader(scoped_ptr<net::URLRequest> request, | |
| 61 scoped_ptr<ResourceHandler> handler, | |
| 62 ResourceLoaderDelegate* delegate, | |
| 63 scoped_ptr<net::ClientCertStore> client_cert_store); | |
| 64 | |
| 65 // Initialization logic shared between the public and private constructor. | |
| 66 void Init(scoped_ptr<net::URLRequest> request, | |
| 67 scoped_ptr<ResourceHandler> handler, | |
| 68 ResourceLoaderDelegate* delegate, | |
| 69 scoped_ptr<net::ClientCertStore> client_cert_store); | |
| 70 | |
| 71 // net::URLRequest::Delegate implementation: | 56 // net::URLRequest::Delegate implementation: |
| 72 virtual void OnReceivedRedirect(net::URLRequest* request, | 57 virtual void OnReceivedRedirect(net::URLRequest* request, |
| 73 const GURL& new_url, | 58 const GURL& new_url, |
| 74 bool* defer) OVERRIDE; | 59 bool* defer) OVERRIDE; |
| 75 virtual void OnAuthRequired(net::URLRequest* request, | 60 virtual void OnAuthRequired(net::URLRequest* request, |
| 76 net::AuthChallengeInfo* info) OVERRIDE; | 61 net::AuthChallengeInfo* info) OVERRIDE; |
| 77 virtual void OnCertificateRequested(net::URLRequest* request, | 62 virtual void OnCertificateRequested(net::URLRequest* request, |
| 78 net::SSLCertRequestInfo* info) OVERRIDE; | 63 net::SSLCertRequestInfo* info) OVERRIDE; |
| 79 virtual void OnSSLCertificateError(net::URLRequest* request, | 64 virtual void OnSSLCertificateError(net::URLRequest* request, |
| 80 const net::SSLInfo& info, | 65 const net::SSLInfo& info, |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 uint64 last_upload_position_; | 111 uint64 last_upload_position_; |
| 127 bool waiting_for_upload_progress_ack_; | 112 bool waiting_for_upload_progress_ack_; |
| 128 base::TimeTicks last_upload_ticks_; | 113 base::TimeTicks last_upload_ticks_; |
| 129 base::TimeTicks read_deferral_start_time_; | 114 base::TimeTicks read_deferral_start_time_; |
| 130 | 115 |
| 131 // Indicates that we are in a state of being transferred to a new downstream | 116 // Indicates that we are in a state of being transferred to a new downstream |
| 132 // consumer. We are waiting for a notification to complete the transfer, at | 117 // consumer. We are waiting for a notification to complete the transfer, at |
| 133 // which point we'll receive a new ResourceHandler. | 118 // which point we'll receive a new ResourceHandler. |
| 134 bool is_transferring_; | 119 bool is_transferring_; |
| 135 | 120 |
| 136 scoped_ptr<net::ClientCertStore> client_cert_store_; | |
| 137 | |
| 138 base::WeakPtrFactory<ResourceLoader> weak_ptr_factory_; | 121 base::WeakPtrFactory<ResourceLoader> weak_ptr_factory_; |
| 139 | 122 |
| 140 DISALLOW_COPY_AND_ASSIGN(ResourceLoader); | 123 DISALLOW_COPY_AND_ASSIGN(ResourceLoader); |
| 141 }; | 124 }; |
| 142 | 125 |
| 143 } // namespace content | 126 } // namespace content |
| 144 | 127 |
| 145 #endif // CONTENT_BROWSER_LOADER_RESOURCE_LOADER_H_ | 128 #endif // CONTENT_BROWSER_LOADER_RESOURCE_LOADER_H_ |
| OLD | NEW |