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

Unified Diff: net/http/http_pipelined_host_impl.cc

Issue 8770035: Save pipelining capabilities for the most used hosts between sessions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged Created 9 years 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/http/http_pipelined_host_impl.h ('k') | net/http/http_pipelined_host_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_pipelined_host_impl.cc
diff --git a/net/http/http_pipelined_host_impl.cc b/net/http/http_pipelined_host_impl.cc
index d554fe1f4cf438169badb8d16a69ae9e92726d71..6ca759e7fc8b19e5fdd4d7e9060c3eea744c4bca 100644
--- a/net/http/http_pipelined_host_impl.cc
+++ b/net/http/http_pipelined_host_impl.cc
@@ -34,7 +34,7 @@ HttpPipelinedHostImpl::HttpPipelinedHostImpl(
HttpPipelinedHost::Delegate* delegate,
const HostPortPair& origin,
HttpPipelinedConnection::Factory* factory,
- Capability capability)
+ HttpPipelinedHostCapability capability)
: delegate_(delegate),
origin_(origin),
factory_(factory),
@@ -54,7 +54,7 @@ HttpPipelinedStream* HttpPipelinedHostImpl::CreateStreamOnNewPipeline(
const ProxyInfo& used_proxy_info,
const BoundNetLog& net_log,
bool was_npn_negotiated) {
- if (capability_ == INCAPABLE) {
+ if (capability_ == PIPELINE_INCAPABLE) {
return NULL;
}
HttpPipelinedConnection* pipeline = factory_->CreateNewPipeline(
@@ -124,21 +124,21 @@ void HttpPipelinedHostImpl::OnPipelineFeedback(
switch (feedback) {
case HttpPipelinedConnection::OK:
++pipelines_[pipeline].num_successes;
- if (capability_ == UNKNOWN) {
- capability_ = PROBABLY_CAPABLE;
+ if (capability_ == PIPELINE_UNKNOWN) {
+ capability_ = PIPELINE_PROBABLY_CAPABLE;
NotifyAllPipelinesHaveCapacity();
- } else if (capability_ == PROBABLY_CAPABLE &&
+ } else if (capability_ == PIPELINE_PROBABLY_CAPABLE &&
pipelines_[pipeline].num_successes >=
kNumKnownSuccessesThreshold) {
- capability_ = CAPABLE;
- delegate_->OnHostDeterminedCapability(this, CAPABLE);
+ capability_ = PIPELINE_CAPABLE;
+ delegate_->OnHostDeterminedCapability(this, PIPELINE_CAPABLE);
}
break;
case HttpPipelinedConnection::PIPELINE_SOCKET_ERROR:
case HttpPipelinedConnection::OLD_HTTP_VERSION:
- capability_ = INCAPABLE;
- delegate_->OnHostDeterminedCapability(this, INCAPABLE);
+ capability_ = PIPELINE_INCAPABLE;
+ delegate_->OnHostDeterminedCapability(this, PIPELINE_INCAPABLE);
break;
case HttpPipelinedConnection::MUST_CLOSE_CONNECTION:
@@ -149,15 +149,15 @@ void HttpPipelinedHostImpl::OnPipelineFeedback(
int HttpPipelinedHostImpl::GetPipelineCapacity() const {
int capacity = 0;
switch (capability_) {
- case CAPABLE:
- case PROBABLY_CAPABLE:
+ case PIPELINE_CAPABLE:
+ case PIPELINE_PROBABLY_CAPABLE:
capacity = max_pipeline_depth();
break;
- case INCAPABLE:
+ case PIPELINE_INCAPABLE:
CHECK(false);
- case UNKNOWN:
+ case PIPELINE_UNKNOWN:
capacity = 1;
break;
@@ -169,7 +169,7 @@ int HttpPipelinedHostImpl::GetPipelineCapacity() const {
bool HttpPipelinedHostImpl::CanPipelineAcceptRequests(
HttpPipelinedConnection* pipeline) const {
- return capability_ != INCAPABLE &&
+ return capability_ != PIPELINE_INCAPABLE &&
pipeline->usable() &&
pipeline->active() &&
pipeline->depth() < GetPipelineCapacity();
« no previous file with comments | « net/http/http_pipelined_host_impl.h ('k') | net/http/http_pipelined_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698