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 19 matching lines...) Expand all Loading... |
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::URLLoaderAssociatedRequest, |
40 mojom::URLLoaderClientAssociatedPtr)>; | 40 mojom::URLLoaderClientPtr)>; |
41 | 41 |
42 // Returns the ResourceRequestInfoImpl associated with the given URLRequest. | 42 // Returns the ResourceRequestInfoImpl associated with the given URLRequest. |
43 CONTENT_EXPORT static ResourceRequestInfoImpl* ForRequest( | 43 CONTENT_EXPORT static ResourceRequestInfoImpl* ForRequest( |
44 net::URLRequest* request); | 44 net::URLRequest* request); |
45 | 45 |
46 // And, a const version for cases where you only need read access. | 46 // And, a const version for cases where you only need read access. |
47 CONTENT_EXPORT static const ResourceRequestInfoImpl* ForRequest( | 47 CONTENT_EXPORT static const ResourceRequestInfoImpl* ForRequest( |
48 const net::URLRequest* request); | 48 const net::URLRequest* request); |
49 | 49 |
50 CONTENT_EXPORT ResourceRequestInfoImpl( | 50 CONTENT_EXPORT ResourceRequestInfoImpl( |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 // Updates the data associated with this request after it is is transferred | 119 // 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. | 120 // 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 | 121 // We do not expect the ResourceContext to change during navigation, so that |
122 // does not need to be updated. | 122 // does not need to be updated. |
123 void UpdateForTransfer(int route_id, | 123 void UpdateForTransfer(int route_id, |
124 int render_frame_id, | 124 int render_frame_id, |
125 int origin_pid, | 125 int origin_pid, |
126 int request_id, | 126 int request_id, |
127 ResourceRequesterInfo* requester_info, | 127 ResourceRequesterInfo* requester_info, |
128 mojom::URLLoaderAssociatedRequest url_loader_request, | 128 mojom::URLLoaderAssociatedRequest url_loader_request, |
129 mojom::URLLoaderClientAssociatedPtr url_loader_client); | 129 mojom::URLLoaderClientPtr url_loader_client); |
130 | 130 |
131 // Whether this request is part of a navigation that should replace the | 131 // 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 | 132 // current session history entry. This state is shuffled up and down the stack |
133 // for request transfers. | 133 // for request transfers. |
134 bool should_replace_current_entry() const { | 134 bool should_replace_current_entry() const { |
135 return should_replace_current_entry_; | 135 return should_replace_current_entry_; |
136 } | 136 } |
137 | 137 |
138 // DetachableResourceHandler for this request. May be NULL. | 138 // DetachableResourceHandler for this request. May be NULL. |
139 DetachableResourceHandler* detachable_handler() const { | 139 DetachableResourceHandler* detachable_handler() const { |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 // and remote endpoint. This callback will be removed once PlzNavigate is | 245 // and remote endpoint. This callback will be removed once PlzNavigate is |
246 // shipped. | 246 // shipped. |
247 TransferCallback on_transfer_; | 247 TransferCallback on_transfer_; |
248 | 248 |
249 DISALLOW_COPY_AND_ASSIGN(ResourceRequestInfoImpl); | 249 DISALLOW_COPY_AND_ASSIGN(ResourceRequestInfoImpl); |
250 }; | 250 }; |
251 | 251 |
252 } // namespace content | 252 } // namespace content |
253 | 253 |
254 #endif // CONTENT_BROWSER_LOADER_RESOURCE_REQUEST_INFO_IMPL_H_ | 254 #endif // CONTENT_BROWSER_LOADER_RESOURCE_REQUEST_INFO_IMPL_H_ |
OLD | NEW |