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

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

Issue 2854243003: Use constexpr TaskTraits constructor in net. (Closed)
Patch Set: Created 3 years, 7 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
« no previous file with comments | « net/disk_cache/cache_util.cc ('k') | net/proxy/polling_proxy_config_service.cc » ('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/address_sorter.h" 5 #include "net/dns/address_sorter.h"
6 6
7 #include <winsock2.h> 7 #include <winsock2.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 67
68 struct sockaddr* addr = reinterpret_cast<struct sockaddr*>(storage + i); 68 struct sockaddr* addr = reinterpret_cast<struct sockaddr*>(storage + i);
69 socklen_t addr_len = sizeof(SOCKADDR_STORAGE); 69 socklen_t addr_len = sizeof(SOCKADDR_STORAGE);
70 bool result = ipe.ToSockAddr(addr, &addr_len); 70 bool result = ipe.ToSockAddr(addr, &addr_len);
71 DCHECK(result); 71 DCHECK(result);
72 input_buffer_->Address[i].lpSockaddr = addr; 72 input_buffer_->Address[i].lpSockaddr = addr;
73 input_buffer_->Address[i].iSockaddrLength = addr_len; 73 input_buffer_->Address[i].iSockaddrLength = addr_len;
74 } 74 }
75 75
76 base::PostTaskWithTraitsAndReply( 76 base::PostTaskWithTraitsAndReply(
77 FROM_HERE, base::TaskTraits() 77 FROM_HERE,
78 .WithShutdownBehavior( 78 {base::MayBlock(), base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN},
79 base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN)
80 .MayBlock(),
81 base::Bind(&Job::Run, this), base::Bind(&Job::OnComplete, this)); 79 base::Bind(&Job::Run, this), base::Bind(&Job::OnComplete, this));
82 } 80 }
83 81
84 private: 82 private:
85 friend class base::RefCountedThreadSafe<Job>; 83 friend class base::RefCountedThreadSafe<Job>;
86 ~Job() {} 84 ~Job() {}
87 85
88 // Executed asynchronously in TaskScheduler. 86 // Executed asynchronously in TaskScheduler.
89 void Run() { 87 void Run() {
90 SOCKET sock = socket(AF_INET6, SOCK_DGRAM, IPPROTO_UDP); 88 SOCKET sock = socket(AF_INET6, SOCK_DGRAM, IPPROTO_UDP);
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 }; 136 };
139 137
140 } // namespace 138 } // namespace
141 139
142 // static 140 // static
143 std::unique_ptr<AddressSorter> AddressSorter::CreateAddressSorter() { 141 std::unique_ptr<AddressSorter> AddressSorter::CreateAddressSorter() {
144 return std::unique_ptr<AddressSorter>(new AddressSorterWin()); 142 return std::unique_ptr<AddressSorter>(new AddressSorterWin());
145 } 143 }
146 144
147 } // namespace net 145 } // namespace net
OLDNEW
« no previous file with comments | « net/disk_cache/cache_util.cc ('k') | net/proxy/polling_proxy_config_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698