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

Unified Diff: content/common/origin_trials/trial_token_validator.h

Issue 2555333006: Deflake origin trial token validator tests (Closed)
Patch Set: Switch WrapUnique to MakeUnique Created 3 years, 4 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
Index: content/common/origin_trials/trial_token_validator.h
diff --git a/content/common/origin_trials/trial_token_validator.h b/content/common/origin_trials/trial_token_validator.h
index 9a8cce9f1bcda59272630037b66ece0d3dd608e2..f5afb87cfacd6619f6ccc5d2dad44b264bfbc1c5 100644
--- a/content/common/origin_trials/trial_token_validator.h
+++ b/content/common/origin_trials/trial_token_validator.h
@@ -10,6 +10,7 @@
#include <string>
#include <vector>
#include "base/strings/string_piece.h"
+#include "base/time/time.h"
#include "content/common/content_export.h"
#include "url/origin.h"
@@ -35,26 +36,31 @@ using FeatureToTokensMap = std::map<std::string /* feature_name */,
CONTENT_EXPORT blink::WebOriginTrialTokenStatus ValidateToken(
const std::string& token,
const url::Origin& origin,
- std::string* feature_name);
+ std::string* feature_name,
+ base::Time current_time);
CONTENT_EXPORT bool RequestEnablesFeature(const net::URLRequest* request,
- base::StringPiece feature_name);
+ base::StringPiece feature_name,
+ base::Time current_time);
CONTENT_EXPORT bool RequestEnablesFeature(
const GURL& request_url,
const net::HttpResponseHeaders* response_headers,
- base::StringPiece feature_name);
+ base::StringPiece feature_name,
+ base::Time current_time);
// Returns all valid tokens in |headers|.
CONTENT_EXPORT std::unique_ptr<FeatureToTokensMap> GetValidTokensFromHeaders(
const url::Origin& origin,
- const net::HttpResponseHeaders* headers);
+ const net::HttpResponseHeaders* headers,
+ base::Time current_time);
// Returns all valid tokens in |tokens|. This method is used to re-validate
// previously stored tokens.
CONTENT_EXPORT std::unique_ptr<FeatureToTokensMap> GetValidTokens(
const url::Origin& origin,
- const FeatureToTokensMap& tokens);
+ const FeatureToTokensMap& tokens,
+ base::Time current_time);
} // namespace TrialTokenValidator
« no previous file with comments | « content/browser/service_worker/service_worker_version.cc ('k') | content/common/origin_trials/trial_token_validator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698