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

Side by Side Diff: trunk/src/net/spdy/spdy_stream_test_util.cc

Issue 13996009: Revert 194560 "[SPDY] Replace SpdyIOBuffer with new SpdyBuffer c..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « trunk/src/net/spdy/spdy_stream_test_util.h ('k') | trunk/src/net/spdy/spdy_websocket_stream.h » ('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 #include "net/spdy/spdy_stream_test_util.h" 5 #include "net/spdy/spdy_stream_test_util.h"
6 6
7 #include "net/base/completion_callback.h" 7 #include "net/base/completion_callback.h"
8 #include "net/spdy/spdy_stream.h" 8 #include "net/spdy/spdy_stream.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
(...skipping 19 matching lines...) Expand all
30 } 30 }
31 31
32 int ClosingDelegate::OnResponseReceived(const SpdyHeaderBlock& response, 32 int ClosingDelegate::OnResponseReceived(const SpdyHeaderBlock& response,
33 base::Time response_time, 33 base::Time response_time,
34 int status) { 34 int status) {
35 return OK; 35 return OK;
36 } 36 }
37 37
38 void ClosingDelegate::OnHeadersSent() {} 38 void ClosingDelegate::OnHeadersSent() {}
39 39
40 int ClosingDelegate::OnDataReceived(scoped_ptr<SpdyBuffer> buffer) { 40 int ClosingDelegate::OnDataReceived(const char* data, int length) {
41 return OK; 41 return OK;
42 } 42 }
43 43
44 void ClosingDelegate::OnDataSent(size_t bytes_sent) {} 44 void ClosingDelegate::OnDataSent(size_t bytes_sent) {}
45 45
46 void ClosingDelegate::OnClose(int status) { 46 void ClosingDelegate::OnClose(int status) {
47 if (stream_) 47 if (stream_)
48 stream_->Close(); 48 stream_->Close();
49 stream_ = NULL; 49 stream_ = NULL;
50 } 50 }
(...skipping 19 matching lines...) Expand all
70 int status) { 70 int status) {
71 EXPECT_TRUE(send_headers_completed_); 71 EXPECT_TRUE(send_headers_completed_);
72 response_ = response; 72 response_ = response;
73 return status; 73 return status;
74 } 74 }
75 75
76 void StreamDelegateBase::OnHeadersSent() { 76 void StreamDelegateBase::OnHeadersSent() {
77 headers_sent_++; 77 headers_sent_++;
78 } 78 }
79 79
80 int StreamDelegateBase::OnDataReceived(scoped_ptr<SpdyBuffer> buffer) { 80 int StreamDelegateBase::OnDataReceived(const char* buffer, int bytes) {
81 if (buffer) { 81 received_data_ += std::string(buffer, bytes);
82 received_data_ += std::string(buffer->GetRemainingData(),
83 buffer->GetRemainingSize());
84 }
85 return OK; 82 return OK;
86 } 83 }
87 84
88 void StreamDelegateBase::OnDataSent(size_t bytes_sent) { 85 void StreamDelegateBase::OnDataSent(size_t bytes_sent) {
89 data_sent_ += bytes_sent; 86 data_sent_ += bytes_sent;
90 } 87 }
91 88
92 void StreamDelegateBase::OnClose(int status) { 89 void StreamDelegateBase::OnClose(int status) {
93 if (!stream_) 90 if (!stream_)
94 return; 91 return;
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 // Go back to OnSendBody() to send the remaining data. 168 // Go back to OnSendBody() to send the remaining data.
172 return MORE_DATA_TO_SEND; 169 return MORE_DATA_TO_SEND;
173 } 170 }
174 171
175 return NO_MORE_DATA_TO_SEND; 172 return NO_MORE_DATA_TO_SEND;
176 } 173 }
177 174
178 } // namespace test 175 } // namespace test
179 176
180 } // namespace net 177 } // namespace net
OLDNEW
« no previous file with comments | « trunk/src/net/spdy/spdy_stream_test_util.h ('k') | trunk/src/net/spdy/spdy_websocket_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698