| 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 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 return request_info; | 324 return request_info; |
| 325 } | 325 } |
| 326 | 326 |
| 327 ResourceDispatcher* dispatcher() { return dispatcher_.get(); } | 327 ResourceDispatcher* dispatcher() { return dispatcher_.get(); } |
| 328 | 328 |
| 329 int StartAsync(const RequestInfo& request_info, | 329 int StartAsync(const RequestInfo& request_info, |
| 330 ResourceRequestBodyImpl* request_body, | 330 ResourceRequestBodyImpl* request_body, |
| 331 TestRequestPeer::Context* peer_context) { | 331 TestRequestPeer::Context* peer_context) { |
| 332 std::unique_ptr<TestRequestPeer> peer( | 332 std::unique_ptr<TestRequestPeer> peer( |
| 333 new TestRequestPeer(dispatcher(), peer_context)); | 333 new TestRequestPeer(dispatcher(), peer_context)); |
| 334 int request_id = | 334 int request_id = dispatcher()->StartAsync( |
| 335 dispatcher()->StartAsync(request_info, request_body, std::move(peer)); | 335 request_info, request_body, std::move(peer), |
| 336 blink::WebURLRequest::LoadingIPCType::ChromeIPC, nullptr); |
| 336 peer_context->request_id = request_id; | 337 peer_context->request_id = request_id; |
| 337 return request_id; | 338 return request_id; |
| 338 } | 339 } |
| 339 | 340 |
| 340 private: | 341 private: |
| 341 // Map of request IDs to shared memory. | 342 // Map of request IDs to shared memory. |
| 342 std::map<int, base::SharedMemory*> shared_memory_map_; | 343 std::map<int, base::SharedMemory*> shared_memory_map_; |
| 343 | 344 |
| 344 std::vector<IPC::Message> message_queue_; | 345 std::vector<IPC::Message> message_queue_; |
| 345 base::MessageLoop message_loop_; | 346 base::MessageLoop message_loop_; |
| (...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 935 ResourceResponseHead response_head; | 936 ResourceResponseHead response_head; |
| 936 | 937 |
| 937 PerformTest(response_head); | 938 PerformTest(response_head); |
| 938 | 939 |
| 939 EXPECT_EQ(base::TimeTicks(), response_info().load_timing.request_start); | 940 EXPECT_EQ(base::TimeTicks(), response_info().load_timing.request_start); |
| 940 EXPECT_EQ(base::TimeTicks(), | 941 EXPECT_EQ(base::TimeTicks(), |
| 941 response_info().load_timing.connect_timing.dns_start); | 942 response_info().load_timing.connect_timing.dns_start); |
| 942 } | 943 } |
| 943 | 944 |
| 944 } // namespace content | 945 } // namespace content |
| OLD | NEW |