OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "config.h" | 5 #include "config.h" |
6 #include "core/experiments/Experiments.h" | 6 #include "core/experiments/Experiments.h" |
7 | 7 |
8 #include "core/dom/ElementTraversal.h" | 8 #include "core/dom/ElementTraversal.h" |
9 #include "core/dom/ExceptionCode.h" | 9 #include "core/dom/ExceptionCode.h" |
10 #include "core/html/HTMLHeadElement.h" | 10 #include "core/html/HTMLHeadElement.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 } | 68 } |
69 | 69 |
70 // Experiments are only enabled for secure origins | 70 // Experiments are only enabled for secure origins |
71 if (!executionContext->isSecureContext(errorMessage)) { | 71 if (!executionContext->isSecureContext(errorMessage)) { |
72 return false; | 72 return false; |
73 } | 73 } |
74 | 74 |
75 return hasValidAPIKey(executionContext, apiName, errorMessage); | 75 return hasValidAPIKey(executionContext, apiName, errorMessage); |
76 } | 76 } |
77 | 77 |
| 78 bool Experiments::isApiEnabledWithoutMessage(ExecutionContext* executionContext,
const String& apiName) |
| 79 { |
| 80 String errorMessage; |
| 81 return isApiEnabled(executionContext, apiName, errorMessage); |
| 82 } |
| 83 |
78 DOMException* Experiments::createApiDisabledException(const String& apiName) | 84 DOMException* Experiments::createApiDisabledException(const String& apiName) |
79 { | 85 { |
80 return DOMException::create(NotSupportedError, getDisabledMessage(apiName)); | 86 return DOMException::create(NotSupportedError, getDisabledMessage(apiName)); |
81 } | 87 } |
82 | 88 |
83 } // namespace blink | 89 } // namespace blink |
OLD | NEW |