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

Unified Diff: net/spdy/spdy_test_utils.cc

Issue 2492993002: Server push cancellation: Use TestPushDelegate in QuicChromiumClientSessionTest to cancel push. (Closed)
Patch Set: rebase 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/spdy/spdy_test_utils.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_test_utils.cc
diff --git a/net/spdy/spdy_test_utils.cc b/net/spdy/spdy_test_utils.cc
index 610c09179d647b92511053d76abd36565786d245..e2c327eec2251fc1ace8d4f078d5f75859f1dec0 100644
--- a/net/spdy/spdy_test_utils.cc
+++ b/net/spdy/spdy_test_utils.cc
@@ -189,5 +189,22 @@ void TestHeadersHandler::OnHeaderBlockEnd(
header_bytes_parsed_ = header_bytes_parsed;
}
+TestServerPushDelegate::TestServerPushDelegate() {}
+
+TestServerPushDelegate::~TestServerPushDelegate() {}
+
+void TestServerPushDelegate::OnPush(
+ std::unique_ptr<ServerPushHelper> push_helper) {
+ push_helpers[push_helper->GetURL()] = std::move(push_helper);
+}
+
+bool TestServerPushDelegate::CancelPush(GURL url) {
+ auto itr = push_helpers.find(url);
+ DCHECK(itr != push_helpers.end());
+ itr->second->Cancel();
+ push_helpers.erase(itr);
+ return true;
+}
+
} // namespace test
} // namespace net
« 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