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

Unified Diff: third_party/WebKit/Source/core/origin_trials/OriginTrialContext.h

Issue 1743623002: [Experimental Framework] Make the OriginTrialContext a member of ExecutionContext (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use WeakPersistent for Oilpan Created 4 years, 10 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: third_party/WebKit/Source/core/origin_trials/OriginTrialContext.h
diff --git a/third_party/WebKit/Source/core/origin_trials/OriginTrialContext.h b/third_party/WebKit/Source/core/origin_trials/OriginTrialContext.h
index 579307defa0e12e2701ddab715efa0f88733940a..1648f509422de64a654c988ce962c02af2472bd4 100644
--- a/third_party/WebKit/Source/core/origin_trials/OriginTrialContext.h
+++ b/third_party/WebKit/Source/core/origin_trials/OriginTrialContext.h
@@ -6,12 +6,12 @@
#define OriginTrialContext_h
#include "core/CoreExport.h"
-#include "core/dom/DOMException.h"
-#include "core/dom/ExecutionContext.h"
-#include "wtf/text/WTFString.h"
+#include "wtf/Forward.h"
+#include "wtf/Vector.h"
namespace blink {
+class ExecutionContext;
class WebTrialTokenValidator;
// The Experimental Framework (EF) provides limited access to experimental
@@ -34,17 +34,27 @@ class WebTrialTokenValidator;
//
// TODO(chasej): Link to documentation, or provide more detail on keys, .etc
class CORE_EXPORT OriginTrialContext {
+public:
+ static const char kTrialMetaTagName[];
+
+protected:
+ OriginTrialContext();
+ virtual ~OriginTrialContext() = default;
+
+ virtual ExecutionContext* executionContext() = 0;
+ virtual Vector<String> getTokens() = 0;
+
private:
friend class OriginTrialContextTest;
friend class OriginTrials;
- OriginTrialContext();
-
// Returns true if the feature should be considered enabled for the current
// execution context. This method usually makes use of the token validator
// object in the platform, but this may be overridden if a custom validator
// is required (for testing, for instance).
- static bool isFeatureEnabled(ExecutionContext*, const String& featureName, String* errorMessage, WebTrialTokenValidator* = nullptr);
+ bool isFeatureEnabled(const String& featureName, String* errorMessage, WebTrialTokenValidator* = nullptr);
+
+ bool hasValidToken(Vector<String> tokens, const String& featureName, String* errorMessage, WebTrialTokenValidator*);
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698