Backed out changeset 85fd8d212397 (bug 1479544) for windows build bustages CLOSED TREE

This commit is contained in:
Bogdan Tara 2018-08-03 19:24:41 +03:00
parent a0fa30904d
commit a5db0f5415
6 changed files with 54 additions and 0 deletions

View File

@ -472,6 +472,47 @@ nsChromeRegistry::FlushAllCaches()
NS_CHROME_FLUSH_TOPIC, nullptr);
}
// xxxbsmedberg Move me to nsIWindowMediator
NS_IMETHODIMP
nsChromeRegistry::ReloadChrome()
{
FlushAllCaches();
// Do a reload of all top level windows.
nsresult rv = NS_OK;
// Get the window mediator
nsCOMPtr<nsIWindowMediator> windowMediator
(do_GetService(NS_WINDOWMEDIATOR_CONTRACTID));
if (windowMediator) {
nsCOMPtr<nsISimpleEnumerator> windowEnumerator;
rv = windowMediator->GetEnumerator(nullptr, getter_AddRefs(windowEnumerator));
if (NS_SUCCEEDED(rv)) {
// Get each dom window
bool more;
rv = windowEnumerator->HasMoreElements(&more);
if (NS_FAILED(rv)) return rv;
while (more) {
nsCOMPtr<nsISupports> protoWindow;
rv = windowEnumerator->GetNext(getter_AddRefs(protoWindow));
if (NS_SUCCEEDED(rv)) {
nsCOMPtr<nsPIDOMWindowOuter> domWindow = do_QueryInterface(protoWindow);
if (domWindow) {
Location* location = domWindow->GetLocation();
if (location) {
rv = location->Reload(false);
if (NS_FAILED(rv)) return rv;
}
}
}
rv = windowEnumerator->HasMoreElements(&more);
if (NS_FAILED(rv)) return rv;
}
}
}
return rv;
}
NS_IMETHODIMP
nsChromeRegistry::AllowScriptsForPackage(nsIURI* aChromeURI, bool *aResult)
{

View File

@ -39,6 +39,7 @@ public:
NS_DECL_ISUPPORTS
// nsIXULChromeRegistry methods:
NS_IMETHOD ReloadChrome() override;
NS_IMETHOD RefreshSkins() override;
NS_IMETHOD AllowScriptsForPackage(nsIURI* url,
bool* _retval) override;

View File

@ -48,6 +48,9 @@ interface nsIChromeRegistry : nsISupports
[scriptable, uuid(93251ddf-5e85-4172-ac2a-31780562974f)]
interface nsIXULChromeRegistry : nsIChromeRegistry
{
/* Should be called when locales change to reload all chrome (including XUL). */
void reloadChrome();
// If the optional asBCP47 parameter is true, the locale code will be
// converted to a BCP47 language tag; in particular, this means that
// "ja-JP-mac" will be returned as "ja-JP-x-lvariant-mac", which can be

View File

@ -6430,6 +6430,13 @@ nsGlobalWindowOuter::GetPrivateRoot()
return top;
}
Location*
nsGlobalWindowOuter::GetLocation()
{
// This method can be called on the outer window as well.
FORWARD_TO_INNER(GetLocation, (), nullptr);
}
void
nsGlobalWindowOuter::ActivateOrDeactivate(bool aActivate)
{

View File

@ -561,6 +561,7 @@ public:
}
void GetNameOuter(nsAString& aName);
void SetNameOuter(const nsAString& aName, mozilla::ErrorResult& aError);
mozilla::dom::Location* GetLocation() override;
void GetStatusOuter(nsAString& aStatus);
void SetStatusOuter(const nsAString& aStatus);
void CloseOuter(bool aTrustedCaller);

View File

@ -1098,6 +1098,7 @@ public:
// XXX(nika): These feel like they should be inner window only, but they're
// called on the outer window.
virtual mozilla::dom::Navigator* GetNavigator() = 0;
virtual mozilla::dom::Location* GetLocation() = 0;
virtual nsresult GetPrompter(nsIPrompt** aPrompt) = 0;
virtual nsresult GetControllers(nsIControllers** aControllers) = 0;