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

Unified Diff: cloud_print/gcp20/prototype/x_privet_token.cc

Issue 1540213002: Switch to standard integer types in cloud_print/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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
Index: cloud_print/gcp20/prototype/x_privet_token.cc
diff --git a/cloud_print/gcp20/prototype/x_privet_token.cc b/cloud_print/gcp20/prototype/x_privet_token.cc
index 4093ccb297db301766bf61992ea77ed9dd16c6a6..d14d9a697200fc7c25e510d66132afacd9f54caa 100644
--- a/cloud_print/gcp20/prototype/x_privet_token.cc
+++ b/cloud_print/gcp20/prototype/x_privet_token.cc
@@ -4,6 +4,9 @@
#include "cloud_print/gcp20/prototype/x_privet_token.h"
+#include <stddef.h>
+#include <stdint.h>
+
#include "base/base64.h"
#include "base/format_macros.h"
#include "base/guid.h"
@@ -15,8 +18,8 @@
namespace {
const char kXPrivetTokenDelimeter = ':';
-const uint64 kTimeExpiration = 24*60*60; // in seconds
-const uint64 kTimeSecretRefresh = 24*60*60; // in seconds
+const uint64_t kTimeExpiration = 24 * 60 * 60; // in seconds
+const uint64_t kTimeSecretRefresh = 24 * 60 * 60; // in seconds
} // namespace
@@ -37,7 +40,7 @@ std::string XPrivetToken::GenerateXToken() {
if (Time::Now() > last_gen_time_ + TimeDelta::FromSeconds(kTimeSecretRefresh))
UpdateSecret();
- return GenerateXTokenWithTime(static_cast<uint64>(Time::Now().ToTimeT()));
+ return GenerateXTokenWithTime(static_cast<uint64_t>(Time::Now().ToTimeT()));
}
bool XPrivetToken::CheckValidXToken(const std::string& token) const {
@@ -46,7 +49,7 @@ bool XPrivetToken::CheckValidXToken(const std::string& token) const {
return false;
std::string issue_time_str = token.substr(delimeter_pos + 1);
- uint64 issue_time;
+ uint64_t issue_time;
if (!base::StringToUint64(issue_time_str, &issue_time))
return false;
@@ -57,7 +60,7 @@ bool XPrivetToken::CheckValidXToken(const std::string& token) const {
TimeDelta::FromSeconds(kTimeExpiration);
}
-std::string XPrivetToken::GenerateXTokenWithTime(uint64 issue_time) const {
+std::string XPrivetToken::GenerateXTokenWithTime(uint64_t issue_time) const {
std::string result;
std::string issue_time_str = base::StringPrintf("%" PRIu64, issue_time);
std::string hash = base::SHA1HashString(secret_ +
« no previous file with comments | « cloud_print/gcp20/prototype/x_privet_token.h ('k') | cloud_print/gcp20/prototype/x_privet_token_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698