| 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 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 ResourceDispatcher* dispatcher() { return dispatcher_.get(); } | 223 ResourceDispatcher* dispatcher() { return dispatcher_.get(); } |
| 224 | 224 |
| 225 int StartAsync(std::unique_ptr<ResourceRequest> request, | 225 int StartAsync(std::unique_ptr<ResourceRequest> request, |
| 226 ResourceRequestBodyImpl* request_body, | 226 ResourceRequestBodyImpl* request_body, |
| 227 TestRequestPeer::Context* peer_context) { | 227 TestRequestPeer::Context* peer_context) { |
| 228 std::unique_ptr<TestRequestPeer> peer( | 228 std::unique_ptr<TestRequestPeer> peer( |
| 229 new TestRequestPeer(dispatcher(), peer_context)); | 229 new TestRequestPeer(dispatcher(), peer_context)); |
| 230 int request_id = dispatcher()->StartAsync( | 230 int request_id = dispatcher()->StartAsync( |
| 231 std::move(request), 0, nullptr, url::Origin(), std::move(peer), | 231 std::move(request), 0, nullptr, url::Origin(), std::move(peer), |
| 232 blink::WebURLRequest::LoadingIPCType::kChromeIPC, nullptr, | 232 blink::WebURLRequest::LoadingIPCType::kChromeIPC, nullptr, |
| 233 std::vector<std::unique_ptr<URLLoaderThrottle>>(), |
| 233 mojo::ScopedDataPipeConsumerHandle()); | 234 mojo::ScopedDataPipeConsumerHandle()); |
| 234 peer_context->request_id = request_id; | 235 peer_context->request_id = request_id; |
| 235 return request_id; | 236 return request_id; |
| 236 } | 237 } |
| 237 | 238 |
| 238 private: | 239 private: |
| 239 // Map of request IDs to shared memory. | 240 // Map of request IDs to shared memory. |
| 240 std::map<int, std::unique_ptr<base::SharedMemory>> shared_memory_map_; | 241 std::map<int, std::unique_ptr<base::SharedMemory>> shared_memory_map_; |
| 241 | 242 |
| 242 std::vector<IPC::Message> message_queue_; | 243 std::vector<IPC::Message> message_queue_; |
| (...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 913 ResourceResponseHead response_head; | 914 ResourceResponseHead response_head; |
| 914 | 915 |
| 915 PerformTest(response_head); | 916 PerformTest(response_head); |
| 916 | 917 |
| 917 EXPECT_EQ(base::TimeTicks(), response_info().load_timing.request_start); | 918 EXPECT_EQ(base::TimeTicks(), response_info().load_timing.request_start); |
| 918 EXPECT_EQ(base::TimeTicks(), | 919 EXPECT_EQ(base::TimeTicks(), |
| 919 response_info().load_timing.connect_timing.dns_start); | 920 response_info().load_timing.connect_timing.dns_start); |
| 920 } | 921 } |
| 921 | 922 |
| 922 } // namespace content | 923 } // namespace content |
| OLD | NEW |