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

Side by Side Diff: chrome/browser/devtools/device/usb/android_usb_socket.cc

Issue 1096203006: Collect all ConnectionAttempts from both sockets in TransportConnectJob. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@domrel_serverip1
Patch Set: Return fake ConnectionAttempt in MockTCPClientSocket Created 5 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
OLDNEW
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 #include "chrome/browser/devtools/device/usb/android_usb_socket.h" 5 #include "chrome/browser/devtools/device/usb/android_usb_socket.h"
6 6
7 #include "base/callback_helpers.h" 7 #include "base/callback_helpers.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "net/base/net_errors.h" 9 #include "net/base/net_errors.h"
10 10
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 227
228 net::NextProto AndroidUsbSocket::GetNegotiatedProtocol() const { 228 net::NextProto AndroidUsbSocket::GetNegotiatedProtocol() const {
229 NOTIMPLEMENTED(); 229 NOTIMPLEMENTED();
230 return net::kProtoUnknown; 230 return net::kProtoUnknown;
231 } 231 }
232 232
233 bool AndroidUsbSocket::GetSSLInfo(net::SSLInfo* ssl_info) { 233 bool AndroidUsbSocket::GetSSLInfo(net::SSLInfo* ssl_info) {
234 return false; 234 return false;
235 } 235 }
236 236
237 void AndroidUsbSocket::GetConnectionAttempts(
238 net::ConnectionAttempts* out) const {
239 out->clear();
240 }
241
237 void AndroidUsbSocket::RespondToReader(bool disconnect) { 242 void AndroidUsbSocket::RespondToReader(bool disconnect) {
238 if (read_callback_.is_null() || (read_buffer_.empty() && !disconnect)) 243 if (read_callback_.is_null() || (read_buffer_.empty() && !disconnect))
239 return; 244 return;
240 size_t bytes_to_copy = 245 size_t bytes_to_copy =
241 static_cast<size_t>(read_length_) > read_buffer_.length() ? 246 static_cast<size_t>(read_length_) > read_buffer_.length() ?
242 read_buffer_.length() : static_cast<size_t>(read_length_); 247 read_buffer_.length() : static_cast<size_t>(read_length_);
243 memcpy(read_io_buffer_->data(), read_buffer_.data(), bytes_to_copy); 248 memcpy(read_io_buffer_->data(), read_buffer_.data(), bytes_to_copy);
244 if (read_buffer_.length() > bytes_to_copy) 249 if (read_buffer_.length() > bytes_to_copy)
245 read_buffer_ = read_buffer_.substr(bytes_to_copy); 250 read_buffer_ = read_buffer_.substr(bytes_to_copy);
246 else 251 else
247 read_buffer_ = std::string(); 252 read_buffer_ = std::string();
248 base::ResetAndReturn(&read_callback_).Run(bytes_to_copy); 253 base::ResetAndReturn(&read_callback_).Run(bytes_to_copy);
249 } 254 }
250 255
251 void AndroidUsbSocket::RespondToWriter(int result) { 256 void AndroidUsbSocket::RespondToWriter(int result) {
252 if (!write_callback_.is_null()) 257 if (!write_callback_.is_null())
253 base::ResetAndReturn(&write_callback_).Run(result); 258 base::ResetAndReturn(&write_callback_).Run(result);
254 } 259 }
OLDNEW
« no previous file with comments | « chrome/browser/devtools/device/usb/android_usb_socket.h ('k') | chrome/browser/extensions/api/socket/tls_socket_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698