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 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 return request_info; | 314 return request_info; |
315 } | 315 } |
316 | 316 |
317 ResourceDispatcher* dispatcher() { return dispatcher_.get(); } | 317 ResourceDispatcher* dispatcher() { return dispatcher_.get(); } |
318 | 318 |
319 int StartAsync(const RequestInfo& request_info, | 319 int StartAsync(const RequestInfo& request_info, |
320 ResourceRequestBody* request_body, | 320 ResourceRequestBody* request_body, |
321 TestRequestPeer::Context* peer_context) { | 321 TestRequestPeer::Context* peer_context) { |
322 std::unique_ptr<TestRequestPeer> peer( | 322 std::unique_ptr<TestRequestPeer> peer( |
323 new TestRequestPeer(dispatcher(), peer_context)); | 323 new TestRequestPeer(dispatcher(), peer_context)); |
324 int request_id = | 324 int request_id = dispatcher()->StartAsync( |
325 dispatcher()->StartAsync(request_info, request_body, std::move(peer)); | 325 request_info, request_body, std::move(peer), |
| 326 blink::WebURLRequest::LoadingIPCType::ChromeIPC, nullptr); |
326 peer_context->request_id = request_id; | 327 peer_context->request_id = request_id; |
327 return request_id; | 328 return request_id; |
328 } | 329 } |
329 | 330 |
330 private: | 331 private: |
331 // Map of request IDs to shared memory. | 332 // Map of request IDs to shared memory. |
332 std::map<int, base::SharedMemory*> shared_memory_map_; | 333 std::map<int, base::SharedMemory*> shared_memory_map_; |
333 | 334 |
334 std::vector<IPC::Message> message_queue_; | 335 std::vector<IPC::Message> message_queue_; |
335 base::MessageLoop message_loop_; | 336 base::MessageLoop message_loop_; |
(...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
896 ResourceResponseHead response_head; | 897 ResourceResponseHead response_head; |
897 | 898 |
898 PerformTest(response_head); | 899 PerformTest(response_head); |
899 | 900 |
900 EXPECT_EQ(base::TimeTicks(), response_info().load_timing.request_start); | 901 EXPECT_EQ(base::TimeTicks(), response_info().load_timing.request_start); |
901 EXPECT_EQ(base::TimeTicks(), | 902 EXPECT_EQ(base::TimeTicks(), |
902 response_info().load_timing.connect_timing.dns_start); | 903 response_info().load_timing.connect_timing.dns_start); |
903 } | 904 } |
904 | 905 |
905 } // namespace content | 906 } // namespace content |
OLD | NEW |