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

Unified Diff: net/quic/port_suggester.h

Issue 992733002: Remove //net (except for Android test stuff) and sdch (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 9 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/iovector_test.cc ('k') | net/quic/port_suggester.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/port_suggester.h
diff --git a/net/quic/port_suggester.h b/net/quic/port_suggester.h
deleted file mode 100644
index 0074f7c745975c6c6a7d7e83362e6591e7a9d5c3..0000000000000000000000000000000000000000
--- a/net/quic/port_suggester.h
+++ /dev/null
@@ -1,50 +0,0 @@
-// Copyright 2013 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.
-
-#ifndef NET_QUIC_PORT_SUGGESTER_H_
-#define NET_QUIC_PORT_SUGGESTER_H_
-
-#include "base/basictypes.h"
-#include "base/memory/ref_counted.h"
-#include "base/sha1.h"
-#include "net/base/net_export.h"
-
-namespace net {
-
-class HostPortPair;
-
-// We provide a pseudo-random number generator that is always seeded the same
-// way for a given destination host-port pair. The generator is used to
-// consistently suggest (for that host-port pair) an ephemeral source port,
-// and hence increase the likelihood that a server's load balancer will direct
-// a repeated connection to the same server (with QUIC, further increasing the
-// chance of connection establishment with 0-RTT).
-class NET_EXPORT_PRIVATE PortSuggester
- : public base::RefCounted<PortSuggester> {
- public:
- PortSuggester(const HostPortPair& server, uint64 seed);
-
- // Generate a pseudo-random int in the inclusive range from |min| to |max|.
- // Will (probably) return different numbers when called repeatedly.
- int SuggestPort(int min, int max);
-
- uint32 call_count() const { return call_count_; }
- int previous_suggestion() const;
-
- private:
- friend class base::RefCounted<PortSuggester>;
-
- virtual ~PortSuggester() {}
-
- // We maintain the first 8 bytes of a hash as our seed_ state.
- uint64 seed_;
- uint32 call_count_; // Number of suggestions made.
- int previous_suggestion_;
-
- DISALLOW_COPY_AND_ASSIGN(PortSuggester);
-};
-
-} // namespace net
-
-#endif // NET_QUIC_PORT_SUGGESTER_H_
« no previous file with comments | « net/quic/iovector_test.cc ('k') | net/quic/port_suggester.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698