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 "content/browser/devtools/tethering_handler.h" | 5 #include "content/browser/devtools/tethering_handler.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 wire_buffer_size_ -= offset; | 143 wire_buffer_size_ -= offset; |
144 wire_buffer_->set_offset(0); | 144 wire_buffer_->set_offset(0); |
145 } | 145 } |
146 | 146 |
147 if (result != net::ERR_IO_PENDING) | 147 if (result != net::ERR_IO_PENDING) |
148 OnClientWrite(result); | 148 OnClientWrite(result); |
149 return; | 149 return; |
150 } | 150 } |
151 | 151 |
152 void SelfDestruct() { | 152 void SelfDestruct() { |
153 if (wire_buffer_ && wire_buffer_->offset() != wire_buffer_size_) { | 153 if (wire_buffer_.get() && wire_buffer_->offset() != wire_buffer_size_) { |
154 pending_destruction_ = true; | 154 pending_destruction_ = true; |
155 return; | 155 return; |
156 } | 156 } |
157 delete this; | 157 delete this; |
158 } | 158 } |
159 | 159 |
160 private: | 160 private: |
161 scoped_ptr<net::StreamSocket> client_socket_; | 161 scoped_ptr<net::StreamSocket> client_socket_; |
162 scoped_ptr<net::StreamListenSocket> server_socket_; | 162 scoped_ptr<net::StreamListenSocket> server_socket_; |
163 scoped_ptr<net::StreamListenSocket> accepted_socket_; | 163 scoped_ptr<net::StreamListenSocket> accepted_socket_; |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 BoundSockets::iterator it = bound_sockets_.find(port); | 300 BoundSockets::iterator it = bound_sockets_.find(port); |
301 if (it == bound_sockets_.end()) | 301 if (it == bound_sockets_.end()) |
302 return command->InternalErrorResponse("Port is not bound"); | 302 return command->InternalErrorResponse("Port is not bound"); |
303 | 303 |
304 delete it->second; | 304 delete it->second; |
305 bound_sockets_.erase(it); | 305 bound_sockets_.erase(it); |
306 return command->SuccessResponse(NULL); | 306 return command->SuccessResponse(NULL); |
307 } | 307 } |
308 | 308 |
309 } // namespace content | 309 } // namespace content |
OLD | NEW |