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

Side by Side Diff: net/spdy/spdy_test_utils.cc

Issue 2829463002: Replace TestHeadersHandler::OnHeaderBlockEnd body with call to other method. (Closed)
Patch Set: Created 3 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
« no previous file with comments | « no previous file | no next file » | 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_test_utils.h" 5 #include "net/spdy/spdy_test_utils.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cstring> 8 #include <cstring>
9 #include <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 145
146 void TestHeadersHandler::OnHeaderBlockStart() { 146 void TestHeadersHandler::OnHeaderBlockStart() {
147 block_.clear(); 147 block_.clear();
148 } 148 }
149 149
150 void TestHeadersHandler::OnHeader(SpdyStringPiece name, SpdyStringPiece value) { 150 void TestHeadersHandler::OnHeader(SpdyStringPiece name, SpdyStringPiece value) {
151 block_.AppendValueOrAddHeader(name, value); 151 block_.AppendValueOrAddHeader(name, value);
152 } 152 }
153 153
154 void TestHeadersHandler::OnHeaderBlockEnd(size_t header_bytes_parsed) { 154 void TestHeadersHandler::OnHeaderBlockEnd(size_t header_bytes_parsed) {
155 header_bytes_parsed_ = header_bytes_parsed; 155 OnHeaderBlockEnd(header_bytes_parsed, 0);
156 compressed_header_bytes_parsed_ = 0;
157 } 156 }
158 157
159 void TestHeadersHandler::OnHeaderBlockEnd( 158 void TestHeadersHandler::OnHeaderBlockEnd(
160 size_t header_bytes_parsed, 159 size_t header_bytes_parsed,
161 size_t compressed_header_bytes_parsed) { 160 size_t compressed_header_bytes_parsed) {
162 header_bytes_parsed_ = header_bytes_parsed; 161 header_bytes_parsed_ = header_bytes_parsed;
163 compressed_header_bytes_parsed_ = compressed_header_bytes_parsed; 162 compressed_header_bytes_parsed_ = compressed_header_bytes_parsed;
164 } 163 }
165 164
166 TestServerPushDelegate::TestServerPushDelegate() {} 165 TestServerPushDelegate::TestServerPushDelegate() {}
167 166
168 TestServerPushDelegate::~TestServerPushDelegate() {} 167 TestServerPushDelegate::~TestServerPushDelegate() {}
169 168
170 void TestServerPushDelegate::OnPush( 169 void TestServerPushDelegate::OnPush(
171 std::unique_ptr<ServerPushHelper> push_helper, 170 std::unique_ptr<ServerPushHelper> push_helper,
172 const NetLogWithSource& session_net_log) { 171 const NetLogWithSource& session_net_log) {
173 push_helpers[push_helper->GetURL()] = std::move(push_helper); 172 push_helpers[push_helper->GetURL()] = std::move(push_helper);
174 } 173 }
175 174
176 bool TestServerPushDelegate::CancelPush(GURL url) { 175 bool TestServerPushDelegate::CancelPush(GURL url) {
177 auto itr = push_helpers.find(url); 176 auto itr = push_helpers.find(url);
178 DCHECK(itr != push_helpers.end()); 177 DCHECK(itr != push_helpers.end());
179 itr->second->Cancel(); 178 itr->second->Cancel();
180 push_helpers.erase(itr); 179 push_helpers.erase(itr);
181 return true; 180 return true;
182 } 181 }
183 182
184 } // namespace test 183 } // namespace test
185 } // namespace net 184 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698