Chromium Code Reviews| 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..7d71f3b6839e9324a1e96ae36c564a9374c82a80 100644 |
| --- a/net/spdy/spdy_test_utils.cc |
| +++ b/net/spdy/spdy_test_utils.cc |
| @@ -189,5 +189,24 @@ 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); |
| + if (itr == push_helpers.end()) |
| + 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
|
| + |
| + itr->second->Cancel(); |
| + push_helpers.erase(itr); |
| + return true; |
| +} |
| + |
| } // namespace test |
| } // namespace net |