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

Side by Side Diff: net/proxy/proxy_resolver_factory_mojo_unittest.cc

Issue 2116983002: Change HostResolver::Resolve() to take an std::unique_ptr<Request>* rather than a RequestHandle* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: http_stream_factory_impl_job_controller_unittest RequestHandle* to unique_ptr Created 4 years, 4 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "net/proxy/proxy_resolver_factory_mojo.h" 5 #include "net/proxy/proxy_resolver_factory_mojo.h"
6 6
7 #include <list> 7 #include <list>
8 #include <map> 8 #include <map>
9 #include <memory> 9 #include <memory>
10 #include <queue> 10 #include <queue>
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 public: 480 public:
481 enum Event { 481 enum Event {
482 DNS_REQUEST, 482 DNS_REQUEST,
483 }; 483 };
484 484
485 // HostResolver overrides. 485 // HostResolver overrides.
486 int Resolve(const RequestInfo& info, 486 int Resolve(const RequestInfo& info,
487 RequestPriority priority, 487 RequestPriority priority,
488 AddressList* addresses, 488 AddressList* addresses,
489 const CompletionCallback& callback, 489 const CompletionCallback& callback,
490 RequestHandle* request_handle, 490 std::unique_ptr<Request>* request,
491 const BoundNetLog& source_net_log) override { 491 const BoundNetLog& source_net_log) override {
492 waiter_.NotifyEvent(DNS_REQUEST); 492 waiter_.NotifyEvent(DNS_REQUEST);
493 return ERR_IO_PENDING; 493 return ERR_IO_PENDING;
494 } 494 }
495
495 int ResolveFromCache(const RequestInfo& info, 496 int ResolveFromCache(const RequestInfo& info,
496 AddressList* addresses, 497 AddressList* addresses,
497 const BoundNetLog& source_net_log) override { 498 const BoundNetLog& source_net_log) override {
498 return ERR_DNS_CACHE_MISS; 499 return ERR_DNS_CACHE_MISS;
499 } 500 }
500 void CancelRequest(RequestHandle req) override {} 501
501 HostCache* GetHostCache() override { return nullptr; } 502 HostCache* GetHostCache() override { return nullptr; }
502 503
503 EventWaiter<Event>& waiter() { return waiter_; } 504 EventWaiter<Event>& waiter() { return waiter_; }
504 505
505 private: 506 private:
506 EventWaiter<Event> waiter_; 507 EventWaiter<Event> waiter_;
507 }; 508 };
508 509
509 void CheckCapturedNetLogEntries(const std::string& expected_string, 510 void CheckCapturedNetLogEntries(const std::string& expected_string,
510 const TestNetLogEntry::List& entries) { 511 const TestNetLogEntry::List& entries) {
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
907 mock_proxy_resolver_.ClearBlockedClients(); 908 mock_proxy_resolver_.ClearBlockedClients();
908 request->WaitForResult(); 909 request->WaitForResult();
909 } 910 }
910 911
911 TEST_F(ProxyResolverFactoryMojoTest, DeleteResolver) { 912 TEST_F(ProxyResolverFactoryMojoTest, DeleteResolver) {
912 CreateProxyResolver(); 913 CreateProxyResolver();
913 proxy_resolver_mojo_.reset(); 914 proxy_resolver_mojo_.reset();
914 on_delete_callback_.WaitForResult(); 915 on_delete_callback_.WaitForResult();
915 } 916 }
916 } // namespace net 917 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698