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

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

Issue 9433015: Add a force pipelining option to load flags. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: More tests 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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>
(...skipping 19 matching lines...) Expand all
30 struct SSLConfig; 30 struct SSLConfig;
31 31
32 // Manages all of the pipelining state for specific host with active pipelined 32 // Manages all of the pipelining state for specific host with active pipelined
33 // HTTP requests. Manages connection jobs, constructs pipelined streams, and 33 // HTTP requests. Manages connection jobs, constructs pipelined streams, and
34 // assigns requests to the least loaded pipelined connection. 34 // assigns requests to the least loaded pipelined connection.
35 class NET_EXPORT_PRIVATE HttpPipelinedHostImpl 35 class NET_EXPORT_PRIVATE HttpPipelinedHostImpl
36 : public HttpPipelinedHost, 36 : public HttpPipelinedHost,
37 public HttpPipelinedConnection::Delegate { 37 public HttpPipelinedConnection::Delegate {
38 public: 38 public:
39 HttpPipelinedHostImpl(HttpPipelinedHost::Delegate* delegate, 39 HttpPipelinedHostImpl(HttpPipelinedHost::Delegate* delegate,
40 const HostPortPair& origin, 40 const HttpPipelinedHost::Key& key,
41 HttpPipelinedConnection::Factory* factory, 41 HttpPipelinedConnection::Factory* factory,
42 HttpPipelinedHostCapability capability); 42 HttpPipelinedHostCapability capability);
43 virtual ~HttpPipelinedHostImpl(); 43 virtual ~HttpPipelinedHostImpl();
44 44
45 // HttpPipelinedHost interface 45 // HttpPipelinedHost interface
46 virtual HttpPipelinedStream* CreateStreamOnNewPipeline( 46 virtual HttpPipelinedStream* CreateStreamOnNewPipeline(
47 ClientSocketHandle* connection, 47 ClientSocketHandle* connection,
48 const SSLConfig& used_ssl_config, 48 const SSLConfig& used_ssl_config,
49 const ProxyInfo& used_proxy_info, 49 const ProxyInfo& used_proxy_info,
50 const BoundNetLog& net_log, 50 const BoundNetLog& net_log,
51 bool was_npn_negotiated, 51 bool was_npn_negotiated,
52 SSLClientSocket::NextProto protocol_negotiated) OVERRIDE; 52 SSLClientSocket::NextProto protocol_negotiated) OVERRIDE;
53 53
54 virtual HttpPipelinedStream* CreateStreamOnExistingPipeline() OVERRIDE; 54 virtual HttpPipelinedStream* CreateStreamOnExistingPipeline() OVERRIDE;
55 55
56 virtual bool IsExistingPipelineAvailable() const OVERRIDE; 56 virtual bool IsExistingPipelineAvailable() const OVERRIDE;
57 57
58 // HttpPipelinedConnection::Delegate interface 58 // HttpPipelinedConnection::Delegate interface
59 59
60 // Called when a pipelined connection completes a request. Adds a pending 60 // Called when a pipelined connection completes a request. Adds a pending
61 // request to the pipeline if the pipeline is still usable. 61 // request to the pipeline if the pipeline is still usable.
62 virtual void OnPipelineHasCapacity( 62 virtual void OnPipelineHasCapacity(
63 HttpPipelinedConnection* pipeline) OVERRIDE; 63 HttpPipelinedConnection* pipeline) OVERRIDE;
64 64
65 virtual void OnPipelineFeedback( 65 virtual void OnPipelineFeedback(
66 HttpPipelinedConnection* pipeline, 66 HttpPipelinedConnection* pipeline,
67 HttpPipelinedConnection::Feedback feedback) OVERRIDE; 67 HttpPipelinedConnection::Feedback feedback) OVERRIDE;
68 68
69 virtual const HostPortPair& origin() const OVERRIDE; 69 virtual const Key& GetKey() const OVERRIDE;
70 70
71 // Creates a Value summary of this host's |pipelines_|. Caller assumes 71 // Creates a Value summary of this host's |pipelines_|. Caller assumes
72 // ownership of the returned Value. 72 // ownership of the returned Value.
73 virtual base::Value* PipelineInfoToValue() const OVERRIDE; 73 virtual base::Value* PipelineInfoToValue() const OVERRIDE;
74 74
75 // Returns the maximum number of in-flight pipelined requests we'll allow on a 75 // Returns the maximum number of in-flight pipelined requests we'll allow on a
76 // single connection. 76 // single connection.
77 static int max_pipeline_depth() { return 3; } 77 static int max_pipeline_depth() { return 3; }
78 78
79 private: 79 private:
(...skipping 18 matching lines...) Expand all
98 // Returns true if |pipeline| can handle a new request. This is true if the 98 // Returns true if |pipeline| can handle a new request. This is true if the
99 // |pipeline| is active, usable, has capacity, and |capability_| is 99 // |pipeline| is active, usable, has capacity, and |capability_| is
100 // sufficient. 100 // sufficient.
101 bool CanPipelineAcceptRequests(HttpPipelinedConnection* pipeline) const; 101 bool CanPipelineAcceptRequests(HttpPipelinedConnection* pipeline) const;
102 102
103 // Called when |this| moves from UNKNOWN |capability_| to PROBABLY_CAPABLE. 103 // Called when |this| moves from UNKNOWN |capability_| to PROBABLY_CAPABLE.
104 // Causes all pipelines to increase capacity to start pipelining. 104 // Causes all pipelines to increase capacity to start pipelining.
105 void NotifyAllPipelinesHaveCapacity(); 105 void NotifyAllPipelinesHaveCapacity();
106 106
107 HttpPipelinedHost::Delegate* delegate_; 107 HttpPipelinedHost::Delegate* delegate_;
108 const HostPortPair origin_; 108 const Key key_;
109 PipelineInfoMap pipelines_; 109 PipelineInfoMap pipelines_;
110 scoped_ptr<HttpPipelinedConnection::Factory> factory_; 110 scoped_ptr<HttpPipelinedConnection::Factory> factory_;
111 HttpPipelinedHostCapability capability_; 111 HttpPipelinedHostCapability capability_;
112 112
113 DISALLOW_COPY_AND_ASSIGN(HttpPipelinedHostImpl); 113 DISALLOW_COPY_AND_ASSIGN(HttpPipelinedHostImpl);
114 }; 114 };
115 115
116 } // namespace net 116 } // namespace net
117 117
118 #endif // NET_HTTP_HTTP_PIPELINED_HOST_IMPL_H_ 118 #endif // NET_HTTP_HTTP_PIPELINED_HOST_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698