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

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 wtc. Made Get{Local,Peer}Address virtual. 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
« no previous file with comments | « no previous file | content/browser/devtools/devtools_http_handler_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1b9da1d2e744a426ca937d4272424974d3040010..bd1be4b0dc7ce7611234c174ddbf1b762539be91 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) {
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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698