OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef Experiments_h |
| 6 #define Experiments_h |
| 7 |
| 8 #include "core/CoreExport.h" |
| 9 #include "core/dom/DOMException.h" |
| 10 #include "core/dom/ExecutionContext.h" |
| 11 #include "wtf/text/WTFString.h" |
| 12 |
| 13 namespace blink { |
| 14 |
| 15 // The Experimental Framework (EF) provides limited access to experimental APIs, |
| 16 // on a per-origin basis. This class provides an interface to API implementers, |
| 17 // for checking if the experimental API should be enabled for the current |
| 18 // context. |
| 19 // |
| 20 // Experimental APIs are defined by string names, provided by the implementers. |
| 21 // The EF code does not maintain an enum or constant list for experiment names. |
| 22 // Instead, the EF validates the name provided by the API implementation against |
| 23 // any provided API keys. |
| 24 // TODO(chasej): Link to documentation, or provide more detail on keys, .etc |
| 25 class CORE_EXPORT Experiments { |
| 26 public: |
| 27 static bool isApiEnabled(ExecutionContext*, const String& apiName); |
| 28 // Creates a NotSupportedError exception with a message explaining to |
| 29 // external developers why the API is disabled and how to join API |
| 30 // experiments. |
| 31 static DOMException* createApiDisabledException(const String& apiName); |
| 32 |
| 33 private: |
| 34 explicit Experiments(); |
| 35 }; |
| 36 |
| 37 } // namespace blink |
| 38 |
| 39 #endif // Experiments_h |
OLD | NEW |