OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/quic/test_tools/quic_stream_factory_peer.h" | 5 #include "net/quic/test_tools/quic_stream_factory_peer.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "net/cert/x509_certificate.h" | 10 #include "net/cert/x509_certificate.h" |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 | 115 |
116 void QuicStreamFactoryPeer::SetYieldAfterDuration( | 116 void QuicStreamFactoryPeer::SetYieldAfterDuration( |
117 QuicStreamFactory* factory, | 117 QuicStreamFactory* factory, |
118 QuicTime::Delta yield_after_duration) { | 118 QuicTime::Delta yield_after_duration) { |
119 factory->yield_after_duration_ = yield_after_duration; | 119 factory->yield_after_duration_ = yield_after_duration; |
120 } | 120 } |
121 | 121 |
122 size_t QuicStreamFactoryPeer::GetNumberOfActiveJobs( | 122 size_t QuicStreamFactoryPeer::GetNumberOfActiveJobs( |
123 QuicStreamFactory* factory, | 123 QuicStreamFactory* factory, |
124 const QuicServerId& server_id) { | 124 const QuicServerId& server_id) { |
125 return (factory->active_jobs_[server_id]).size(); | 125 auto it = factory->active_jobs_.find(server_id); |
| 126 if (it == factory->active_jobs_.end()) |
| 127 return 0; |
| 128 return it->second.size(); |
126 } | 129 } |
127 | 130 |
128 void QuicStreamFactoryPeer::MaybeInitialize(QuicStreamFactory* factory) { | 131 void QuicStreamFactoryPeer::MaybeInitialize(QuicStreamFactory* factory) { |
129 factory->MaybeInitialize(); | 132 factory->MaybeInitialize(); |
130 } | 133 } |
131 | 134 |
132 bool QuicStreamFactoryPeer::HasInitializedData(QuicStreamFactory* factory) { | 135 bool QuicStreamFactoryPeer::HasInitializedData(QuicStreamFactory* factory) { |
133 return factory->has_initialized_data_; | 136 return factory->has_initialized_data_; |
134 } | 137 } |
135 | 138 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 return &factory->push_promise_index_; | 192 return &factory->push_promise_index_; |
190 } | 193 } |
191 | 194 |
192 int QuicStreamFactoryPeer::GetNumPushStreamsCreated( | 195 int QuicStreamFactoryPeer::GetNumPushStreamsCreated( |
193 QuicStreamFactory* factory) { | 196 QuicStreamFactory* factory) { |
194 return factory->num_push_streams_created_; | 197 return factory->num_push_streams_created_; |
195 } | 198 } |
196 | 199 |
197 } // namespace test | 200 } // namespace test |
198 } // namespace net | 201 } // namespace net |
OLD | NEW |