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/ssl/default_channel_id_store.h" | 5 #include "net/ssl/default_channel_id_store.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "crypto/ec_private_key.h" | 10 #include "crypto/ec_private_key.h" |
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 for (ChannelIDMap::iterator it = channel_ids_.begin(); | 377 for (ChannelIDMap::iterator it = channel_ids_.begin(); |
378 it != channel_ids_.end(); ++it) | 378 it != channel_ids_.end(); ++it) |
379 channel_id_list->push_back(*it->second); | 379 channel_id_list->push_back(*it->second); |
380 } | 380 } |
381 | 381 |
382 void DefaultChannelIDStore::EnqueueTask(scoped_ptr<Task> task) { | 382 void DefaultChannelIDStore::EnqueueTask(scoped_ptr<Task> task) { |
383 DCHECK(CalledOnValidThread()); | 383 DCHECK(CalledOnValidThread()); |
384 DCHECK(!loaded_); | 384 DCHECK(!loaded_); |
385 if (waiting_tasks_.empty()) | 385 if (waiting_tasks_.empty()) |
386 waiting_tasks_start_time_ = base::TimeTicks::Now(); | 386 waiting_tasks_start_time_ = base::TimeTicks::Now(); |
387 waiting_tasks_.push_back(task.release()); | 387 waiting_tasks_.push_back(task.Pass()); |
388 } | 388 } |
389 | 389 |
390 void DefaultChannelIDStore::RunOrEnqueueTask(scoped_ptr<Task> task) { | 390 void DefaultChannelIDStore::RunOrEnqueueTask(scoped_ptr<Task> task) { |
391 DCHECK(CalledOnValidThread()); | 391 DCHECK(CalledOnValidThread()); |
392 InitIfNecessary(); | 392 InitIfNecessary(); |
393 | 393 |
394 if (!loaded_) { | 394 if (!loaded_) { |
395 EnqueueTask(task.Pass()); | 395 EnqueueTask(task.Pass()); |
396 return; | 396 return; |
397 } | 397 } |
(...skipping 26 matching lines...) Expand all Loading... |
424 store_->AddChannelID(*(channel_id.get())); | 424 store_->AddChannelID(*(channel_id.get())); |
425 const std::string& server_identifier = channel_id->server_identifier(); | 425 const std::string& server_identifier = channel_id->server_identifier(); |
426 channel_ids_[server_identifier] = channel_id.release(); | 426 channel_ids_[server_identifier] = channel_id.release(); |
427 } | 427 } |
428 | 428 |
429 DefaultChannelIDStore::PersistentStore::PersistentStore() {} | 429 DefaultChannelIDStore::PersistentStore::PersistentStore() {} |
430 | 430 |
431 DefaultChannelIDStore::PersistentStore::~PersistentStore() {} | 431 DefaultChannelIDStore::PersistentStore::~PersistentStore() {} |
432 | 432 |
433 } // namespace net | 433 } // namespace net |
OLD | NEW |