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