summaryrefslogtreecommitdiffstats
path: root/dom/url/URL.cpp
diff options
context:
space:
mode:
authorMoonchild <mcwerewolf@gmail.com>2018-07-05 22:22:47 +0200
committerGitHub <noreply@github.com>2018-07-05 22:22:47 +0200
commitc3fe7f59c8b6c1a23f5ae85f0697470fad560d68 (patch)
tree93fb783c7d463225be63f76102bddec19965bc93 /dom/url/URL.cpp
parent06ccf0f73ade5b436d2e7e00f81db7aebf7960cf (diff)
parenta80267e9e88b3dcebf7f8f1f6f10931a99ddf2ca (diff)
downloadUXP-c3fe7f59c8b6c1a23f5ae85f0697470fad560d68.tar
UXP-c3fe7f59c8b6c1a23f5ae85f0697470fad560d68.tar.gz
UXP-c3fe7f59c8b6c1a23f5ae85f0697470fad560d68.tar.lz
UXP-c3fe7f59c8b6c1a23f5ae85f0697470fad560d68.tar.xz
UXP-c3fe7f59c8b6c1a23f5ae85f0697470fad560d68.zip
Merge pull request #597 from janekptacijarabaci/dom_workers_terminate_1
Sync event loops in workers should be created only if compatible with the worker shutdown status
Diffstat (limited to 'dom/url/URL.cpp')
-rw-r--r--dom/url/URL.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/dom/url/URL.cpp b/dom/url/URL.cpp
index c8724c359..04f5ec137 100644
--- a/dom/url/URL.cpp
+++ b/dom/url/URL.cpp
@@ -1113,6 +1113,12 @@ public:
return true;
}
+ void
+ Dispatch(ErrorResult& aRv)
+ {
+ WorkerMainThreadRunnable::Dispatch(Terminating, aRv);
+ }
+
private:
nsAString& mValue;
GetterType mType;
@@ -1213,6 +1219,12 @@ public:
return mFailed;
}
+ void
+ Dispatch(ErrorResult& aRv)
+ {
+ WorkerMainThreadRunnable::Dispatch(Terminating, aRv);
+ }
+
private:
const nsString mValue;
SetterType mType;
@@ -1224,7 +1236,7 @@ already_AddRefed<URLWorker>
FinishConstructor(JSContext* aCx, WorkerPrivate* aPrivate,
ConstructorRunnable* aRunnable, ErrorResult& aRv)
{
- aRunnable->Dispatch(aRv);
+ aRunnable->Dispatch(Terminating, aRv);
if (NS_WARN_IF(aRv.Failed())) {
return nullptr;
}
@@ -1302,7 +1314,7 @@ URLWorker::CreateObjectURL(const GlobalObject& aGlobal, Blob& aBlob,
RefPtr<CreateURLRunnable> runnable =
new CreateURLRunnable(workerPrivate, blobImpl, aOptions, aResult);
- runnable->Dispatch(aRv);
+ runnable->Dispatch(Terminating, aRv);
if (NS_WARN_IF(aRv.Failed())) {
return;
}
@@ -1325,7 +1337,7 @@ URLWorker::RevokeObjectURL(const GlobalObject& aGlobal, const nsAString& aUrl,
RefPtr<RevokeURLRunnable> runnable =
new RevokeURLRunnable(workerPrivate, aUrl);
- runnable->Dispatch(aRv);
+ runnable->Dispatch(Terminating, aRv);
if (NS_WARN_IF(aRv.Failed())) {
return;
}
@@ -1348,7 +1360,7 @@ URLWorker::IsValidURL(const GlobalObject& aGlobal, const nsAString& aUrl,
RefPtr<IsValidURLRunnable> runnable =
new IsValidURLRunnable(workerPrivate, aUrl);
- runnable->Dispatch(aRv);
+ runnable->Dispatch(Terminating, aRv);
if (NS_WARN_IF(aRv.Failed())) {
return false;
}