Bug 1158798 - Properly initialize the LookAndFeel cache in the child. r=mstange.

The old code was just flat-out wrong. The IPDL for getting the LookAndFeel
cache from the parent during child process initialization was passing an
array it wanted to be populated as an argument, rather than using a return
value.
This commit is contained in:
Mike Conley 2015-07-10 17:11:59 -04:00
parent 5ed998f9ea
commit 96028e803c
6 changed files with 9 additions and 8 deletions

View File

@ -4029,9 +4029,9 @@ ContentParent::RecvGetSystemMemory(const uint64_t& aGetterId)
}
bool
ContentParent::RecvGetLookAndFeelCache(nsTArray<LookAndFeelInt>&& aLookAndFeelIntCache)
ContentParent::RecvGetLookAndFeelCache(nsTArray<LookAndFeelInt>* aLookAndFeelIntCache)
{
aLookAndFeelIntCache = LookAndFeel::GetIntCache();
*aLookAndFeelIntCache = LookAndFeel::GetIntCache();
return true;
}

View File

@ -761,7 +761,7 @@ private:
virtual bool RecvGetSystemMemory(const uint64_t& getterId) override;
virtual bool RecvGetLookAndFeelCache(nsTArray<LookAndFeelInt>&& aLookAndFeelIntCache) override;
virtual bool RecvGetLookAndFeelCache(nsTArray<LookAndFeelInt>* aLookAndFeelIntCache) override;
virtual bool RecvDataStoreGetStores(
const nsString& aName,

View File

@ -733,7 +733,8 @@ parent:
sync IsSecureURI(uint32_t type, URIParams uri, uint32_t flags)
returns (bool isSecureURI);
sync GetLookAndFeelCache(LookAndFeelInt[] lookAndFeelIntCache);
sync GetLookAndFeelCache()
returns (LookAndFeelInt[] lookAndFeelIntCache);
prio(urgent) async PHal();

View File

@ -27,7 +27,7 @@ public:
static bool UseOverlayScrollbars();
virtual nsTArray<LookAndFeelInt> GetIntCacheImpl();
virtual void SetIntCacheImpl(const nsTArray<LookAndFeelInt>& lookAndFeelIntCache);
virtual void SetIntCacheImpl(const nsTArray<LookAndFeelInt>& aLookAndFeelIntCache);
virtual void RefreshImpl();
protected:

View File

@ -668,9 +668,9 @@ nsLookAndFeel::GetIntCacheImpl()
}
void
nsLookAndFeel::SetIntCacheImpl(const nsTArray<LookAndFeelInt>& lookAndFeelIntCache)
nsLookAndFeel::SetIntCacheImpl(const nsTArray<LookAndFeelInt>& aLookAndFeelIntCache)
{
for (auto entry : lookAndFeelIntCache) {
for (auto entry : aLookAndFeelIntCache) {
switch(entry.id) {
case eIntID_UseOverlayScrollbars:
mUseOverlayScrollbars = entry.value;

View File

@ -461,7 +461,7 @@ nsXPLookAndFeel::Init()
mozilla::dom::ContentChild::GetSingleton();
nsTArray<LookAndFeelInt> lookAndFeelIntCache;
cc->SendGetLookAndFeelCache(lookAndFeelIntCache);
cc->SendGetLookAndFeelCache(&lookAndFeelIntCache);
LookAndFeel::SetIntCache(lookAndFeelIntCache);
}
}