| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/chromium/crypto/channel_id_chromium.h" | 5 #include "net/quic/chromium/crypto/channel_id_chromium.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 channel_id_key_.reset( | 193 channel_id_key_.reset( |
| 194 new ChannelIDKeyChromium(std::move(channel_id_crypto_key_))); | 194 new ChannelIDKeyChromium(std::move(channel_id_crypto_key_))); |
| 195 return result; | 195 return result; |
| 196 } | 196 } |
| 197 | 197 |
| 198 ChannelIDSourceChromium::ChannelIDSourceChromium( | 198 ChannelIDSourceChromium::ChannelIDSourceChromium( |
| 199 ChannelIDService* channel_id_service) | 199 ChannelIDService* channel_id_service) |
| 200 : channel_id_service_(channel_id_service) {} | 200 : channel_id_service_(channel_id_service) {} |
| 201 | 201 |
| 202 ChannelIDSourceChromium::~ChannelIDSourceChromium() { | 202 ChannelIDSourceChromium::~ChannelIDSourceChromium() { |
| 203 STLDeleteElements(&active_jobs_); | 203 base::STLDeleteElements(&active_jobs_); |
| 204 } | 204 } |
| 205 | 205 |
| 206 QuicAsyncStatus ChannelIDSourceChromium::GetChannelIDKey( | 206 QuicAsyncStatus ChannelIDSourceChromium::GetChannelIDKey( |
| 207 const std::string& hostname, | 207 const std::string& hostname, |
| 208 std::unique_ptr<ChannelIDKey>* channel_id_key, | 208 std::unique_ptr<ChannelIDKey>* channel_id_key, |
| 209 ChannelIDSourceCallback* callback) { | 209 ChannelIDSourceCallback* callback) { |
| 210 std::unique_ptr<Job> job(new Job(this, channel_id_service_)); | 210 std::unique_ptr<Job> job(new Job(this, channel_id_service_)); |
| 211 QuicAsyncStatus status = | 211 QuicAsyncStatus status = |
| 212 job->GetChannelIDKey(hostname, channel_id_key, callback); | 212 job->GetChannelIDKey(hostname, channel_id_key, callback); |
| 213 if (status == QUIC_PENDING) { | 213 if (status == QUIC_PENDING) { |
| 214 active_jobs_.insert(job.release()); | 214 active_jobs_.insert(job.release()); |
| 215 } | 215 } |
| 216 return status; | 216 return status; |
| 217 } | 217 } |
| 218 | 218 |
| 219 void ChannelIDSourceChromium::OnJobComplete(Job* job) { | 219 void ChannelIDSourceChromium::OnJobComplete(Job* job) { |
| 220 active_jobs_.erase(job); | 220 active_jobs_.erase(job); |
| 221 delete job; | 221 delete job; |
| 222 } | 222 } |
| 223 | 223 |
| 224 } // namespace net | 224 } // namespace net |
| OLD | NEW |