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

Unified Diff: net/quic/crypto/source_address_token.cc

Issue 992733002: Remove //net (except for Android test stuff) and sdch (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/crypto/source_address_token.h ('k') | net/quic/crypto/strike_register.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/crypto/source_address_token.cc
diff --git a/net/quic/crypto/source_address_token.cc b/net/quic/crypto/source_address_token.cc
deleted file mode 100644
index dcb7267e15c3c6cf736360532bf0571599b7375c..0000000000000000000000000000000000000000
--- a/net/quic/crypto/source_address_token.cc
+++ /dev/null
@@ -1,85 +0,0 @@
-// Copyright (c) 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "net/quic/crypto/source_address_token.h"
-
-#include "base/strings/string_number_conversions.h"
-#include "base/strings/string_split.h"
-
-using std::string;
-
-namespace net {
-
-SourceAddressToken::SourceAddressToken()
- : has_cached_network_parameters_(false) {
-}
-
-SourceAddressToken::~SourceAddressToken() {
-}
-
-string SourceAddressToken::SerializeAsString() const {
- string out;
- out.push_back(static_cast<char>(ip_.size()));
- out.append(ip_);
- string time_str = base::Int64ToString(timestamp_);
- out.push_back(static_cast<char>(time_str.size()));
- out.append(time_str);
- // TODO(rtenneti): Implement serialization of optional CachedNetworkParameters
- // when they are used.
- return out;
-}
-
-bool SourceAddressToken::ParseFromArray(const char* plaintext,
- size_t plaintext_length) {
- if (plaintext_length == 0) {
- return false;
- }
- size_t ip_len = plaintext[0];
- if (plaintext_length <= 1 + ip_len) {
- return false;
- }
- size_t time_len = plaintext[1 + ip_len];
- if (plaintext_length != 1 + ip_len + 1 + time_len) {
- return false;
- }
-
- string time_str(&plaintext[1 + ip_len + 1], time_len);
- int64 timestamp;
- if (!base::StringToInt64(time_str, &timestamp)) {
- return false;
- }
-
- ip_.assign(&plaintext[1], ip_len);
- timestamp_ = timestamp;
-
- // TODO(rtenneti): Implement parsing of optional CachedNetworkParameters when
- // they are used.
- return true;
-}
-
-SourceAddressTokens::SourceAddressTokens() {
-}
-
-SourceAddressTokens::~SourceAddressTokens() {
- STLDeleteElements(&tokens_);
-}
-
-string SourceAddressTokens::SerializeAsString() const {
- string out;
-
- for (size_t i = 0; i < tokens_size(); i++) {
- const SourceAddressToken& source_address_token = tokens(i);
- out.append(source_address_token.SerializeAsString());
- }
- return out;
-}
-
-bool SourceAddressTokens::ParseFromArray(const char* plaintext,
- size_t plaintext_length) {
- // TODO(rtenneti): Implement parsing of SourceAddressTokens when they are
- // used.
- return true;
-}
-
-} // namespace net
« no previous file with comments | « net/quic/crypto/source_address_token.h ('k') | net/quic/crypto/strike_register.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698