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

Unified Diff: net/http/http_pipelined_host.h

Issue 9433015: Add a force pipelining option to load flags. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix build on other platforms Created 8 years, 10 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
Index: net/http/http_pipelined_host.h
diff --git a/net/http/http_pipelined_host.h b/net/http/http_pipelined_host.h
index 14c0f098f85e0cf6602c603f54993e618ac7a799..4fea60dc728e60f812400a2857812c870468124e 100644
--- a/net/http/http_pipelined_host.h
+++ b/net/http/http_pipelined_host.h
@@ -6,6 +6,7 @@
#define NET_HTTP_HTTP_PIPELINED_HOST_H_
#pragma once
+#include "net/base/host_port_pair.h"
#include "net/base/net_export.h"
#include "net/http/http_pipelined_connection.h"
#include "net/http/http_pipelined_host_capability.h"
@@ -28,6 +29,23 @@ struct SSLConfig;
// assigns requests to the least loaded pipelined connection.
class NET_EXPORT_PRIVATE HttpPipelinedHost {
public:
+ class Key {
mmenke 2012/02/23 18:54:58 Doesn't look to me like any of the unit tests beat
James Simonsen 2012/02/23 23:49:46 Good point. Done.
+ public:
+ Key(const HostPortPair& origin, bool force_pipelining);
+
+ // The host and port associated with this key.
+ const HostPortPair& origin() const { return origin_; }
+
+ // True if this key forces requests to pipeline.
+ bool force_pipelining() const { return force_pipelining_; }
+
+ bool operator<(const Key& rhs) const;
+
+ private:
+ const HostPortPair origin_;
+ bool force_pipelining_;
+ };
+
class Delegate {
public:
// Called when a pipelined host has no outstanding requests on any of its
@@ -50,7 +68,7 @@ class NET_EXPORT_PRIVATE HttpPipelinedHost {
// Returns a new HttpPipelinedHost.
virtual HttpPipelinedHost* CreateNewHost(
- Delegate* delegate, const HostPortPair& origin,
+ Delegate* delegate, const Key& key,
HttpPipelinedConnection::Factory* factory,
HttpPipelinedHostCapability capability) = 0;
};
@@ -75,13 +93,12 @@ class NET_EXPORT_PRIVATE HttpPipelinedHost {
// requests.
virtual bool IsExistingPipelineAvailable() const = 0;
- // Returns the host and port associated with this class.
- virtual const HostPortPair& origin() const = 0;
+ // Returns a Key that uniquely identifies this host.
+ virtual const Key& key() const = 0;
// Creates a Value summary of this host's pipelines. Caller assumes
// ownership of the returned Value.
virtual base::Value* PipelineInfoToValue() const = 0;
-
};
} // namespace net

Powered by Google App Engine
This is Rietveld 408576698