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

Side by Side Diff: net/http/http_pipelined_host_impl.h

Issue 8770035: Save pipelining capabilities for the most used hosts between sessions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Put Capability in its own file 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #ifndef NET_HTTP_HTTP_PIPELINED_HOST_IMPL_H_ 5 #ifndef NET_HTTP_HTTP_PIPELINED_HOST_IMPL_H_
6 #define NET_HTTP_HTTP_PIPELINED_HOST_IMPL_H_ 6 #define NET_HTTP_HTTP_PIPELINED_HOST_IMPL_H_
7 #pragma once 7 #pragma once
8 8
9 #include <map> 9 #include <map>
10 #include <string> 10 #include <string>
11 11
12 #include "base/basictypes.h" 12 #include "base/basictypes.h"
13 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "net/base/host_port_pair.h" 14 #include "net/base/host_port_pair.h"
15 #include "net/base/net_export.h" 15 #include "net/base/net_export.h"
16 #include "net/http/http_pipelined_connection.h" 16 #include "net/http/http_pipelined_connection.h"
17 #include "net/http/http_pipelined_host.h" 17 #include "net/http/http_pipelined_host.h"
18 #include "net/http/http_pipelined_host_capability.h"
18 19
19 namespace net { 20 namespace net {
20 21
21 class BoundNetLog; 22 class BoundNetLog;
22 class ClientSocketHandle; 23 class ClientSocketHandle;
23 class HttpPipelinedStream; 24 class HttpPipelinedStream;
24 class ProxyInfo; 25 class ProxyInfo;
25 struct SSLConfig; 26 struct SSLConfig;
26 27
27 // Manages all of the pipelining state for specific host with active pipelined 28 // Manages all of the pipelining state for specific host with active pipelined
28 // HTTP requests. Manages connection jobs, constructs pipelined streams, and 29 // HTTP requests. Manages connection jobs, constructs pipelined streams, and
29 // assigns requests to the least loaded pipelined connection. 30 // assigns requests to the least loaded pipelined connection.
30 class NET_EXPORT_PRIVATE HttpPipelinedHostImpl 31 class NET_EXPORT_PRIVATE HttpPipelinedHostImpl
31 : public HttpPipelinedHost, 32 : public HttpPipelinedHost,
32 public HttpPipelinedConnection::Delegate { 33 public HttpPipelinedConnection::Delegate {
33 public: 34 public:
34 HttpPipelinedHostImpl(HttpPipelinedHost::Delegate* delegate, 35 HttpPipelinedHostImpl(HttpPipelinedHost::Delegate* delegate,
35 const HostPortPair& origin, 36 const HostPortPair& origin,
36 HttpPipelinedConnection::Factory* factory, 37 HttpPipelinedConnection::Factory* factory,
37 Capability capability); 38 HttpPipelinedHostCapability capability);
38 virtual ~HttpPipelinedHostImpl(); 39 virtual ~HttpPipelinedHostImpl();
39 40
40 // HttpPipelinedHost interface 41 // HttpPipelinedHost interface
41 virtual HttpPipelinedStream* CreateStreamOnNewPipeline( 42 virtual HttpPipelinedStream* CreateStreamOnNewPipeline(
42 ClientSocketHandle* connection, 43 ClientSocketHandle* connection,
43 const SSLConfig& used_ssl_config, 44 const SSLConfig& used_ssl_config,
44 const ProxyInfo& used_proxy_info, 45 const ProxyInfo& used_proxy_info,
45 const BoundNetLog& net_log, 46 const BoundNetLog& net_log,
46 bool was_npn_negotiated) OVERRIDE; 47 bool was_npn_negotiated) OVERRIDE;
47 48
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 void AddRequestToPipeline(HttpPipelinedConnection* connection); 83 void AddRequestToPipeline(HttpPipelinedConnection* connection);
83 84
84 // Returns the current pipeline capacity based on |capability_|. This should 85 // Returns the current pipeline capacity based on |capability_|. This should
85 // not be called if |capability_| is INCAPABLE. 86 // not be called if |capability_| is INCAPABLE.
86 int GetPipelineCapacity() const; 87 int GetPipelineCapacity() const;
87 88
88 HttpPipelinedHost::Delegate* delegate_; 89 HttpPipelinedHost::Delegate* delegate_;
89 const HostPortPair origin_; 90 const HostPortPair origin_;
90 PipelineInfoMap pipelines_; 91 PipelineInfoMap pipelines_;
91 scoped_ptr<HttpPipelinedConnection::Factory> factory_; 92 scoped_ptr<HttpPipelinedConnection::Factory> factory_;
92 Capability capability_; 93 HttpPipelinedHostCapability capability_;
93 94
94 DISALLOW_COPY_AND_ASSIGN(HttpPipelinedHostImpl); 95 DISALLOW_COPY_AND_ASSIGN(HttpPipelinedHostImpl);
95 }; 96 };
96 97
97 } // namespace net 98 } // namespace net
98 99
99 #endif // NET_HTTP_HTTP_PIPELINED_HOST_IMPL_H_ 100 #endif // NET_HTTP_HTTP_PIPELINED_HOST_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698