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

Side by Side Diff: third_party/WebKit/Source/core/experiments/Experiments.cpp

Issue 1531443003: [bindings] Implement an ExperimentEnabled IDL extended attribute. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove 'return undefined and print a message' on constructors. Created 5 years 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 unified diff | Download patch
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698