Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(184)

Side by Side Diff: content/child/resource_dispatcher_unittest.cc

Issue 1970693002: Use mojo for Chrome Loading, Part 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698