mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-21 17:25:36 +00:00
Bug 1266221 P1 Get devtools http service worker testing option from top window. r=bz
This commit is contained in:
parent
24969b7621
commit
d472e3219c
@ -3764,6 +3764,28 @@ nsPIDOMWindowOuter::RefreshMediaElements()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
nsPIDOMWindowOuter::SetServiceWorkersTestingEnabled(bool aEnabled)
|
||||||
|
{
|
||||||
|
// Devtools should only be setting this on the top level window. Its
|
||||||
|
// ok if devtools clears the flag on clean up of nested windows, though.
|
||||||
|
// It will have no affect.
|
||||||
|
#ifdef DEBUG
|
||||||
|
nsCOMPtr<nsPIDOMWindowOuter> topWindow = GetScriptableTop();
|
||||||
|
MOZ_ASSERT_IF(aEnabled, this == topWindow);
|
||||||
|
#endif
|
||||||
|
mServiceWorkersTestingEnabled = aEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
nsPIDOMWindowOuter::GetServiceWorkersTestingEnabled()
|
||||||
|
{
|
||||||
|
// Automatically get this setting from the top level window so that nested
|
||||||
|
// iframes get the correct devtools setting.
|
||||||
|
nsCOMPtr<nsPIDOMWindowOuter> topWindow = GetScriptableTop();
|
||||||
|
return topWindow->mServiceWorkersTestingEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
nsPIDOMWindowInner::GetAudioCaptured() const
|
nsPIDOMWindowInner::GetAudioCaptured() const
|
||||||
{
|
{
|
||||||
|
@ -865,15 +865,8 @@ public:
|
|||||||
float GetAudioVolume() const;
|
float GetAudioVolume() const;
|
||||||
nsresult SetAudioVolume(float aVolume);
|
nsresult SetAudioVolume(float aVolume);
|
||||||
|
|
||||||
void SetServiceWorkersTestingEnabled(bool aEnabled)
|
void SetServiceWorkersTestingEnabled(bool aEnabled);
|
||||||
{
|
bool GetServiceWorkersTestingEnabled();
|
||||||
mServiceWorkersTestingEnabled = aEnabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool GetServiceWorkersTestingEnabled()
|
|
||||||
{
|
|
||||||
return mServiceWorkersTestingEnabled;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
NS_DEFINE_STATIC_IID_ACCESSOR(nsPIDOMWindowOuter, NS_PIDOMWINDOWOUTER_IID)
|
NS_DEFINE_STATIC_IID_ACCESSOR(nsPIDOMWindowOuter, NS_PIDOMWINDOWOUTER_IID)
|
||||||
|
Loading…
Reference in New Issue
Block a user