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

Unified Diff: extensions/renderer/script_context.h

Issue 2494653005: Support API aliases (Closed)
Patch Set: . Created 4 years, 1 month 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
« no previous file with comments | « extensions/renderer/native_extension_bindings_system.cc ('k') | extensions/renderer/script_context.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/script_context.h
diff --git a/extensions/renderer/script_context.h b/extensions/renderer/script_context.h
index 197ed3a180b213ec5264e5022c6d4704934bc609..fad1dc22037d784ae3b5011c4398a7e55ff6184e 100644
--- a/extensions/renderer/script_context.h
+++ b/extensions/renderer/script_context.h
@@ -33,6 +33,7 @@ class RenderFrame;
}
namespace extensions {
+enum class CheckAliasStatus;
class Extension;
// Extensions wrapper for a v8::Context.
@@ -126,6 +127,11 @@ class ScriptContext : public RequestSender::Source {
// Returns the availability of the API |api_name|.
Feature::Availability GetAvailability(const std::string& api_name);
+ // Returns the availability of the API |api_name|.
+ // |check_alias| Whether API that has an alias that is available should be
+ // considered available (even if the API itself is not available).
+ Feature::Availability GetAvailability(const std::string& api_name,
+ CheckAliasStatus check_alias);
// Returns a string description of the type of context this is.
std::string GetContextTypeDescription() const;
@@ -152,10 +158,12 @@ class ScriptContext : public RequestSender::Source {
// TODO(kalman): Make this a constructor parameter (as an origin).
void set_url(const GURL& url) { url_ = url; }
- // Returns whether the API |api| or any part of the API could be
- // available in this context without taking into account the context's
- // extension.
- bool IsAnyFeatureAvailableToContext(const extensions::Feature& api);
+ // Returns whether the API |api| or any part of the API could be available in
+ // this context without taking into account the context's extension.
+ // |check_alias| Whether the API should be considered available if it has an
+ // alias that is available.
+ bool IsAnyFeatureAvailableToContext(const extensions::Feature& api,
+ CheckAliasStatus check_alias);
// Utility to get the URL we will match against for a frame. If the frame has
// committed, this is the commited URL. Otherwise it is the provisional URL.
« no previous file with comments | « extensions/renderer/native_extension_bindings_system.cc ('k') | extensions/renderer/script_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698