Index: net/ssl/channel_id_store.cc |
diff --git a/net/ssl/channel_id_store.cc b/net/ssl/channel_id_store.cc |
index 930ef8f4ed993d038bb390524704d2c3533e10b1..e1835ff1546a645d22ef3226a6e099b8800ad57a 100644 |
--- a/net/ssl/channel_id_store.cc |
+++ b/net/ssl/channel_id_store.cc |
@@ -2,6 +2,7 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
+#include "crypto/ec_private_key.h" |
#include "net/ssl/channel_id_store.h" |
namespace net { |
@@ -9,25 +10,37 @@ namespace net { |
ChannelIDStore::ChannelID::ChannelID() { |
} |
-ChannelIDStore::ChannelID::ChannelID( |
- const std::string& server_identifier, |
- base::Time creation_time, |
- base::Time expiration_time, |
- const std::string& private_key, |
- const std::string& cert) |
+ChannelIDStore::ChannelID::ChannelID(const std::string& server_identifier, |
+ base::Time creation_time, |
+ scoped_ptr<crypto::ECPrivateKey> key) |
: server_identifier_(server_identifier), |
creation_time_(creation_time), |
- expiration_time_(expiration_time), |
- private_key_(private_key), |
- cert_(cert) {} |
+ key_(key.Pass()) { |
+} |
+ |
+ChannelIDStore::ChannelID::ChannelID(const ChannelID& other) |
+ : server_identifier_(other.server_identifier_), |
+ creation_time_(other.creation_time_), |
+ key_(other.key_ ? other.key_->Copy() : nullptr) { |
+} |
+ |
+ChannelIDStore::ChannelID& ChannelIDStore::ChannelID::operator=( |
+ const ChannelID& other) { |
+ if (&other == this) |
+ return *this; |
+ server_identifier_ = other.server_identifier_; |
+ creation_time_ = other.creation_time_; |
+ if (other.key_) |
+ key_.reset(other.key_->Copy()); |
+ return *this; |
+} |
ChannelIDStore::ChannelID::~ChannelID() {} |
void ChannelIDStore::InitializeFrom(const ChannelIDList& list) { |
for (ChannelIDList::const_iterator i = list.begin(); i != list.end(); |
++i) { |
- SetChannelID(i->server_identifier(), i->creation_time(), |
- i->expiration_time(), i->private_key(), i->cert()); |
+ SetChannelID(scoped_ptr<ChannelID>(new ChannelID(*i))); |
} |
} |