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

Side by Side Diff: net/dns/mock_host_resolver.cc

Issue 754433003: Update from https://crrev.com/305340 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 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
« no previous file with comments | « net/dns/host_resolver_impl_unittest.cc ('k') | net/filter/filter.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "net/dns/mock_host_resolver.h" 5 #include "net/dns/mock_host_resolver.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 30 matching lines...) Expand all
41 *addrlist = AddressList(); 41 *addrlist = AddressList();
42 std::vector<std::string> addresses; 42 std::vector<std::string> addresses;
43 base::SplitString(host_list, ',', &addresses); 43 base::SplitString(host_list, ',', &addresses);
44 addrlist->set_canonical_name(canonical_name); 44 addrlist->set_canonical_name(canonical_name);
45 for (size_t index = 0; index < addresses.size(); ++index) { 45 for (size_t index = 0; index < addresses.size(); ++index) {
46 IPAddressNumber ip_number; 46 IPAddressNumber ip_number;
47 if (!ParseIPLiteralToNumber(addresses[index], &ip_number)) { 47 if (!ParseIPLiteralToNumber(addresses[index], &ip_number)) {
48 LOG(WARNING) << "Not a supported IP literal: " << addresses[index]; 48 LOG(WARNING) << "Not a supported IP literal: " << addresses[index];
49 return ERR_UNEXPECTED; 49 return ERR_UNEXPECTED;
50 } 50 }
51 addrlist->push_back(IPEndPoint(ip_number, -1)); 51 addrlist->push_back(IPEndPoint(ip_number, 0));
52 } 52 }
53 return OK; 53 return OK;
54 } 54 }
55 55
56 struct MockHostResolverBase::Request { 56 struct MockHostResolverBase::Request {
57 Request(const RequestInfo& req_info, 57 Request(const RequestInfo& req_info,
58 AddressList* addr, 58 AddressList* addr,
59 const CompletionCallback& cb) 59 const CompletionCallback& cb)
60 : info(req_info), addresses(addr), callback(cb) {} 60 : info(req_info), addresses(addr), callback(cb) {}
61 RequestInfo info; 61 RequestInfo info;
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 CHECK_EQ(old_proc, current_proc_.get()); 443 CHECK_EQ(old_proc, current_proc_.get());
444 } 444 }
445 445
446 void ScopedDefaultHostResolverProc::Init(HostResolverProc* proc) { 446 void ScopedDefaultHostResolverProc::Init(HostResolverProc* proc) {
447 current_proc_ = proc; 447 current_proc_ = proc;
448 previous_proc_ = HostResolverProc::SetDefault(current_proc_.get()); 448 previous_proc_ = HostResolverProc::SetDefault(current_proc_.get());
449 current_proc_->SetLastProc(previous_proc_.get()); 449 current_proc_->SetLastProc(previous_proc_.get());
450 } 450 }
451 451
452 } // namespace net 452 } // namespace net
OLDNEW
« no previous file with comments | « net/dns/host_resolver_impl_unittest.cc ('k') | net/filter/filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698