| 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/crypto/channel_id_chromium.h" | 5 #include "net/quic/crypto/channel_id_chromium.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <utility> |
| 8 | 9 |
| 9 #include "base/macros.h" | 10 #include "base/macros.h" |
| 10 #include "base/stl_util.h" | 11 #include "base/stl_util.h" |
| 11 #include "base/strings/string_util.h" | 12 #include "base/strings/string_util.h" |
| 12 #include "crypto/ec_private_key.h" | 13 #include "crypto/ec_private_key.h" |
| 13 #include "crypto/ec_signature_creator.h" | 14 #include "crypto/ec_signature_creator.h" |
| 14 #include "net/base/net_errors.h" | 15 #include "net/base/net_errors.h" |
| 15 #include "net/cert/asn1_util.h" | 16 #include "net/cert/asn1_util.h" |
| 16 #include "net/ssl/channel_id_service.h" | 17 #include "net/ssl/channel_id_service.h" |
| 17 | 18 |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 DLOG(WARNING) << "Failed to look up channel ID: " << ErrorToString(result); | 189 DLOG(WARNING) << "Failed to look up channel ID: " << ErrorToString(result); |
| 189 return result; | 190 return result; |
| 190 } | 191 } |
| 191 | 192 |
| 192 if (!channel_id_crypto_key_) { | 193 if (!channel_id_crypto_key_) { |
| 193 // TODO(wtc): use the new error code ERR_CHANNEL_ID_IMPORT_FAILED to be | 194 // TODO(wtc): use the new error code ERR_CHANNEL_ID_IMPORT_FAILED to be |
| 194 // added in https://codereview.chromium.org/338093012/. | 195 // added in https://codereview.chromium.org/338093012/. |
| 195 return ERR_UNEXPECTED; | 196 return ERR_UNEXPECTED; |
| 196 } | 197 } |
| 197 channel_id_key_.reset( | 198 channel_id_key_.reset( |
| 198 new ChannelIDKeyChromium(channel_id_crypto_key_.Pass())); | 199 new ChannelIDKeyChromium(std::move(channel_id_crypto_key_))); |
| 199 | 200 |
| 200 return result; | 201 return result; |
| 201 } | 202 } |
| 202 | 203 |
| 203 ChannelIDSourceChromium::ChannelIDSourceChromium( | 204 ChannelIDSourceChromium::ChannelIDSourceChromium( |
| 204 ChannelIDService* channel_id_service) | 205 ChannelIDService* channel_id_service) |
| 205 : channel_id_service_(channel_id_service) {} | 206 : channel_id_service_(channel_id_service) {} |
| 206 | 207 |
| 207 ChannelIDSourceChromium::~ChannelIDSourceChromium() { | 208 ChannelIDSourceChromium::~ChannelIDSourceChromium() { |
| 208 STLDeleteElements(&active_jobs_); | 209 STLDeleteElements(&active_jobs_); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 220 } | 221 } |
| 221 return status; | 222 return status; |
| 222 } | 223 } |
| 223 | 224 |
| 224 void ChannelIDSourceChromium::OnJobComplete(Job* job) { | 225 void ChannelIDSourceChromium::OnJobComplete(Job* job) { |
| 225 active_jobs_.erase(job); | 226 active_jobs_.erase(job); |
| 226 delete job; | 227 delete job; |
| 227 } | 228 } |
| 228 | 229 |
| 229 } // namespace net | 230 } // namespace net |
| OLD | NEW |