OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/media/webrtc/webrtc_text_log_handler.h" | 5 #include "chrome/browser/media/webrtc/webrtc_text_log_handler.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 size_t find_pos = sensitive_address.rfind('.'); | 70 size_t find_pos = sensitive_address.rfind('.'); |
71 if (find_pos == std::string::npos) | 71 if (find_pos == std::string::npos) |
72 return std::string(); | 72 return std::string(); |
73 sensitive_address.resize(find_pos); | 73 sensitive_address.resize(find_pos); |
74 sensitive_address += ".x"; | 74 sensitive_address += ".x"; |
75 break; | 75 break; |
76 } | 76 } |
77 case net::IPAddress::kIPv6AddressSize: { | 77 case net::IPAddress::kIPv6AddressSize: { |
78 // TODO(grunell): Create a string of format "1:2:3:x:x:x:x:x" to clarify | 78 // TODO(grunell): Create a string of format "1:2:3:x:x:x:x:x" to clarify |
79 // that the end has been stripped out. | 79 // that the end has been stripped out. |
80 std::vector<uint8_t> bytes = address.bytes(); | 80 std::vector<uint8_t> bytes = address.BytesAsVector(); |
81 std::fill(bytes.begin() + 6, bytes.end(), 0); | 81 std::fill(bytes.begin() + 6, bytes.end(), 0); |
82 net::IPAddress stripped_address(bytes); | 82 net::IPAddress stripped_address(bytes); |
83 sensitive_address = stripped_address.ToString(); | 83 sensitive_address = stripped_address.ToString(); |
84 break; | 84 break; |
85 } | 85 } |
86 default: { break; } | 86 default: { break; } |
87 } | 87 } |
88 return sensitive_address; | 88 return sensitive_address; |
89 #else | 89 #else |
90 return address.ToString(); | 90 return address.ToString(); |
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
505 } | 505 } |
506 } | 506 } |
507 | 507 |
508 void WebRtcTextLogHandler::DisableBrowserProcessLoggingOnUIThread() { | 508 void WebRtcTextLogHandler::DisableBrowserProcessLoggingOnUIThread() { |
509 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 509 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
510 content::RenderProcessHost* host = | 510 content::RenderProcessHost* host = |
511 content::RenderProcessHost::FromID(render_process_id_); | 511 content::RenderProcessHost::FromID(render_process_id_); |
512 if (host) | 512 if (host) |
513 host->ClearWebRtcLogMessageCallback(); | 513 host->ClearWebRtcLogMessageCallback(); |
514 } | 514 } |
OLD | NEW |