Lots of random cleanups, mostly for native_theme_win.cc:
[chromium-blink-merge.git] / net / quic / crypto / source_address_token.h
blobfbb50b1028e5b809cd61abf0c46f7d12c4bf92f2
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.
5 #ifndef NET_QUIC_CRYPTO_SOURCE_ADDRESS_TOKEN_H_
6 #define NET_QUIC_CRYPTO_SOURCE_ADDRESS_TOKEN_H_
8 #include <string>
10 #include "base/basictypes.h"
11 #include "base/strings/string_piece.h"
13 namespace net {
15 // TODO(rtenneti): sync with server more rationally.
16 class SourceAddressToken {
17 public:
18 SourceAddressToken();
19 ~SourceAddressToken();
21 std::string SerializeAsString() const;
23 bool ParseFromArray(const char* plaintext, size_t plaintext_length);
25 std::string ip() const {
26 return ip_;
29 int64 timestamp() const {
30 return timestamp_;
33 void set_ip(base::StringPiece ip) {
34 ip_ = ip.as_string();
37 void set_timestamp(int64 timestamp) {
38 timestamp_ = timestamp;
41 private:
42 std::string ip_;
43 int64 timestamp_;
45 DISALLOW_COPY_AND_ASSIGN(SourceAddressToken);
48 } // namespace net
50 #endif // NET_QUIC_CRYPTO_SOURCE_ADDRESS_TOKEN_H_