| 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_REQUEST_INFO_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_LOADER_RESOURCE_REQUEST_INFO_IMPL_H_ |
| 6 #define CONTENT_BROWSER_LOADER_RESOURCE_REQUEST_INFO_IMPL_H_ | 6 #define CONTENT_BROWSER_LOADER_RESOURCE_REQUEST_INFO_IMPL_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 class ResourceContext; | 29 class ResourceContext; |
| 30 struct GlobalRequestID; | 30 struct GlobalRequestID; |
| 31 struct GlobalRoutingID; | 31 struct GlobalRoutingID; |
| 32 | 32 |
| 33 // Holds the data ResourceDispatcherHost associates with each request. | 33 // Holds the data ResourceDispatcherHost associates with each request. |
| 34 // Retrieve this data by calling ResourceDispatcherHost::InfoForRequest. | 34 // Retrieve this data by calling ResourceDispatcherHost::InfoForRequest. |
| 35 class ResourceRequestInfoImpl : public ResourceRequestInfo, | 35 class ResourceRequestInfoImpl : public ResourceRequestInfo, |
| 36 public base::SupportsUserData::Data { | 36 public base::SupportsUserData::Data { |
| 37 public: | 37 public: |
| 38 using TransferCallback = | 38 using TransferCallback = |
| 39 base::Callback<void(mojom::URLLoaderAssociatedRequest, | 39 base::Callback<void(mojom::URLLoaderRequest, mojom::URLLoaderClientPtr)>; |
| 40 mojom::URLLoaderClientPtr)>; | |
| 41 | 40 |
| 42 // Returns the ResourceRequestInfoImpl associated with the given URLRequest. | 41 // Returns the ResourceRequestInfoImpl associated with the given URLRequest. |
| 43 CONTENT_EXPORT static ResourceRequestInfoImpl* ForRequest( | 42 CONTENT_EXPORT static ResourceRequestInfoImpl* ForRequest( |
| 44 net::URLRequest* request); | 43 net::URLRequest* request); |
| 45 | 44 |
| 46 // And, a const version for cases where you only need read access. | 45 // And, a const version for cases where you only need read access. |
| 47 CONTENT_EXPORT static const ResourceRequestInfoImpl* ForRequest( | 46 CONTENT_EXPORT static const ResourceRequestInfoImpl* ForRequest( |
| 48 const net::URLRequest* request); | 47 const net::URLRequest* request); |
| 49 | 48 |
| 50 CONTENT_EXPORT ResourceRequestInfoImpl( | 49 CONTENT_EXPORT ResourceRequestInfoImpl( |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 | 117 |
| 119 // Updates the data associated with this request after it is is transferred | 118 // Updates the data associated with this request after it is is transferred |
| 120 // to a new renderer process. Not all data will change during a transfer. | 119 // to a new renderer process. Not all data will change during a transfer. |
| 121 // We do not expect the ResourceContext to change during navigation, so that | 120 // We do not expect the ResourceContext to change during navigation, so that |
| 122 // does not need to be updated. | 121 // does not need to be updated. |
| 123 void UpdateForTransfer(int route_id, | 122 void UpdateForTransfer(int route_id, |
| 124 int render_frame_id, | 123 int render_frame_id, |
| 125 int origin_pid, | 124 int origin_pid, |
| 126 int request_id, | 125 int request_id, |
| 127 ResourceRequesterInfo* requester_info, | 126 ResourceRequesterInfo* requester_info, |
| 128 mojom::URLLoaderAssociatedRequest url_loader_request, | 127 mojom::URLLoaderRequest url_loader_request, |
| 129 mojom::URLLoaderClientPtr url_loader_client); | 128 mojom::URLLoaderClientPtr url_loader_client); |
| 130 | 129 |
| 131 // Whether this request is part of a navigation that should replace the | 130 // Whether this request is part of a navigation that should replace the |
| 132 // current session history entry. This state is shuffled up and down the stack | 131 // current session history entry. This state is shuffled up and down the stack |
| 133 // for request transfers. | 132 // for request transfers. |
| 134 bool should_replace_current_entry() const { | 133 bool should_replace_current_entry() const { |
| 135 return should_replace_current_entry_; | 134 return should_replace_current_entry_; |
| 136 } | 135 } |
| 137 | 136 |
| 138 // DetachableResourceHandler for this request. May be NULL. | 137 // DetachableResourceHandler for this request. May be NULL. |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 // and remote endpoint. This callback will be removed once PlzNavigate is | 242 // and remote endpoint. This callback will be removed once PlzNavigate is |
| 244 // shipped. | 243 // shipped. |
| 245 TransferCallback on_transfer_; | 244 TransferCallback on_transfer_; |
| 246 | 245 |
| 247 DISALLOW_COPY_AND_ASSIGN(ResourceRequestInfoImpl); | 246 DISALLOW_COPY_AND_ASSIGN(ResourceRequestInfoImpl); |
| 248 }; | 247 }; |
| 249 | 248 |
| 250 } // namespace content | 249 } // namespace content |
| 251 | 250 |
| 252 #endif // CONTENT_BROWSER_LOADER_RESOURCE_REQUEST_INFO_IMPL_H_ | 251 #endif // CONTENT_BROWSER_LOADER_RESOURCE_REQUEST_INFO_IMPL_H_ |
| OLD | NEW |