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

Unified Diff: content/browser/devtools/devtools_http_handler_impl.cc

Issue 319593013: Added unit test for DevTools' ephemeral port support. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed review feedback from jar. Made GetLocalAddressImpl protected. Created 6 years, 6 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
Index: content/browser/devtools/devtools_http_handler_impl.cc
diff --git a/content/browser/devtools/devtools_http_handler_impl.cc b/content/browser/devtools/devtools_http_handler_impl.cc
index 113c2e556d5e10fbb0fa4547a102d8aebd4903df..c45d529a4ed476cbd3f0fa422b3a3048f76b2bab 100644
--- a/content/browser/devtools/devtools_http_handler_impl.cc
+++ b/content/browser/devtools/devtools_http_handler_impl.cc
@@ -5,7 +5,6 @@
#include "content/browser/devtools/devtools_http_handler_impl.h"
#include <algorithm>
-#include <sstream>
#include <utility>
#include "base/bind.h"
@@ -15,6 +14,7 @@
#include "base/logging.h"
#include "base/message_loop/message_loop_proxy.h"
#include "base/stl_util.h"
+#include "base/strings/string_number_conversions.h"
#include "base/threading/thread.h"
#include "base/values.h"
#include "content/browser/devtools/devtools_browser_target.h"
@@ -699,10 +699,8 @@ void DevToolsHttpHandlerImpl::WriteActivePortToUserProfile() {
// so Telemetry can pick it up.
base::FilePath path = active_port_output_directory_.Append(
kDevToolsActivePortFileName);
- std::stringstream port_stream;
- port_stream << endpoint.port();
- std::string s = port_stream.str();
- if (base::WriteFile(path, s.c_str(), s.length()) < 0) {
+ std::string port_string = base::IntToString(endpoint.port());
+ if (base::WriteFile(path, port_string.c_str(), port_string.length()) < 0) {
wtc 2014/06/10 17:46:44 Nit: we can use data() instead of c_str(), which i
LOG(ERROR) << "Error writing DevTools active port to file";
}
}
« no previous file with comments | « no previous file | content/browser/devtools/devtools_http_handler_unittest.cc » ('j') | net/socket/stream_listen_socket.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698