OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/source_address_token.h" | 5 #include "net/quic/crypto/source_address_token.h" |
6 | 6 |
7 #include "base/strings/string_number_conversions.h" | 7 #include "base/strings/string_number_conversions.h" |
8 #include "base/strings/string_split.h" | 8 #include "base/strings/string_split.h" |
9 | 9 |
10 using std::string; | 10 using std::string; |
11 | 11 |
12 namespace net { | 12 namespace net { |
13 | 13 |
14 SourceAddressToken::SourceAddressToken() | 14 SourceAddressToken::SourceAddressToken() |
15 : has_cached_network_parameters_(false) { | 15 : timestamp_(0), has_cached_network_parameters_(false) { |
16 } | 16 } |
17 | 17 |
18 SourceAddressToken::~SourceAddressToken() { | 18 SourceAddressToken::~SourceAddressToken() { |
19 } | 19 } |
20 | 20 |
21 string SourceAddressToken::SerializeAsString() const { | 21 string SourceAddressToken::SerializeAsString() const { |
22 string out; | 22 string out; |
23 out.push_back(static_cast<char>(ip_.size())); | 23 out.push_back(static_cast<char>(ip_.size())); |
24 out.append(ip_); | 24 out.append(ip_); |
25 string time_str = base::Int64ToString(timestamp_); | 25 string time_str = base::Int64ToString(timestamp_); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 } | 76 } |
77 | 77 |
78 bool SourceAddressTokens::ParseFromArray(const char* plaintext, | 78 bool SourceAddressTokens::ParseFromArray(const char* plaintext, |
79 size_t plaintext_length) { | 79 size_t plaintext_length) { |
80 // TODO(rtenneti): Implement parsing of SourceAddressTokens when they are | 80 // TODO(rtenneti): Implement parsing of SourceAddressTokens when they are |
81 // used. | 81 // used. |
82 return true; | 82 return true; |
83 } | 83 } |
84 | 84 |
85 } // namespace net | 85 } // namespace net |
OLD | NEW |