| OLD | NEW |
| (Empty) |
| 1 // Copyright 2016 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 WebApiKeyValidator_h | |
| 6 #define WebApiKeyValidator_h | |
| 7 | |
| 8 #include "public/platform/WebCallbacks.h" | |
| 9 #include "public/platform/WebString.h" | |
| 10 | |
| 11 namespace blink { | |
| 12 | |
| 13 // This interface abstracts the task of validating a key for an experimental | |
| 14 // API. Experimental APIs can be turned on and off at runtime for a specific | |
| 15 // renderer, depending on the presence of a valid key in the document's head. | |
| 16 // The details of determining whether a key is valid for a particular API is | |
| 17 // left up to the embedder. An implementation can effectively disable all API | |
| 18 // experiments by simply returning false in all cases. | |
| 19 // | |
| 20 // More documentation on the design of the experimental framework is at | |
| 21 // https://docs.google.com/document/d/1qVP2CK1lbfmtIJRIm6nwuEFFhGhYbtThLQPo3CSTt
mg | |
| 22 | |
| 23 class WebApiKeyValidator { | |
| 24 public: | |
| 25 virtual ~WebApiKeyValidator() {} | |
| 26 | |
| 27 // Returns true if the given API key is valid for the specified origin and | |
| 28 // API name. | |
| 29 virtual bool validateApiKey(const WebString& apiKey, const WebString& origin
, const WebString& apiName) = 0; | |
| 30 }; | |
| 31 | |
| 32 } // namespace blink | |
| 33 | |
| 34 #endif // WebApiKeyValidator_h | |
| OLD | NEW |