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 #include <utility> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 &channel_id_request_); | 183 &channel_id_request_); |
184 } | 184 } |
185 | 185 |
186 int ChannelIDSourceChromium::Job::DoGetChannelIDKeyComplete(int result) { | 186 int ChannelIDSourceChromium::Job::DoGetChannelIDKeyComplete(int result) { |
187 DCHECK_EQ(STATE_NONE, next_state_); | 187 DCHECK_EQ(STATE_NONE, next_state_); |
188 if (result != OK) { | 188 if (result != OK) { |
189 DLOG(WARNING) << "Failed to look up channel ID: " << ErrorToString(result); | 189 DLOG(WARNING) << "Failed to look up channel ID: " << ErrorToString(result); |
190 return result; | 190 return result; |
191 } | 191 } |
192 | 192 |
193 if (!channel_id_crypto_key_) { | 193 DCHECK(channel_id_crypto_key_); |
194 // TODO(wtc): use the new error code ERR_CHANNEL_ID_IMPORT_FAILED to be | |
195 // added in https://codereview.chromium.org/338093012/. | |
196 return ERR_UNEXPECTED; | |
197 } | |
198 channel_id_key_.reset( | 194 channel_id_key_.reset( |
199 new ChannelIDKeyChromium(std::move(channel_id_crypto_key_))); | 195 new ChannelIDKeyChromium(std::move(channel_id_crypto_key_))); |
200 | |
201 return result; | 196 return result; |
202 } | 197 } |
203 | 198 |
204 ChannelIDSourceChromium::ChannelIDSourceChromium( | 199 ChannelIDSourceChromium::ChannelIDSourceChromium( |
205 ChannelIDService* channel_id_service) | 200 ChannelIDService* channel_id_service) |
206 : channel_id_service_(channel_id_service) {} | 201 : channel_id_service_(channel_id_service) {} |
207 | 202 |
208 ChannelIDSourceChromium::~ChannelIDSourceChromium() { | 203 ChannelIDSourceChromium::~ChannelIDSourceChromium() { |
209 STLDeleteElements(&active_jobs_); | 204 STLDeleteElements(&active_jobs_); |
210 } | 205 } |
(...skipping 10 matching lines...) Expand all Loading... |
221 } | 216 } |
222 return status; | 217 return status; |
223 } | 218 } |
224 | 219 |
225 void ChannelIDSourceChromium::OnJobComplete(Job* job) { | 220 void ChannelIDSourceChromium::OnJobComplete(Job* job) { |
226 active_jobs_.erase(job); | 221 active_jobs_.erase(job); |
227 delete job; | 222 delete job; |
228 } | 223 } |
229 | 224 |
230 } // namespace net | 225 } // namespace net |
OLD | NEW |