| Index: net/dns/address_sorter_win.cc
|
| diff --git a/net/dns/address_sorter_win.cc b/net/dns/address_sorter_win.cc
|
| index 813bd93c38b5be6dda4dcde2c876620ade580476..62e8896438e77a9b9bb3b9fe239799f5ad17b47b 100644
|
| --- a/net/dns/address_sorter_win.cc
|
| +++ b/net/dns/address_sorter_win.cc
|
| @@ -23,9 +23,7 @@ namespace {
|
|
|
| class AddressSorterWin : public AddressSorter {
|
| public:
|
| - AddressSorterWin() {
|
| - EnsureWinsockInit();
|
| - }
|
| + AddressSorterWin() { EnsureWinsockInit(); }
|
|
|
| virtual ~AddressSorterWin() {}
|
|
|
| @@ -44,12 +42,12 @@ class AddressSorterWin : public AddressSorter {
|
| Job(const AddressList& list, const CallbackType& callback)
|
| : callback_(callback),
|
| buffer_size_(sizeof(SOCKET_ADDRESS_LIST) +
|
| - list.size() * (sizeof(SOCKET_ADDRESS) +
|
| - sizeof(SOCKADDR_STORAGE))),
|
| - input_buffer_(reinterpret_cast<SOCKET_ADDRESS_LIST*>(
|
| - malloc(buffer_size_))),
|
| - output_buffer_(reinterpret_cast<SOCKET_ADDRESS_LIST*>(
|
| - malloc(buffer_size_))),
|
| + list.size() *
|
| + (sizeof(SOCKET_ADDRESS) + sizeof(SOCKADDR_STORAGE))),
|
| + input_buffer_(
|
| + reinterpret_cast<SOCKET_ADDRESS_LIST*>(malloc(buffer_size_))),
|
| + output_buffer_(
|
| + reinterpret_cast<SOCKET_ADDRESS_LIST*>(malloc(buffer_size_))),
|
| success_(false) {
|
| input_buffer_->iAddressCount = list.size();
|
| SOCKADDR_STORAGE* storage = reinterpret_cast<SOCKADDR_STORAGE*>(
|
| @@ -72,10 +70,10 @@ class AddressSorterWin : public AddressSorter {
|
| }
|
|
|
| if (!base::WorkerPool::PostTaskAndReply(
|
| - FROM_HERE,
|
| - base::Bind(&Job::Run, this),
|
| - base::Bind(&Job::OnComplete, this),
|
| - false /* task is slow */)) {
|
| + FROM_HERE,
|
| + base::Bind(&Job::Run, this),
|
| + base::Bind(&Job::OnComplete, this),
|
| + false /* task is slow */)) {
|
| LOG(ERROR) << "WorkerPool::PostTaskAndReply failed";
|
| OnComplete();
|
| }
|
| @@ -91,9 +89,15 @@ class AddressSorterWin : public AddressSorter {
|
| if (sock == INVALID_SOCKET)
|
| return;
|
| DWORD result_size = 0;
|
| - int result = WSAIoctl(sock, SIO_ADDRESS_LIST_SORT, input_buffer_.get(),
|
| - buffer_size_, output_buffer_.get(), buffer_size_,
|
| - &result_size, NULL, NULL);
|
| + int result = WSAIoctl(sock,
|
| + SIO_ADDRESS_LIST_SORT,
|
| + input_buffer_.get(),
|
| + buffer_size_,
|
| + output_buffer_.get(),
|
| + buffer_size_,
|
| + &result_size,
|
| + NULL,
|
| + NULL);
|
| if (result == SOCKET_ERROR) {
|
| LOG(ERROR) << "SIO_ADDRESS_LIST_SORT failed " << WSAGetLastError();
|
| } else {
|
| @@ -113,8 +117,8 @@ class AddressSorterWin : public AddressSorter {
|
| output_buffer_->Address[i].iSockaddrLength);
|
| // Unmap V4MAPPED IPv6 addresses so that Happy Eyeballs works.
|
| if (IsIPv4Mapped(ipe.address())) {
|
| - ipe = IPEndPoint(ConvertIPv4MappedToIPv4(ipe.address()),
|
| - ipe.port());
|
| + ipe =
|
| + IPEndPoint(ConvertIPv4MappedToIPv4(ipe.address()), ipe.port());
|
| }
|
| list.push_back(ipe);
|
| }
|
| @@ -195,4 +199,3 @@ scoped_ptr<AddressSorter> AddressSorter::CreateAddressSorter() {
|
| }
|
|
|
| } // namespace net
|
| -
|
|
|