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

Unified Diff: net/quic/quic_address_mismatch.cc

Issue 2193073003: Move shared files in net/quic/ into net/quic/core/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: io_thread_unittest.cc Created 4 years, 5 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 | « net/quic/quic_address_mismatch.h ('k') | net/quic/quic_address_mismatch_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_address_mismatch.cc
diff --git a/net/quic/quic_address_mismatch.cc b/net/quic/quic_address_mismatch.cc
deleted file mode 100644
index 9a26c26521bb84a3941d0757994f6cc4d4ac6708..0000000000000000000000000000000000000000
--- a/net/quic/quic_address_mismatch.cc
+++ /dev/null
@@ -1,51 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "net/quic/quic_address_mismatch.h"
-
-#include "base/logging.h"
-#include "net/base/ip_address.h"
-
-namespace net {
-
-int GetAddressMismatch(const IPEndPoint& first_address,
- const IPEndPoint& second_address) {
- if (first_address.address().empty() || second_address.address().empty()) {
- return -1;
- }
- IPAddress first_ip_address = first_address.address();
- if (first_ip_address.IsIPv4MappedIPv6()) {
- first_ip_address = ConvertIPv4MappedIPv6ToIPv4(first_ip_address);
- }
- IPAddress second_ip_address = second_address.address();
- if (second_ip_address.IsIPv4MappedIPv6()) {
- second_ip_address = ConvertIPv4MappedIPv6ToIPv4(second_ip_address);
- }
-
- int sample;
- if (first_ip_address != second_ip_address) {
- sample = QUIC_ADDRESS_MISMATCH_BASE;
- } else if (first_address.port() != second_address.port()) {
- sample = QUIC_PORT_MISMATCH_BASE;
- } else {
- sample = QUIC_ADDRESS_AND_PORT_MATCH_BASE;
- }
-
- // Add an offset to |sample|:
- // V4_V4: add 0
- // V6_V6: add 1
- // V4_V6: add 2
- // V6_V4: add 3
- bool first_ipv4 = first_ip_address.IsIPv4();
- if (first_ipv4 != second_ip_address.IsIPv4()) {
- CHECK_EQ(sample, QUIC_ADDRESS_MISMATCH_BASE);
- sample += 2;
- }
- if (!first_ipv4) {
- sample += 1;
- }
- return sample;
-}
-
-} // namespace net
« no previous file with comments | « net/quic/quic_address_mismatch.h ('k') | net/quic/quic_address_mismatch_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698