mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 23:31:56 +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
|
||||
nsPIDOMWindowInner::GetAudioCaptured() const
|
||||
{
|
||||
|
@ -865,15 +865,8 @@ public:
|
||||
float GetAudioVolume() const;
|
||||
nsresult SetAudioVolume(float aVolume);
|
||||
|
||||
void SetServiceWorkersTestingEnabled(bool aEnabled)
|
||||
{
|
||||
mServiceWorkersTestingEnabled = aEnabled;
|
||||
}
|
||||
|
||||
bool GetServiceWorkersTestingEnabled()
|
||||
{
|
||||
return mServiceWorkersTestingEnabled;
|
||||
}
|
||||
void SetServiceWorkersTestingEnabled(bool aEnabled);
|
||||
bool GetServiceWorkersTestingEnabled();
|
||||
};
|
||||
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(nsPIDOMWindowOuter, NS_PIDOMWINDOWOUTER_IID)
|
||||
|
Loading…
Reference in New Issue
Block a user