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

Side by Side Diff: chrome/browser/chromeos/web_socket_proxy.cc

Issue 10309002: Reimplements net::AddressList without struct addrinfo. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added missing NET_EXPORT to *PortOnAddressList. Created 8 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 | Annotate | Revision Log
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 "chrome/browser/chromeos/web_socket_proxy.h" 5 #include "chrome/browser/chromeos/web_socket_proxy.h"
6 6
7 #include <stdio.h> 7 #include <stdio.h>
8 #include <stdlib.h> 8 #include <stdlib.h>
9 #include <string.h> 9 #include <string.h>
10 10
(...skipping 1463 matching lines...) Expand 10 before | Expand all | Expand 10 after
1474 return false; 1474 return false;
1475 } 1475 }
1476 destchan_.set_read_bev(bufferevent_new( 1476 destchan_.set_read_bev(bufferevent_new(
1477 destchan_.read_fd(), 1477 destchan_.read_fd(),
1478 &OnDestchanRead, NULL, &OnDestchanError, 1478 &OnDestchanRead, NULL, &OnDestchanError,
1479 evkey_)); 1479 evkey_));
1480 destchan_.set_write_bev(bufferevent_new( 1480 destchan_.set_write_bev(bufferevent_new(
1481 destchan_.write_fd(), 1481 destchan_.write_fd(),
1482 NULL, &OnDestchanWrite, &OnDestchanError, 1482 NULL, &OnDestchanWrite, &OnDestchanError,
1483 evkey_)); 1483 evkey_));
1484 net::AddressList addrlist = net::AddressList::CreateFromSockaddr( 1484 net::IPEndPoint endpoint;
1485 addr, addrlen, SOCK_STREAM, IPPROTO_TCP); 1485 if (!endpoint.FromSockAddr(addr, addrlen))
1486 return false;
1487 net::AddressList addrlist = net::AddressList(endpoint);
eroman 2012/05/04 01:08:41 nit: can avoid the assignment here and just do Add
1486 net::HostPortPair host_port_pair(destname_, destport_); 1488 net::HostPortPair host_port_pair(destname_, destport_);
1487 BrowserThread::PostTask( 1489 BrowserThread::PostTask(
1488 BrowserThread::IO, FROM_HERE, base::Bind( 1490 BrowserThread::IO, FROM_HERE, base::Bind(
1489 &SSLChan::Start, addrlist, host_port_pair, fd[2], fd[1])); 1491 &SSLChan::Start, addrlist, host_port_pair, fd[2], fd[1]));
1490 } else { 1492 } else {
1491 int sock = socket(addr->sa_family, SOCK_STREAM, 0); 1493 int sock = socket(addr->sa_family, SOCK_STREAM, 0);
1492 if (sock < 0) 1494 if (sock < 0)
1493 return false; 1495 return false;
1494 destchan_.set_read_fd(sock); 1496 destchan_.set_read_fd(sock);
1495 destchan_.set_write_fd(sock); 1497 destchan_.set_write_fd(sock);
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after
1899 1901
1900 void WebSocketProxy::Shutdown() { 1902 void WebSocketProxy::Shutdown() {
1901 static_cast<Serv*>(impl_)->Shutdown(); 1903 static_cast<Serv*>(impl_)->Shutdown();
1902 } 1904 }
1903 1905
1904 void WebSocketProxy::OnNetworkChange() { 1906 void WebSocketProxy::OnNetworkChange() {
1905 static_cast<Serv*>(impl_)->OnNetworkChange(); 1907 static_cast<Serv*>(impl_)->OnNetworkChange();
1906 } 1908 }
1907 1909
1908 } // namespace chromeos 1910 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/api/dns/dns_api.cc » ('j') | chrome/browser/extensions/api/dns/dns_api.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698