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

Unified Diff: chrome/browser/devtools/adb_client_socket.cc

Issue 22429005: Normalize parameters to AdbClientSocket::CommandCallback parameters (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added a TODO Created 7 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/devtools/devtools_adb_bridge.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/devtools/adb_client_socket.cc
diff --git a/chrome/browser/devtools/adb_client_socket.cc b/chrome/browser/devtools/adb_client_socket.cc
index f316e77f5aa427ef3b42b31700dd8dbb52c1d325..98e906514bd3e9b0da3f36e85cfb93263568a6b1 100644
--- a/chrome/browser/devtools/adb_client_socket.cc
+++ b/chrome/browser/devtools/adb_client_socket.cc
@@ -158,6 +158,7 @@ class HttpOverAdbSocket {
response_ += std::string(response_buffer->data(), result);
int expected_length = 0;
if (bytes_total < 0) {
+ // TODO(kaznacheev): Use net::HttpResponseHeader to parse the header.
size_t content_pos = response_.find("Content-Length:");
if (content_pos != std::string::npos) {
size_t endline_pos = response_.find("\n", content_pos);
@@ -181,7 +182,7 @@ class HttpOverAdbSocket {
if (bytes_total == static_cast<int>(response_.length())) {
if (!command_callback_.is_null())
- command_callback_.Run(body_pos_, response_);
+ command_callback_.Run(net::OK, response_.substr(body_pos_));
else
socket_callback_.Run(net::OK, socket_.release());
delete this;
« no previous file with comments | « no previous file | chrome/browser/devtools/devtools_adb_bridge.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698