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

Unified Diff: net/http/http_pipelined_connection.h

Issue 7289006: Basic HTTP pipelining support (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added unit tests Created 9 years, 4 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_connection.h
diff --git a/net/http/http_pipelined_connection.h b/net/http/http_pipelined_connection.h
new file mode 100644
index 0000000000000000000000000000000000000000..6b526802f7cb352845b1d9d789d7b61c38f61cde
--- /dev/null
+++ b/net/http/http_pipelined_connection.h
@@ -0,0 +1,74 @@
+// Copyright (c) 2011 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_HTTP_HTTP_PIPELINED_CONNECTION_H_
+#define NET_HTTP_HTTP_PIPELINED_CONNECTION_H_
+#pragma once
+
+#include "net/base/net_log.h"
+
+namespace net {
+
+class BoundNetLog;
+class ClientSocketHandle;
+class HttpStream;
+class ProxyInfo;
+class SSLConfig;
+
+class HttpPipelinedConnection {
+ public:
+ class Owner {
+ public:
+ // Called when a pipeline has newly available capacity. This may be because
+ // the first request has been sent and the pipeline is now active. Or, it
+ // may be because a request successfully completed.
+ virtual void OnPipelineHasCapacity(HttpPipelinedConnection* pipeline) = 0;
+ };
+
+ class Factory {
+ public:
+ virtual HttpPipelinedConnection* CreateNewPipeline(
+ ClientSocketHandle* connection,
+ Owner* owner,
+ const SSLConfig& used_ssl_config,
+ const ProxyInfo& used_proxy_info,
+ const BoundNetLog& net_log,
+ bool was_npn_negotiated) = 0;
+ };
+
+ virtual ~HttpPipelinedConnection() {}
+
+ // Returns a new stream that uses this pipeline.
+ virtual HttpStream* CreateNewStream() = 0;
+
+ // Notifies this pipeline that a stream is no longer using it.
+ virtual void OnStreamDeleted(int pipeline_id) = 0;
+
+ // The number of streams currently associated with this pipeline.
+ virtual int depth() const = 0;
+
+ // True if this pipeline can accept new HTTP requests. False if a fatal error
+ // has occurred.
+ virtual bool usable() const = 0;
+
+ // True if this pipeline has bound one request and is ready for additional
+ // requests.
+ virtual bool active() const= 0;
mmenke 2011/08/23 19:05:25 nit: space
James Simonsen 2011/08/26 22:19:07 Done.
+
+ // The SSLConfig used to establish this connection.
+ virtual const SSLConfig& used_ssl_config() const = 0;
+
+ // The ProxyInfo used to establish this connection.
+ virtual const ProxyInfo& used_proxy_info() const = 0;
+
+ // The source of this piplened connection.
+ virtual const NetLog::Source& source() const = 0;
+
+ // True if this connection was NPN negotiated.
+ virtual bool was_npn_negotiated() const = 0;
+};
+
+} // namespace net
+
+#endif // NET_HTTP_HTTP_PIPELINED_CONNECTION_H_

Powered by Google App Engine
This is Rietveld 408576698