Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Side by Side Diff: net/quic/crypto/source_address_token.h

Issue 14411004: Land Recent QUIC Changes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use CONFIG_VERSION insteaf of VERSION Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef NET_QUIC_CRYPTO_SOURCE_ADDRESS_TOKEN_H_
6 #define NET_QUIC_CRYPTO_SOURCE_ADDRESS_TOKEN_H_
7
8 #include <string>
9
10 #include "base/basictypes.h"
11 #include "base/strings/string_piece.h"
12
13 namespace net {
14
15 // TODO(rtenneti): sync with server more rationally.
16 class SourceAddressToken {
17 public:
18 SourceAddressToken();
19 ~SourceAddressToken();
20
21 std::string SerializeAsString() const;
22
23 bool ParseFromArray(unsigned char* plaintext, size_t plaintext_length);
24
25 std::string ip() const {
26 return ip_;
27 }
28
29 int64 timestamp() const {
30 return timestamp_;
31 }
32
33 void set_ip(base::StringPiece ip) {
34 ip_ = ip.as_string();
35 }
36
37 void set_timestamp(int64 timestamp) {
38 timestamp_ = timestamp;
39 }
40
41 private:
42 std::string ip_;
43 int64 timestamp_;
44 };
45
46 } // namespace net
47
48 #endif // NET_QUIC_CRYPTO_SOURCE_ADDRESS_TOKEN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698