mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Backing out df43ad6d04c1 due to incorrect commit messages
This commit is contained in:
parent
6184ec9c96
commit
efa61e474d
@ -12,7 +12,6 @@
|
||||
#include "nsEventDispatcher.h"
|
||||
#include "nsDOMEvent.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsThreadUtils.h"
|
||||
|
||||
using mozilla::dom::DOMRequest;
|
||||
using mozilla::dom::DOMRequestService;
|
||||
@ -223,79 +222,3 @@ DOMRequestService::FireError(nsIDOMDOMRequest* aRequest,
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
class FireSuccessAsyncTask : public nsRunnable
|
||||
{
|
||||
public:
|
||||
FireSuccessAsyncTask(nsIDOMDOMRequest* aRequest,
|
||||
const jsval& aResult) :
|
||||
mReq(aRequest),
|
||||
mResult(aResult)
|
||||
{
|
||||
JSContext* cx = mReq->GetJSContextForEventHandlers();
|
||||
JS_AddValueRoot(jsc, &mResult);
|
||||
}
|
||||
|
||||
nsresult
|
||||
Run()
|
||||
{
|
||||
static_cast<DOMRequest*>(mReq)->FireSuccess(mResult);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
~FireSuccessAsyncTask()
|
||||
{
|
||||
JSContext* cx = mReq->GetJSContextForEventHandlers();
|
||||
JS_RemoveValueRoot(jsc, &mResult);
|
||||
}
|
||||
private:
|
||||
nsIDOMDOMRequest* mReq;
|
||||
jsval mResult;
|
||||
};
|
||||
|
||||
class FireErrorAsyncTask : public nsRunnable
|
||||
{
|
||||
public:
|
||||
FireErrorAsyncTask(nsIDOMDOMRequest* aRequest,
|
||||
const nsAString& aError) :
|
||||
mReq(aRequest),
|
||||
mError(aError)
|
||||
{
|
||||
}
|
||||
|
||||
nsresult
|
||||
Run()
|
||||
{
|
||||
static_cast<DOMRequest*>(mReq)->FireError(mError);
|
||||
return NS_OK;
|
||||
}
|
||||
private:
|
||||
nsIDOMDOMRequest* mReq;
|
||||
nsString mError;
|
||||
};
|
||||
|
||||
NS_IMETHODIMP
|
||||
DOMRequestService::FireSuccessAsync(nsIDOMDOMRequest* aRequest,
|
||||
const jsval& aResult)
|
||||
{
|
||||
NS_ENSURE_STATE(aRequest);
|
||||
nsCOMPtr<nsIRunnable> asyncTask = new FireSuccessAsyncTask(aRequest, aResult);
|
||||
if (NS_FAILED(NS_DispatchToMainThread(asyncTask))) {
|
||||
NS_WARNING("Failed to dispatch to main thread!");
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
DOMRequestService::FireErrorAsync(nsIDOMDOMRequest* aRequest,
|
||||
const nsAString& aError)
|
||||
{
|
||||
NS_ENSURE_STATE(aRequest);
|
||||
nsCOMPtr<nsIRunnable> asyncTask = new FireErrorAsyncTask(aRequest, aError);
|
||||
if (NS_FAILED(NS_DispatchToMainThread(asyncTask))) {
|
||||
NS_WARNING("Failed to dispatch to main thread!");
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -21,13 +21,11 @@ interface nsIDOMDOMRequest : nsIDOMEventTarget
|
||||
attribute nsIDOMEventListener onerror;
|
||||
};
|
||||
|
||||
[scriptable, builtinclass, uuid(10996de9-e6f6-4058-97bd-45f1fe065eb5)]
|
||||
[scriptable, builtinclass, uuid(eebcdf29-f8fa-4c36-bbc7-2146b1cbaf7b)]
|
||||
interface nsIDOMRequestService : nsISupports
|
||||
{
|
||||
nsIDOMDOMRequest createRequest(in nsIDOMWindow window);
|
||||
|
||||
void fireSuccess(in nsIDOMDOMRequest request, in jsval result);
|
||||
void fireError(in nsIDOMDOMRequest request, in DOMString error);
|
||||
void fireSuccessAsync(in nsIDOMDOMRequest request, in jsval result);
|
||||
void fireErrorAsync(in nsIDOMDOMRequest request, in DOMString error);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user