Remove PlatformFile from profile_browsertest
[chromium-blink-merge.git] / net / quic / crypto / source_address_token.h
blob8c509651e28512e132fd489c910ee992c74d0e8f
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_;
46 } // namespace net
48 #endif // NET_QUIC_CRYPTO_SOURCE_ADDRESS_TOKEN_H_