| 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_PUBLIC_BROWSER_RESOURCE_DISPATCHER_HOST_DELEGATE_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_RESOURCE_DISPATCHER_HOST_DELEGATE_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_RESOURCE_DISPATCHER_HOST_DELEGATE_H_ | 6 #define CONTENT_PUBLIC_BROWSER_RESOURCE_DISPATCHER_HOST_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
| 13 #include "base/time/time.h" | 13 #include "base/time/time.h" |
| 14 #include "content/common/content_export.h" | 14 #include "content/common/content_export.h" |
| 15 #include "content/public/browser/resource_request_info.h" | 15 #include "content/public/browser/resource_request_info.h" |
| 16 #include "content/public/common/previews_state.h" |
| 16 #include "content/public/common/resource_type.h" | 17 #include "content/public/common/resource_type.h" |
| 17 #include "ui/base/page_transition_types.h" | 18 #include "ui/base/page_transition_types.h" |
| 18 | 19 |
| 19 class GURL; | 20 class GURL; |
| 20 namespace net { | 21 namespace net { |
| 21 class AuthChallengeInfo; | 22 class AuthChallengeInfo; |
| 22 class ClientCertStore; | 23 class ClientCertStore; |
| 23 class URLRequest; | 24 class URLRequest; |
| 24 } | 25 } |
| 25 | 26 |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 net::URLRequest* request, | 116 net::URLRequest* request, |
| 116 ResourceContext* resource_context, | 117 ResourceContext* resource_context, |
| 117 ResourceResponse* response); | 118 ResourceResponse* response); |
| 118 | 119 |
| 119 // Notification that a request has completed. | 120 // Notification that a request has completed. |
| 120 virtual void RequestComplete(net::URLRequest* url_request, int net_error); | 121 virtual void RequestComplete(net::URLRequest* url_request, int net_error); |
| 121 // Deprecated. | 122 // Deprecated. |
| 122 // TODO(maksims): Remove this once all the callers are modified. | 123 // TODO(maksims): Remove this once all the callers are modified. |
| 123 virtual void RequestComplete(net::URLRequest* url_request); | 124 virtual void RequestComplete(net::URLRequest* url_request); |
| 124 | 125 |
| 125 // Asks the embedder if Lo-Fi mode should be enabled for the given request. It | 126 // Asks the embedder for the PreviewsState which says which previews should |
| 126 // is only called for requests with an unspecified Lo-Fi value. | 127 // be enabled for the given request. The PreviewsState is a bitmask of |
| 127 virtual bool ShouldEnableLoFiMode(const net::URLRequest& url_request, | 128 // potentially several Previews optimizations. It is only called for requests |
| 128 content::ResourceContext* resource_context); | 129 // with an unspecified Previews state. |
| 130 virtual PreviewsState GetPreviewsState( |
| 131 const net::URLRequest& url_request, |
| 132 content::ResourceContext* resource_context); |
| 129 | 133 |
| 130 // Asks the embedder for NavigationData related to this request. It is only | 134 // Asks the embedder for NavigationData related to this request. It is only |
| 131 // called for navigation requests. | 135 // called for navigation requests. |
| 132 virtual NavigationData* GetNavigationData(net::URLRequest* request) const; | 136 virtual NavigationData* GetNavigationData(net::URLRequest* request) const; |
| 133 | 137 |
| 134 // Get platform ClientCertStore. May return nullptr. | 138 // Get platform ClientCertStore. May return nullptr. |
| 135 virtual std::unique_ptr<net::ClientCertStore> CreateClientCertStore( | 139 virtual std::unique_ptr<net::ClientCertStore> CreateClientCertStore( |
| 136 ResourceContext* resource_context); | 140 ResourceContext* resource_context); |
| 137 | 141 |
| 138 // Notification that a main frame load was aborted. The |request_loading_time| | 142 // Notification that a main frame load was aborted. The |request_loading_time| |
| 139 // parameter contains the time between the load request start and abort. | 143 // parameter contains the time between the load request start and abort. |
| 140 // Called on the IO thread. | 144 // Called on the IO thread. |
| 141 virtual void OnAbortedFrameLoad(const GURL& url, | 145 virtual void OnAbortedFrameLoad(const GURL& url, |
| 142 base::TimeDelta request_loading_time); | 146 base::TimeDelta request_loading_time); |
| 143 | 147 |
| 144 protected: | 148 protected: |
| 145 virtual ~ResourceDispatcherHostDelegate(); | 149 virtual ~ResourceDispatcherHostDelegate(); |
| 146 }; | 150 }; |
| 147 | 151 |
| 148 } // namespace content | 152 } // namespace content |
| 149 | 153 |
| 150 #endif // CONTENT_PUBLIC_BROWSER_RESOURCE_DISPATCHER_HOST_DELEGATE_H_ | 154 #endif // CONTENT_PUBLIC_BROWSER_RESOURCE_DISPATCHER_HOST_DELEGATE_H_ |
| OLD | NEW |