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

Side by Side Diff: net/spdy/spdy_stream_test_util.h

Issue 1272283003: Add a new SpdyStream::Delegate method to handle trailers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add NOTREACHED Created 5 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 unified diff | Download patch
« no previous file with comments | « net/spdy/spdy_stream.cc ('k') | net/spdy/spdy_stream_test_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_SPDY_SPDY_STREAM_TEST_UTIL_H_ 5 #ifndef NET_SPDY_SPDY_STREAM_TEST_UTIL_H_
6 #define NET_SPDY_SPDY_STREAM_TEST_UTIL_H_ 6 #define NET_SPDY_SPDY_STREAM_TEST_UTIL_H_
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 13 matching lines...) Expand all
24 public: 24 public:
25 explicit ClosingDelegate(const base::WeakPtr<SpdyStream>& stream); 25 explicit ClosingDelegate(const base::WeakPtr<SpdyStream>& stream);
26 ~ClosingDelegate() override; 26 ~ClosingDelegate() override;
27 27
28 // SpdyStream::Delegate implementation. 28 // SpdyStream::Delegate implementation.
29 void OnRequestHeadersSent() override; 29 void OnRequestHeadersSent() override;
30 SpdyResponseHeadersStatus OnResponseHeadersUpdated( 30 SpdyResponseHeadersStatus OnResponseHeadersUpdated(
31 const SpdyHeaderBlock& response_headers) override; 31 const SpdyHeaderBlock& response_headers) override;
32 void OnDataReceived(scoped_ptr<SpdyBuffer> buffer) override; 32 void OnDataReceived(scoped_ptr<SpdyBuffer> buffer) override;
33 void OnDataSent() override; 33 void OnDataSent() override;
34 void OnTrailers(const SpdyHeaderBlock& trailers) override;
34 void OnClose(int status) override; 35 void OnClose(int status) override;
35 36
36 // Returns whether or not the stream is closed. 37 // Returns whether or not the stream is closed.
37 bool StreamIsClosed() const { return !stream_.get(); } 38 bool StreamIsClosed() const { return !stream_.get(); }
38 39
39 private: 40 private:
40 base::WeakPtr<SpdyStream> stream_; 41 base::WeakPtr<SpdyStream> stream_;
41 }; 42 };
42 43
43 // Base class with shared functionality for test delegate 44 // Base class with shared functionality for test delegate
44 // implementations below. 45 // implementations below.
45 class StreamDelegateBase : public SpdyStream::Delegate { 46 class StreamDelegateBase : public SpdyStream::Delegate {
46 public: 47 public:
47 explicit StreamDelegateBase(const base::WeakPtr<SpdyStream>& stream); 48 explicit StreamDelegateBase(const base::WeakPtr<SpdyStream>& stream);
48 ~StreamDelegateBase() override; 49 ~StreamDelegateBase() override;
49 50
50 void OnRequestHeadersSent() override; 51 void OnRequestHeadersSent() override;
51 SpdyResponseHeadersStatus OnResponseHeadersUpdated( 52 SpdyResponseHeadersStatus OnResponseHeadersUpdated(
52 const SpdyHeaderBlock& response_headers) override; 53 const SpdyHeaderBlock& response_headers) override;
53 void OnDataReceived(scoped_ptr<SpdyBuffer> buffer) override; 54 void OnDataReceived(scoped_ptr<SpdyBuffer> buffer) override;
54 void OnDataSent() override; 55 void OnDataSent() override;
56 void OnTrailers(const SpdyHeaderBlock& trailers) override;
55 void OnClose(int status) override; 57 void OnClose(int status) override;
56 58
57 // Waits for the stream to be closed and returns the status passed 59 // Waits for the stream to be closed and returns the status passed
58 // to OnClose(). 60 // to OnClose().
59 int WaitForClose(); 61 int WaitForClose();
60 62
61 // Drains all data from the underlying read queue and returns it as 63 // Drains all data from the underlying read queue and returns it as
62 // a string. 64 // a string.
63 std::string TakeReceivedData(); 65 std::string TakeReceivedData();
64 66
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 131
130 SpdyResponseHeadersStatus OnResponseHeadersUpdated( 132 SpdyResponseHeadersStatus OnResponseHeadersUpdated(
131 const SpdyHeaderBlock& response_headers) override; 133 const SpdyHeaderBlock& response_headers) override;
132 }; 134 };
133 135
134 } // namespace test 136 } // namespace test
135 137
136 } // namespace net 138 } // namespace net
137 139
138 #endif // NET_SPDY_SPDY_STREAM_TEST_UTIL_H_ 140 #endif // NET_SPDY_SPDY_STREAM_TEST_UTIL_H_
OLDNEW
« no previous file with comments | « net/spdy/spdy_stream.cc ('k') | net/spdy/spdy_stream_test_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698