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

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

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

Powered by Google App Engine
This is Rietveld 408576698