fix: don't expose view APIs when not enabled (#14321)
This commit is contained in:
parent
9237d40e09
commit
ff539c1d61
2 changed files with 21 additions and 5 deletions
|
@ -39,6 +39,14 @@ bool IsFakeLocationProviderEnabled() {
|
|||
#endif
|
||||
}
|
||||
|
||||
bool IsViewApiEnabled() {
|
||||
#if defined(ENABLE_VIEW_API)
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
void Initialize(v8::Local<v8::Object> exports,
|
||||
v8::Local<v8::Value> unused,
|
||||
v8::Local<v8::Context> context,
|
||||
|
@ -49,6 +57,7 @@ void Initialize(v8::Local<v8::Object> exports,
|
|||
dict.SetMethod("isPDFViewerEnabled", &IsPDFViewerEnabled);
|
||||
dict.SetMethod("isFakeLocationProviderEnabled",
|
||||
&IsFakeLocationProviderEnabled);
|
||||
dict.SetMethod("isViewApiEnabled", &IsViewApiEnabled);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue