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

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

Issue 2492993002: Server push cancellation: Use TestPushDelegate in QuicChromiumClientSessionTest to cancel push. (Closed)
Patch Set: Created 4 years, 1 month 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_test_utils.h ('k') | 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 <cstring> 7 #include <cstring>
8 #include <memory> 8 #include <memory>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 void TestHeadersHandler::OnHeaderBlockEnd(size_t header_bytes_parsed) { 182 void TestHeadersHandler::OnHeaderBlockEnd(size_t header_bytes_parsed) {
183 header_bytes_parsed_ = header_bytes_parsed; 183 header_bytes_parsed_ = header_bytes_parsed;
184 } 184 }
185 185
186 void TestHeadersHandler::OnHeaderBlockEnd( 186 void TestHeadersHandler::OnHeaderBlockEnd(
187 size_t header_bytes_parsed, 187 size_t header_bytes_parsed,
188 size_t /* compressed_header_bytes_parsed */) { 188 size_t /* compressed_header_bytes_parsed */) {
189 header_bytes_parsed_ = header_bytes_parsed; 189 header_bytes_parsed_ = header_bytes_parsed;
190 } 190 }
191 191
192 TestServerPushDelegate::TestServerPushDelegate() {}
193
194 TestServerPushDelegate::~TestServerPushDelegate() {}
195
196 void TestServerPushDelegate::OnPush(
197 std::unique_ptr<ServerPushHelper> push_helper) {
198 push_helpers[push_helper->GetURL()] = std::move(push_helper);
199 }
200
201 bool TestServerPushDelegate::CancelPush(GURL url) {
202 auto itr = push_helpers.find(url);
203 if (itr == push_helpers.end())
204 return false;
Ryan Hamilton 2016/11/11 01:22:57 Are there any cases where this should be called wi
Zhongyi Shi 2016/11/11 01:38:45 It shouldn't be, unless someone is writing wrong t
205
206 itr->second->Cancel();
207 push_helpers.erase(itr);
208 return true;
209 }
210
192 } // namespace test 211 } // namespace test
193 } // namespace net 212 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/spdy_test_utils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698