mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1164310, part 1 - Make the code for bypassing mobile security checks more general so that it can be used on non-mobile. r=baku
This commit is contained in:
parent
12621f5d41
commit
8e3f9b97ee
@ -36,8 +36,8 @@ DeviceStorageFileSystem::DeviceStorageFileSystem(
|
||||
mString.Append('-');
|
||||
mString.Append(mStorageName);
|
||||
|
||||
mIsTesting =
|
||||
mozilla::Preferences::GetBool("device.storage.prompt.testing", false);
|
||||
mRequiresPermissionChecks =
|
||||
!mozilla::Preferences::GetBool("device.storage.prompt.testing", false);
|
||||
|
||||
// Get the permission name required to access the file system.
|
||||
nsresult rv =
|
||||
|
@ -42,7 +42,7 @@ FileSystemBase::FromString(const nsAString& aString)
|
||||
|
||||
FileSystemBase::FileSystemBase()
|
||||
: mShutdown(false)
|
||||
, mIsTesting(false)
|
||||
, mRequiresPermissionChecks(true)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -85,9 +85,9 @@ public:
|
||||
}
|
||||
|
||||
bool
|
||||
IsTesting() const
|
||||
RequiresPermissionChecks() const
|
||||
{
|
||||
return mIsTesting;
|
||||
return mRequiresPermissionChecks;
|
||||
}
|
||||
protected:
|
||||
virtual ~FileSystemBase();
|
||||
@ -100,7 +100,7 @@ protected:
|
||||
// The permission name required to access the file system.
|
||||
nsCString mPermission;
|
||||
|
||||
bool mIsTesting;
|
||||
bool mRequiresPermissionChecks;
|
||||
};
|
||||
|
||||
} // namespace dom
|
||||
|
@ -122,7 +122,7 @@ FileSystemPermissionRequest::Run()
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
if (filesystem->IsTesting()) {
|
||||
if (!filesystem->RequiresPermissionChecks()) {
|
||||
Allow(JS::UndefinedHandleValue);
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ FileSystemRequestParent::Dispatch(ContentParent* aParent,
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!mFileSystem->IsTesting()) {
|
||||
if (mFileSystem->RequiresPermissionChecks()) {
|
||||
// Check the content process permission.
|
||||
|
||||
nsCString access;
|
||||
|
Loading…
Reference in New Issue
Block a user