| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef EXTENSIONS_BROWSER_API_SOCKET_SOCKET_H_ | 5 #ifndef EXTENSIONS_BROWSER_API_SOCKET_SOCKET_H_ |
| 6 #define EXTENSIONS_BROWSER_API_SOCKET_SOCKET_H_ | 6 #define EXTENSIONS_BROWSER_API_SOCKET_SOCKET_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <queue> | 10 #include <queue> |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 // Set the hostname of the remote host that this socket is connected to. | 59 // Set the hostname of the remote host that this socket is connected to. |
| 60 // Note: This may be an IP literal. In the case of IDNs, this should be a | 60 // Note: This may be an IP literal. In the case of IDNs, this should be a |
| 61 // series of U-LABELs (UTF-8), not A-LABELs. IP literals for IPv6 will be | 61 // series of U-LABELs (UTF-8), not A-LABELs. IP literals for IPv6 will be |
| 62 // unbracketed. | 62 // unbracketed. |
| 63 void set_hostname(const std::string& hostname) { hostname_ = hostname; } | 63 void set_hostname(const std::string& hostname) { hostname_ = hostname; } |
| 64 | 64 |
| 65 #if defined(OS_CHROMEOS) | 65 #if defined(OS_CHROMEOS) |
| 66 void set_firewall_hole( | 66 void set_firewall_hole( |
| 67 scoped_ptr<AppFirewallHole, content::BrowserThread::DeleteOnUIThread> | 67 scoped_ptr<AppFirewallHole, content::BrowserThread::DeleteOnUIThread> |
| 68 firewall_hole) { | 68 firewall_hole) { |
| 69 firewall_hole_ = firewall_hole.Pass(); | 69 firewall_hole_ = std::move(firewall_hole); |
| 70 } | 70 } |
| 71 #endif // OS_CHROMEOS | 71 #endif // OS_CHROMEOS |
| 72 | 72 |
| 73 // Note: |address| contains the resolved IP address, not the hostname of | 73 // Note: |address| contains the resolved IP address, not the hostname of |
| 74 // the remote endpoint. In order to upgrade this socket to TLS, callers | 74 // the remote endpoint. In order to upgrade this socket to TLS, callers |
| 75 // must also supply the hostname of the endpoint via set_hostname(). | 75 // must also supply the hostname of the endpoint via set_hostname(). |
| 76 virtual void Connect(const net::AddressList& address, | 76 virtual void Connect(const net::AddressList& address, |
| 77 const CompletionCallback& callback) = 0; | 77 const CompletionCallback& callback) = 0; |
| 78 virtual void Disconnect() = 0; | 78 virtual void Disconnect() = 0; |
| 79 virtual int Bind(const std::string& address, uint16_t port) = 0; | 79 virtual int Bind(const std::string& address, uint16_t port) = 0; |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 #if defined(OS_CHROMEOS) | 149 #if defined(OS_CHROMEOS) |
| 150 // Represents a hole punched in the system firewall for this socket. | 150 // Represents a hole punched in the system firewall for this socket. |
| 151 scoped_ptr<AppFirewallHole, content::BrowserThread::DeleteOnUIThread> | 151 scoped_ptr<AppFirewallHole, content::BrowserThread::DeleteOnUIThread> |
| 152 firewall_hole_; | 152 firewall_hole_; |
| 153 #endif // OS_CHROMEOS | 153 #endif // OS_CHROMEOS |
| 154 }; | 154 }; |
| 155 | 155 |
| 156 } // namespace extensions | 156 } // namespace extensions |
| 157 | 157 |
| 158 #endif // EXTENSIONS_BROWSER_API_SOCKET_SOCKET_H_ | 158 #endif // EXTENSIONS_BROWSER_API_SOCKET_SOCKET_H_ |
| OLD | NEW |