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

Unified Diff: net/http/http_pipelined_stream.h

Issue 7289006: Basic HTTP pipelining support (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added about:flags entry Created 9 years, 5 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_stream.h
diff --git a/net/http/http_pipelined_stream.h b/net/http/http_pipelined_stream.h
new file mode 100644
index 0000000000000000000000000000000000000000..c0cafaa24e1d6a663d4ab0d363a73d8a14ad9d52
--- /dev/null
+++ b/net/http/http_pipelined_stream.h
@@ -0,0 +1,94 @@
+// 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.
+//
+// HttpPipelinedStream is the pipelined implementation of HttpStream. It has
mmenke 2011/08/03 21:09:39 nit: Class docs should go above class HttpPipelin
James Simonsen 2011/08/05 01:39:00 Done.
+// very little code in it. Instead, it serves as the client's interface to the
+// pipelined connection, where all the work happens.
+//
+// In the case of pipelining failures, these functions may return
+// ERR_PIPELINE_EVICTION. In that case, the client should retry the HTTP
+// request without pipelining.
+
+#ifndef NET_HTTP_HTTP_PIPELINED_STREAM_H_
+#define NET_HTTP_HTTP_PIPELINED_STREAM_H_
+#pragma once
+
+#include <string>
+
+#include "base/basictypes.h"
+#include "base/memory/scoped_ptr.h"
+#include "net/http/http_stream.h"
+
+namespace net {
+
+class BoundNetLog;
+class HttpPipelinedConnection;
+class HttpResponseInfo;
+struct HttpRequestInfo;
+class HttpRequestHeaders;
+class HttpStreamParser;
+class IOBuffer;
+class UploadDataStream;
+
+class HttpPipelinedStream : public HttpStream {
+ public:
+ HttpPipelinedStream(HttpPipelinedConnection* pipeline);
+ virtual ~HttpPipelinedStream();
+
+ // HttpStream methods:
+ virtual int InitializeStream(const HttpRequestInfo* request_info,
+ const BoundNetLog& net_log,
+ CompletionCallback* callback);
mmenke 2011/08/03 21:09:39 nit: Should use OVERRIDE with overridden function
James Simonsen 2011/08/05 01:39:00 Done.
+
+ virtual int SendRequest(const HttpRequestHeaders& headers,
+ UploadDataStream* request_body,
+ HttpResponseInfo* response,
+ CompletionCallback* callback);
+
+ virtual uint64 GetUploadProgress() const;
+
+ virtual int ReadResponseHeaders(CompletionCallback* callback);
+
+ virtual const HttpResponseInfo* GetResponseInfo() const;
+
+ virtual int ReadResponseBody(IOBuffer* buf, int buf_len,
+ CompletionCallback* callback);
+
+ virtual void Close(bool not_reusable);
+
+ virtual HttpStream* RenewStreamForAuth();
+
+ virtual bool IsResponseBodyComplete() const;
+
+ virtual bool CanFindEndOfResponse() const;
+
+ virtual bool IsMoreDataBuffered() const;
+
+ virtual bool IsConnectionReused() const;
+
+ virtual void SetConnectionReused();
+
+ virtual bool IsConnectionReusable() const;
+
+ virtual void GetSSLInfo(SSLInfo* ssl_info);
+
+ virtual void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info);
+
+ virtual bool IsSpdyHttpStream() const;
+
+ virtual void LogNumRttVsBytesMetrics() const;
+
+ private:
+ HttpPipelinedConnection* pipeline_;
+
+ int pipeline_id_;
+
+ const HttpRequestInfo* request_info_;
+
+ DISALLOW_COPY_AND_ASSIGN(HttpPipelinedStream);
+};
+
+} // namespace net
+
+#endif // NET_HTTP_HTTP_PIPELINED_STREAM_H_

Powered by Google App Engine
This is Rietveld 408576698