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

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

Issue 266243004: Clang format slam. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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
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 #ifndef NET_QUIC_CRYPTO_SOURCE_ADDRESS_TOKEN_H_ 5 #ifndef NET_QUIC_CRYPTO_SOURCE_ADDRESS_TOKEN_H_
6 #define NET_QUIC_CRYPTO_SOURCE_ADDRESS_TOKEN_H_ 6 #define NET_QUIC_CRYPTO_SOURCE_ADDRESS_TOKEN_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/strings/string_piece.h" 11 #include "base/strings/string_piece.h"
12 12
13 namespace net { 13 namespace net {
14 14
15 // TODO(rtenneti): sync with server more rationally. 15 // TODO(rtenneti): sync with server more rationally.
16 class SourceAddressToken { 16 class SourceAddressToken {
17 public: 17 public:
18 SourceAddressToken(); 18 SourceAddressToken();
19 ~SourceAddressToken(); 19 ~SourceAddressToken();
20 20
21 std::string SerializeAsString() const; 21 std::string SerializeAsString() const;
22 22
23 bool ParseFromArray(const char* plaintext, size_t plaintext_length); 23 bool ParseFromArray(const char* plaintext, size_t plaintext_length);
24 24
25 std::string ip() const { 25 std::string ip() const { return ip_; }
26 return ip_;
27 }
28 26
29 int64 timestamp() const { 27 int64 timestamp() const { return timestamp_; }
30 return timestamp_;
31 }
32 28
33 void set_ip(base::StringPiece ip) { 29 void set_ip(base::StringPiece ip) { ip_ = ip.as_string(); }
34 ip_ = ip.as_string();
35 }
36 30
37 void set_timestamp(int64 timestamp) { 31 void set_timestamp(int64 timestamp) { timestamp_ = timestamp; }
38 timestamp_ = timestamp;
39 }
40 32
41 private: 33 private:
42 std::string ip_; 34 std::string ip_;
43 int64 timestamp_; 35 int64 timestamp_;
44 36
45 DISALLOW_COPY_AND_ASSIGN(SourceAddressToken); 37 DISALLOW_COPY_AND_ASSIGN(SourceAddressToken);
46 }; 38 };
47 39
48 } // namespace net 40 } // namespace net
49 41
50 #endif // NET_QUIC_CRYPTO_SOURCE_ADDRESS_TOKEN_H_ 42 #endif // NET_QUIC_CRYPTO_SOURCE_ADDRESS_TOKEN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698