| 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 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 | 323 |
| 324 ResourceDispatcher* dispatcher() { return dispatcher_.get(); } | 324 ResourceDispatcher* dispatcher() { return dispatcher_.get(); } |
| 325 | 325 |
| 326 int StartAsync(std::unique_ptr<ResourceRequest> request, | 326 int StartAsync(std::unique_ptr<ResourceRequest> request, |
| 327 ResourceRequestBodyImpl* request_body, | 327 ResourceRequestBodyImpl* request_body, |
| 328 TestRequestPeer::Context* peer_context) { | 328 TestRequestPeer::Context* peer_context) { |
| 329 std::unique_ptr<TestRequestPeer> peer( | 329 std::unique_ptr<TestRequestPeer> peer( |
| 330 new TestRequestPeer(dispatcher(), peer_context)); | 330 new TestRequestPeer(dispatcher(), peer_context)); |
| 331 int request_id = dispatcher()->StartAsync( | 331 int request_id = dispatcher()->StartAsync( |
| 332 std::move(request), 0, nullptr, GURL(), std::move(peer), | 332 std::move(request), 0, nullptr, GURL(), std::move(peer), |
| 333 blink::WebURLRequest::LoadingIPCType::ChromeIPC, nullptr); | 333 blink::WebURLRequest::LoadingIPCType::ChromeIPC, nullptr, nullptr); |
| 334 peer_context->request_id = request_id; | 334 peer_context->request_id = request_id; |
| 335 return request_id; | 335 return request_id; |
| 336 } | 336 } |
| 337 | 337 |
| 338 private: | 338 private: |
| 339 // Map of request IDs to shared memory. | 339 // Map of request IDs to shared memory. |
| 340 std::map<int, std::unique_ptr<base::SharedMemory>> shared_memory_map_; | 340 std::map<int, std::unique_ptr<base::SharedMemory>> shared_memory_map_; |
| 341 | 341 |
| 342 std::vector<IPC::Message> message_queue_; | 342 std::vector<IPC::Message> message_queue_; |
| 343 base::MessageLoop message_loop_; | 343 base::MessageLoop message_loop_; |
| (...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1038 ResourceResponseHead response_head; | 1038 ResourceResponseHead response_head; |
| 1039 | 1039 |
| 1040 PerformTest(response_head); | 1040 PerformTest(response_head); |
| 1041 | 1041 |
| 1042 EXPECT_EQ(base::TimeTicks(), response_info().load_timing.request_start); | 1042 EXPECT_EQ(base::TimeTicks(), response_info().load_timing.request_start); |
| 1043 EXPECT_EQ(base::TimeTicks(), | 1043 EXPECT_EQ(base::TimeTicks(), |
| 1044 response_info().load_timing.connect_timing.dns_start); | 1044 response_info().load_timing.connect_timing.dns_start); |
| 1045 } | 1045 } |
| 1046 | 1046 |
| 1047 } // namespace content | 1047 } // namespace content |
| OLD | NEW |