| 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 <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
| 13 #include "base/time/time.h" | 13 #include "base/time/time.h" |
| 14 #include "content/browser/loader/resource_controller.h" | 14 #include "content/browser/loader/resource_controller.h" |
| 15 #include "content/browser/ssl/ssl_client_auth_handler.h" | 15 #include "content/browser/ssl/ssl_client_auth_handler.h" |
| 16 #include "content/browser/ssl/ssl_error_handler.h" | 16 #include "content/browser/ssl/ssl_error_handler.h" |
| 17 #include "content/common/content_export.h" | 17 #include "content/common/content_export.h" |
| 18 #include "net/url_request/url_request.h" | 18 #include "net/url_request/url_request.h" |
| 19 #include "url/gurl.h" | |
| 20 | 19 |
| 21 namespace net { | 20 namespace net { |
| 22 class X509Certificate; | 21 class X509Certificate; |
| 23 } | 22 } |
| 24 | 23 |
| 25 namespace content { | 24 namespace content { |
| 26 class ResourceDispatcherHostLoginDelegate; | 25 class ResourceDispatcherHostLoginDelegate; |
| 27 class ResourceHandler; | 26 class ResourceHandler; |
| 28 class ResourceLoaderDelegate; | 27 class ResourceLoaderDelegate; |
| 29 class ResourceRequestInfoImpl; | 28 class ResourceRequestInfoImpl; |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 void CancelCertificateSelection() override; | 76 void CancelCertificateSelection() override; |
| 78 | 77 |
| 79 // ResourceController implementation: | 78 // ResourceController implementation: |
| 80 void Resume() override; | 79 void Resume() override; |
| 81 void Cancel() override; | 80 void Cancel() override; |
| 82 void CancelAndIgnore() override; | 81 void CancelAndIgnore() override; |
| 83 void CancelWithError(int error_code) override; | 82 void CancelWithError(int error_code) override; |
| 84 | 83 |
| 85 void StartRequestInternal(); | 84 void StartRequestInternal(); |
| 86 void CancelRequestInternal(int error, bool from_renderer); | 85 void CancelRequestInternal(int error, bool from_renderer); |
| 87 void FollowDeferredRedirectInternal(); | |
| 88 void CompleteResponseStarted(); | 86 void CompleteResponseStarted(); |
| 89 void ReadMore(bool is_continuation); | 87 void ReadMore(bool is_continuation); |
| 90 void ResumeReading(); | 88 void ResumeReading(); |
| 91 // Passes a read result to the handler. | 89 // Passes a read result to the handler. |
| 92 void CompleteRead(int bytes_read); | 90 void CompleteRead(int bytes_read); |
| 93 void ResponseCompleted(); | 91 void ResponseCompleted(); |
| 94 void CallDidFinishLoading(); | 92 void CallDidFinishLoading(); |
| 95 void RecordHistograms(); | 93 void RecordHistograms(); |
| 96 | 94 |
| 97 bool is_deferred() const { return deferred_stage_ != DEFERRED_NONE; } | 95 bool is_deferred() const { return deferred_stage_ != DEFERRED_NONE; } |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 | 132 |
| 135 // Called when a navigation has finished transfer. | 133 // Called when a navigation has finished transfer. |
| 136 base::Closure on_transfer_complete_callback_; | 134 base::Closure on_transfer_complete_callback_; |
| 137 | 135 |
| 138 // Instrumentation add to investigate http://crbug.com/503306. | 136 // Instrumentation add to investigate http://crbug.com/503306. |
| 139 // TODO(mmenke): Remove once bug is fixed. | 137 // TODO(mmenke): Remove once bug is fixed. |
| 140 int times_cancelled_before_request_start_; | 138 int times_cancelled_before_request_start_; |
| 141 bool started_request_; | 139 bool started_request_; |
| 142 int times_cancelled_after_request_start_; | 140 int times_cancelled_after_request_start_; |
| 143 | 141 |
| 144 // Stores the URL from a deferred redirect. | |
| 145 GURL deferred_redirect_url_; | |
| 146 | |
| 147 base::WeakPtrFactory<ResourceLoader> weak_ptr_factory_; | 142 base::WeakPtrFactory<ResourceLoader> weak_ptr_factory_; |
| 148 | 143 |
| 149 DISALLOW_COPY_AND_ASSIGN(ResourceLoader); | 144 DISALLOW_COPY_AND_ASSIGN(ResourceLoader); |
| 150 }; | 145 }; |
| 151 | 146 |
| 152 } // namespace content | 147 } // namespace content |
| 153 | 148 |
| 154 #endif // CONTENT_BROWSER_LOADER_RESOURCE_LOADER_H_ | 149 #endif // CONTENT_BROWSER_LOADER_RESOURCE_LOADER_H_ |
| OLD | NEW |