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

Unified Diff: chrome/browser/media/webrtc/webrtc_text_log_handler.cc

Issue 2881673002: Avoid heap allocations in IPAddress (Closed)
Patch Set: New constructor Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/browser/renderer_host/pepper/pepper_socket_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/media/webrtc/webrtc_text_log_handler.cc
diff --git a/chrome/browser/media/webrtc/webrtc_text_log_handler.cc b/chrome/browser/media/webrtc/webrtc_text_log_handler.cc
index ca36e00b46a32404fd3a64d45bebcc2bc4ee175d..10d56a144e4eb8e02586dda8521b0728a253c346 100644
--- a/chrome/browser/media/webrtc/webrtc_text_log_handler.cc
+++ b/chrome/browser/media/webrtc/webrtc_text_log_handler.cc
@@ -77,10 +77,9 @@ std::string IPAddressToSensitiveString(const net::IPAddress& address) {
case net::IPAddress::kIPv6AddressSize: {
// TODO(grunell): Create a string of format "1:2:3:x:x:x:x:x" to clarify
// that the end has been stripped out.
- std::vector<uint8_t> bytes = address.bytes();
- std::fill(bytes.begin() + 6, bytes.end(), 0);
- net::IPAddress stripped_address(bytes);
- sensitive_address = stripped_address.ToString();
+ net::IPAddressBytes stripped = address.bytes();
+ std::fill(stripped.begin() + 6, stripped.end(), 0);
+ sensitive_address = net::IPAddress(stripped).ToString();
break;
}
default: { break; }
« no previous file with comments | « no previous file | content/browser/renderer_host/pepper/pepper_socket_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698