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

Unified Diff: content/renderer/origin_trials/trial_token_validator.cc

Issue 1742053002: Move trial token code to content/common. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 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
Index: content/renderer/origin_trials/trial_token_validator.cc
diff --git a/content/renderer/origin_trials/trial_token_validator.cc b/content/renderer/origin_trials/trial_token_validator.cc
deleted file mode 100644
index f34afd1a70fcedd4310ea809978a3a6d8f20153d..0000000000000000000000000000000000000000
--- a/content/renderer/origin_trials/trial_token_validator.cc
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright 2016 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 "content/renderer/origin_trials/trial_token_validator.h"
-
-#include "base/time/time.h"
-#include "content/public/common/content_client.h"
-#include "content/public/renderer/content_renderer_client.h"
-#include "content/renderer/origin_trials/trial_token.h"
-
-namespace content {
-
-TrialTokenValidator::TrialTokenValidator() {}
-TrialTokenValidator::~TrialTokenValidator() {}
-
-bool TrialTokenValidator::validateToken(const blink::WebString& token,
- const blink::WebSecurityOrigin& origin,
- const blink::WebString& featureName) {
- scoped_ptr<TrialToken> trial_token = TrialToken::Parse(token.utf8());
-
- ContentClient* content_client = GetContentClient();
- CHECK(content_client);
-
- base::StringPiece public_key =
- content_client->renderer()->GetOriginTrialPublicKey();
-
- return !public_key.empty() && trial_token &&
- trial_token->IsAppropriate(origin, featureName.utf8()) &&
- trial_token->IsValid(base::Time::Now(), public_key);
-}
-
-} // namespace content

Powered by Google App Engine
This is Rietveld 408576698