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 #include "content/child/resource_dispatcher.h" | 5 #include "content/child/resource_dispatcher.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 14 matching lines...) Expand all Loading... |
25 #include "content/common/appcache_interfaces.h" | 25 #include "content/common/appcache_interfaces.h" |
26 #include "content/common/resource_messages.h" | 26 #include "content/common/resource_messages.h" |
27 #include "content/common/resource_request.h" | 27 #include "content/common/resource_request.h" |
28 #include "content/common/resource_request_completion_status.h" | 28 #include "content/common/resource_request_completion_status.h" |
29 #include "content/common/service_worker/service_worker_types.h" | 29 #include "content/common/service_worker/service_worker_types.h" |
30 #include "content/public/child/fixed_received_data.h" | 30 #include "content/public/child/fixed_received_data.h" |
31 #include "content/public/child/request_peer.h" | 31 #include "content/public/child/request_peer.h" |
32 #include "content/public/child/resource_dispatcher_delegate.h" | 32 #include "content/public/child/resource_dispatcher_delegate.h" |
33 #include "content/public/common/content_features.h" | 33 #include "content/public/common/content_features.h" |
34 #include "content/public/common/request_context_frame_type.h" | 34 #include "content/public/common/request_context_frame_type.h" |
| 35 #include "content/public/common/resource_request_body.h" |
35 #include "content/public/common/resource_response.h" | 36 #include "content/public/common/resource_response.h" |
36 #include "net/base/net_errors.h" | 37 #include "net/base/net_errors.h" |
37 #include "net/base/request_priority.h" | 38 #include "net/base/request_priority.h" |
38 #include "net/http/http_response_headers.h" | 39 #include "net/http/http_response_headers.h" |
39 #include "testing/gtest/include/gtest/gtest.h" | 40 #include "testing/gtest/include/gtest/gtest.h" |
40 #include "third_party/WebKit/public/platform/WebReferrerPolicy.h" | 41 #include "third_party/WebKit/public/platform/WebReferrerPolicy.h" |
41 #include "url/gurl.h" | 42 #include "url/gurl.h" |
42 | 43 |
43 namespace content { | 44 namespace content { |
44 | 45 |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 | 217 |
217 const RequestExtraData extra_data; | 218 const RequestExtraData extra_data; |
218 extra_data.CopyToResourceRequest(request.get()); | 219 extra_data.CopyToResourceRequest(request.get()); |
219 | 220 |
220 return request; | 221 return request; |
221 } | 222 } |
222 | 223 |
223 ResourceDispatcher* dispatcher() { return dispatcher_.get(); } | 224 ResourceDispatcher* dispatcher() { return dispatcher_.get(); } |
224 | 225 |
225 int StartAsync(std::unique_ptr<ResourceRequest> request, | 226 int StartAsync(std::unique_ptr<ResourceRequest> request, |
226 ResourceRequestBodyImpl* request_body, | 227 ResourceRequestBody* request_body, |
227 TestRequestPeer::Context* peer_context) { | 228 TestRequestPeer::Context* peer_context) { |
228 std::unique_ptr<TestRequestPeer> peer( | 229 std::unique_ptr<TestRequestPeer> peer( |
229 new TestRequestPeer(dispatcher(), peer_context)); | 230 new TestRequestPeer(dispatcher(), peer_context)); |
230 int request_id = dispatcher()->StartAsync( | 231 int request_id = dispatcher()->StartAsync( |
231 std::move(request), 0, nullptr, url::Origin(), std::move(peer), | 232 std::move(request), 0, nullptr, url::Origin(), std::move(peer), |
232 blink::WebURLRequest::LoadingIPCType::kChromeIPC, nullptr, | 233 blink::WebURLRequest::LoadingIPCType::kChromeIPC, nullptr, |
233 std::vector<std::unique_ptr<URLLoaderThrottle>>(), | 234 std::vector<std::unique_ptr<URLLoaderThrottle>>(), |
234 mojo::ScopedDataPipeConsumerHandle()); | 235 mojo::ScopedDataPipeConsumerHandle()); |
235 peer_context->request_id = request_id; | 236 peer_context->request_id = request_id; |
236 return request_id; | 237 return request_id; |
(...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
914 ResourceResponseHead response_head; | 915 ResourceResponseHead response_head; |
915 | 916 |
916 PerformTest(response_head); | 917 PerformTest(response_head); |
917 | 918 |
918 EXPECT_EQ(base::TimeTicks(), response_info().load_timing.request_start); | 919 EXPECT_EQ(base::TimeTicks(), response_info().load_timing.request_start); |
919 EXPECT_EQ(base::TimeTicks(), | 920 EXPECT_EQ(base::TimeTicks(), |
920 response_info().load_timing.connect_timing.dns_start); | 921 response_info().load_timing.connect_timing.dns_start); |
921 } | 922 } |
922 | 923 |
923 } // namespace content | 924 } // namespace content |
OLD | NEW |