| OLD | NEW |
| 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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 size_t header_bytes_parsed, | 161 size_t header_bytes_parsed, |
| 162 size_t /* compressed_header_bytes_parsed */) { | 162 size_t /* compressed_header_bytes_parsed */) { |
| 163 header_bytes_parsed_ = header_bytes_parsed; | 163 header_bytes_parsed_ = header_bytes_parsed; |
| 164 } | 164 } |
| 165 | 165 |
| 166 TestServerPushDelegate::TestServerPushDelegate() {} | 166 TestServerPushDelegate::TestServerPushDelegate() {} |
| 167 | 167 |
| 168 TestServerPushDelegate::~TestServerPushDelegate() {} | 168 TestServerPushDelegate::~TestServerPushDelegate() {} |
| 169 | 169 |
| 170 void TestServerPushDelegate::OnPush( | 170 void TestServerPushDelegate::OnPush( |
| 171 std::unique_ptr<ServerPushHelper> push_helper) { | 171 std::unique_ptr<ServerPushHelper> push_helper, |
| 172 const NetLogWithSource& session_net_log) { |
| 172 push_helpers[push_helper->GetURL()] = std::move(push_helper); | 173 push_helpers[push_helper->GetURL()] = std::move(push_helper); |
| 173 } | 174 } |
| 174 | 175 |
| 175 bool TestServerPushDelegate::CancelPush(GURL url) { | 176 bool TestServerPushDelegate::CancelPush(GURL url) { |
| 176 auto itr = push_helpers.find(url); | 177 auto itr = push_helpers.find(url); |
| 177 DCHECK(itr != push_helpers.end()); | 178 DCHECK(itr != push_helpers.end()); |
| 178 itr->second->Cancel(); | 179 itr->second->Cancel(); |
| 179 push_helpers.erase(itr); | 180 push_helpers.erase(itr); |
| 180 return true; | 181 return true; |
| 181 } | 182 } |
| 182 | 183 |
| 183 } // namespace test | 184 } // namespace test |
| 184 } // namespace net | 185 } // namespace net |
| OLD | NEW |