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

Side by Side Diff: content/browser/renderer_host/p2p/socket_dispatcher_host.cc

Issue 2078913004: If GetNetworkList fails, don't push down an empty network list. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 | « no previous file | no next file » | 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 "content/browser/renderer_host/p2p/socket_dispatcher_host.h" 5 #include "content/browser/renderer_host/p2p/socket_dispatcher_host.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 if (it != sockets_.end()) { 327 if (it != sockets_.end()) {
328 delete it->second; 328 delete it->second;
329 sockets_.erase(it); 329 sockets_.erase(it);
330 } else { 330 } else {
331 LOG(ERROR) << "Received P2PHostMsg_DestroySocket for invalid socket_id."; 331 LOG(ERROR) << "Received P2PHostMsg_DestroySocket for invalid socket_id.";
332 } 332 }
333 } 333 }
334 334
335 void P2PSocketDispatcherHost::DoGetNetworkList() { 335 void P2PSocketDispatcherHost::DoGetNetworkList() {
336 net::NetworkInterfaceList list; 336 net::NetworkInterfaceList list;
337 net::GetNetworkList(&list, net::EXCLUDE_HOST_SCOPE_VIRTUAL_INTERFACES); 337 if (!net::GetNetworkList(&list, net::EXCLUDE_HOST_SCOPE_VIRTUAL_INTERFACES)) {
338 LOG(ERROR) << "GetNetworkList failed.";
339 return;
340 }
338 default_ipv4_local_address_ = GetDefaultLocalAddress(AF_INET); 341 default_ipv4_local_address_ = GetDefaultLocalAddress(AF_INET);
339 default_ipv6_local_address_ = GetDefaultLocalAddress(AF_INET6); 342 default_ipv6_local_address_ = GetDefaultLocalAddress(AF_INET6);
340 BrowserThread::PostTask( 343 BrowserThread::PostTask(
341 BrowserThread::IO, FROM_HERE, 344 BrowserThread::IO, FROM_HERE,
342 base::Bind(&P2PSocketDispatcherHost::SendNetworkList, this, list, 345 base::Bind(&P2PSocketDispatcherHost::SendNetworkList, this, list,
343 default_ipv4_local_address_, default_ipv6_local_address_)); 346 default_ipv4_local_address_, default_ipv6_local_address_));
344 } 347 }
345 348
346 void P2PSocketDispatcherHost::SendNetworkList( 349 void P2PSocketDispatcherHost::SendNetworkList(
347 const net::NetworkInterfaceList& list, 350 const net::NetworkInterfaceList& list,
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 404
402 if (!dump_incoming_rtp_packet_ && !dump_outgoing_rtp_packet_) 405 if (!dump_incoming_rtp_packet_ && !dump_outgoing_rtp_packet_)
403 packet_callback_.Reset(); 406 packet_callback_.Reset();
404 407
405 for (SocketsMap::iterator it = sockets_.begin(); it != sockets_.end(); ++it) 408 for (SocketsMap::iterator it = sockets_.begin(); it != sockets_.end(); ++it)
406 it->second->StopRtpDump(incoming, outgoing); 409 it->second->StopRtpDump(incoming, outgoing);
407 } 410 }
408 } 411 }
409 412
410 } // namespace content 413 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698