import change from rmottola/Arctic-Fox:

- Bug 1128001 - Workaround ANGLE DEPTH16 being DEPTH24_STENCIL8. (144bc3839)
- Bug 1038839 - Use type information for alias analysis. r=jandem (7f562bcc2)
- Bug 1141797. r=smaug. (6ac0692bd)
- Bug 1143470 - Add BUG_COMPONENT to moz.build files in toolkit and xulrunner. r=gavin (3fee7e2d5)
- Bug 1083344 - Add "allow" sandbox rules to fix mochitests on OSX 10.9 and 10.10. r=smichaud (40c3323a5)
- Bug 1083344 - Tighten rules for Mac OS content process sandbox on 10.9 and 10.10. r=smichaud (a1102b817)
- Bug 1151974 P1 Delay Cache Context start until previous Context has completed. r=ehsan (20598fa6a)
- Bug 1130686 - Add test for service worker client.focus. (e4d836af7)
- Bug 1151916 - Set worker principalinfo on cache load. r=bkelly (4d55b31fe)
- Bug 1139513 - Warn and gather data if ServiceWorker hits max workers per domain limit. r=bent, r=rvitillo (44c59a9cb)
- Bug 1148354 - Deprecate the doppler effect from the PannerNode. r=ehsan (6de4e13ca)
- Bug 1148942 - Ensure that the registration of empty service workers succeeds; r=bent (edbb09fdf)
- Bug 1148496 - Allow to set an interface member as [Deprecated] in WebIDL. r=bz,smaug (43f554139)
This commit is contained in:
2019-08-02 15:32:55 +08:00
parent e48fcd77f0
commit 23551d1911
69 changed files with 933 additions and 83 deletions
+29 -19
View File
@@ -160,7 +160,12 @@ public:
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
ref = new Manager(aManagerId, ioThread);
ref->Init();
// There may be an old manager for this origin in the process of
// cleaning up. We need to tell the new manager about this so
// that it won't actually start until the old manager is done.
nsRefPtr<Manager> oldManager = Get(aManagerId, Closing);
ref->Init(oldManager);
MOZ_ASSERT(!sFactory->mManagerList.Contains(ref));
sFactory->mManagerList.AppendElement(ref);
@@ -172,20 +177,20 @@ public:
}
static already_AddRefed<Manager>
Get(ManagerId* aManagerId)
Get(ManagerId* aManagerId, State aState = Open)
{
mozilla::ipc::AssertIsOnBackgroundThread();
nsresult rv = MaybeCreateInstance();
if (NS_WARN_IF(NS_FAILED(rv))) { return nullptr; }
ManagerList::ForwardIterator iter(sFactory->mManagerList);
// Iterate in reverse to find the most recent, matching Manager. This
// is important when looking for a Closing Manager. If a new Manager
// chains to an old Manager we want it to be the most recent one.
ManagerList::BackwardIterator iter(sFactory->mManagerList);
while (iter.HasMore()) {
nsRefPtr<Manager> manager = iter.GetNext();
// If there is an invalid Manager finishing up and a new Manager
// is created for the same origin, then the new Manager will
// be blocked until QuotaManager finishes clearing the origin.
if (!manager->IsClosing() && *manager->mManagerId == *aManagerId) {
if (aState == manager->GetState() && *manager->mManagerId == *aManagerId) {
return manager.forget();
}
}
@@ -1449,7 +1454,7 @@ Manager::RemoveContext(Context* aContext)
// Whether the Context destruction was triggered from the Manager going
// idle or the underlying storage being invalidated, we should know we
// are closing before the Conext is destroyed.
MOZ_ASSERT(mClosing);
MOZ_ASSERT(mState == Closing);
mContext = nullptr;
@@ -1464,14 +1469,14 @@ Manager::NoteClosing()
{
NS_ASSERT_OWNINGTHREAD(Manager);
// This can be called more than once legitimately through different paths.
mClosing = true;
mState = Closing;
}
bool
Manager::IsClosing() const
Manager::State
Manager::GetState() const
{
NS_ASSERT_OWNINGTHREAD(Manager);
return mClosing;
return mState;
}
void
@@ -1592,7 +1597,7 @@ Manager::ExecuteCacheOp(Listener* aListener, CacheId aCacheId,
MOZ_ASSERT(aOpArgs.type() != CacheOpArgs::TCacheAddAllArgs);
MOZ_ASSERT(aOpArgs.type() != CacheOpArgs::TCachePutAllArgs);
if (mClosing) {
if (mState == Closing) {
aListener->OnOpComplete(ErrorResult(NS_ERROR_FAILURE), void_t());
return;
}
@@ -1636,7 +1641,7 @@ Manager::ExecuteStorageOp(Listener* aListener, Namespace aNamespace,
NS_ASSERT_OWNINGTHREAD(Manager);
MOZ_ASSERT(aListener);
if (mClosing) {
if (mState == Closing) {
aListener->OnOpComplete(ErrorResult(NS_ERROR_FAILURE), void_t());
return;
}
@@ -1685,7 +1690,7 @@ Manager::ExecutePutAll(Listener* aListener, CacheId aCacheId,
NS_ASSERT_OWNINGTHREAD(Manager);
MOZ_ASSERT(aListener);
if (mClosing) {
if (mState == Closing) {
aListener->OnOpComplete(ErrorResult(NS_ERROR_FAILURE), CachePutAllResult());
return;
}
@@ -1707,7 +1712,7 @@ Manager::Manager(ManagerId* aManagerId, nsIThread* aIOThread)
, mIOThread(aIOThread)
, mContext(nullptr)
, mShuttingDown(false)
, mClosing(false)
, mState(Open)
{
MOZ_ASSERT(mManagerId);
MOZ_ASSERT(mIOThread);
@@ -1716,7 +1721,7 @@ Manager::Manager(ManagerId* aManagerId, nsIThread* aIOThread)
Manager::~Manager()
{
NS_ASSERT_OWNINGTHREAD(Manager);
MOZ_ASSERT(mClosing);
MOZ_ASSERT(mState == Closing);
MOZ_ASSERT(!mContext);
nsCOMPtr<nsIThread> ioThread;
@@ -1730,15 +1735,20 @@ Manager::~Manager()
}
void
Manager::Init()
Manager::Init(Manager* aOldManager)
{
NS_ASSERT_OWNINGTHREAD(Manager);
nsRefPtr<Context> oldContext;
if (aOldManager) {
oldContext = aOldManager->mContext;
}
// Create the context immediately. Since there can at most be one Context
// per Manager now, this lets us cleanly call Factory::Remove() once the
// Context goes away.
nsRefPtr<Action> setupAction = new SetupAction();
nsRefPtr<Context> ref = Context::Create(this, setupAction);
nsRefPtr<Context> ref = Context::Create(this, setupAction, oldContext);
mContext = ref;
}