OLD | NEW |
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/extensions/api/socket/socket.h" | 5 #include "chrome/browser/extensions/api/socket/socket.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "chrome/browser/extensions/api/api_resource_event_notifier.h" | 8 #include "chrome/browser/extensions/api/api_resource_event_notifier.h" |
9 #include "net/base/address_list.h" | 9 #include "net/base/address_list.h" |
10 #include "net/base/io_buffer.h" | 10 #include "net/base/io_buffer.h" |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 DCHECK(ip_address_str); | 117 DCHECK(ip_address_str); |
118 DCHECK(port); | 118 DCHECK(port); |
119 *ip_address_str = address.ToStringWithoutPort(); | 119 *ip_address_str = address.ToStringWithoutPort(); |
120 if (ip_address_str->empty()) { | 120 if (ip_address_str->empty()) { |
121 *port = 0; | 121 *port = 0; |
122 } else { | 122 } else { |
123 *port = address.port(); | 123 *port = address.port(); |
124 } | 124 } |
125 } | 125 } |
126 | 126 |
| 127 Socket::WriteRequest::WriteRequest(scoped_refptr<net::IOBuffer> io_buffer, |
| 128 int byte_count, |
| 129 const CompletionCallback& callback) |
| 130 : io_buffer(io_buffer), |
| 131 byte_count(byte_count), |
| 132 callback(callback), |
| 133 bytes_written(0) { |
| 134 } |
| 135 |
| 136 Socket::WriteRequest::~WriteRequest() { } |
| 137 |
127 } // namespace extensions | 138 } // namespace extensions |
OLD | NEW |