mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 791816 - Use a different error string when we may overwrite a file location. r=sicking
This commit is contained in:
parent
96917e737c
commit
8660aa99c4
@ -248,6 +248,14 @@ DeviceStorageRequestParent::WriteFileEvent::CancelableRun()
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
bool check = false;
|
||||
mFile->mFile->Exists(&check);
|
||||
if (check) {
|
||||
nsCOMPtr<PostErrorEvent> event = new PostErrorEvent(mParent, POST_ERROR_EVENT_FILE_EXISTS);
|
||||
NS_DispatchToMainThread(event);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult rv = mFile->Write(mInputStream);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
|
@ -1285,6 +1285,16 @@ public:
|
||||
nsCOMPtr<nsIInputStream> stream;
|
||||
mBlob->GetInternalStream(getter_AddRefs(stream));
|
||||
|
||||
bool check = false;
|
||||
mFile->mFile->Exists(&check);
|
||||
if (check) {
|
||||
nsCOMPtr<PostErrorEvent> event = new PostErrorEvent(mRequest,
|
||||
POST_ERROR_EVENT_FILE_EXISTS,
|
||||
mFile);
|
||||
NS_DispatchToMainThread(event);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult rv = mFile->Write(stream);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
|
@ -32,6 +32,7 @@ class nsPIDOMWindow;
|
||||
|
||||
#include "DeviceStorageRequestChild.h"
|
||||
|
||||
#define POST_ERROR_EVENT_FILE_EXISTS "File already exists"
|
||||
#define POST_ERROR_EVENT_FILE_DOES_NOT_EXIST "File location doesn't exists"
|
||||
#define POST_ERROR_EVENT_FILE_NOT_ENUMERABLE "File location is not enumerable"
|
||||
#define POST_ERROR_EVENT_PERMISSION_DENIED "Permission Denied"
|
||||
|
Loading…
Reference in New Issue
Block a user