Bug 1318764 - Get rid of GetLookAndFeelCache sync IPC message, and send cache with GetXPCOMProcessAttributes instead. r=billm

MozReview-Commit-ID: 7BzG2WqNYLO

--HG--
extra : rebase_source : a6d2510b63cefe2895172a082d9a4c67c12944f5
This commit is contained in:
Mike Conley 2016-11-18 15:36:18 -05:00
Родитель b4e6fa3527
Коммит ab867d5870
6 изменённых файлов: 21 добавлений и 19 удалений

Просмотреть файл

@ -922,7 +922,9 @@ ContentChild::InitXPCOM()
&isLangRTL, &haveBidiKeyboards,
&mAvailableDictionaries,
&clipboardCaps, &domainPolicy, &initialData,
&mFontFamilies, &userContentSheetURL);
&mFontFamilies, &userContentSheetURL,
&mLookAndFeelCache);
RecvSetOffline(isOffline);
RecvSetConnectivity(isConnected);
RecvSetCaptivePortalState(captivePortalState);

Просмотреть файл

@ -31,6 +31,7 @@ struct SubstitutionMapping;
struct OverrideMapping;
class nsIDomainPolicy;
class nsIURIClassifierCallback;
struct LookAndFeelInt;
namespace mozilla {
class RemoteSpellcheckEngineChild;
@ -621,6 +622,11 @@ public:
virtual bool
DeallocPURLClassifierChild(PURLClassifierChild* aActor) override;
nsTArray<LookAndFeelInt>&
LookAndFeelCache() {
return mLookAndFeelCache;
}
/**
* Helper function for protocols that use the GPU process when available.
* Overrides FatalError to just be a warning when communicating with the
@ -650,6 +656,8 @@ private:
// parent process and used to initialize gfx in the child. Currently used
// only on MacOSX.
InfallibleTArray<mozilla::dom::FontFamilyListEntry> mFontFamilies;
// Temporary storage for nsXPLookAndFeel flags.
nsTArray<LookAndFeelInt> mLookAndFeelCache;
/**
* An ID unique to the process containing our corresponding

Просмотреть файл

@ -2479,7 +2479,8 @@ ContentParent::RecvGetXPCOMProcessAttributes(bool* aIsOffline,
DomainPolicyClone* domainPolicy,
StructuredCloneData* aInitialData,
InfallibleTArray<FontFamilyListEntry>* fontFamilies,
OptionalURIParams* aUserContentCSSURL)
OptionalURIParams* aUserContentCSSURL,
nsTArray<LookAndFeelInt>* aLookAndFeelIntCache)
{
nsCOMPtr<nsIIOService> io(do_GetIOService());
MOZ_ASSERT(io, "No IO service?");
@ -2544,6 +2545,7 @@ ContentParent::RecvGetXPCOMProcessAttributes(bool* aIsOffline,
// This is only implemented (returns a non-empty list) by MacOSX at present.
gfxPlatform::GetPlatform()->GetSystemFontFamilyList(fontFamilies);
*aLookAndFeelIntCache = LookAndFeel::GetIntCache();
// Content processes have no permission to access profile directory, so we
// send the file URL instead.
@ -3235,13 +3237,6 @@ ContentParent::RecvNSSU2FTokenSign(nsTArray<uint8_t>&& aApplication,
return IPC_OK();
}
mozilla::ipc::IPCResult
ContentParent::RecvGetLookAndFeelCache(nsTArray<LookAndFeelInt>* aLookAndFeelIntCache)
{
*aLookAndFeelIntCache = LookAndFeel::GetIntCache();
return IPC_OK();
}
mozilla::ipc::IPCResult
ContentParent::RecvIsSecureURI(const uint32_t& type,
const URIParams& uri,

Просмотреть файл

@ -682,7 +682,8 @@ private:
DomainPolicyClone* domainPolicy,
StructuredCloneData* initialData,
InfallibleTArray<FontFamilyListEntry>* fontFamilies,
OptionalURIParams* aUserContentSheetURL) override;
OptionalURIParams* aUserContentSheetURL,
nsTArray<LookAndFeelInt>* aLookAndFeelIntCache) override;
virtual bool
DeallocPJavaScriptParent(mozilla::jsipc::PJavaScriptParent*) override;
@ -928,8 +929,6 @@ private:
const bool& aContentOrNormalChannel,
const bool& aAnyChannel) override;
virtual mozilla::ipc::IPCResult RecvGetLookAndFeelCache(nsTArray<LookAndFeelInt>* aLookAndFeelIntCache) override;
virtual mozilla::ipc::IPCResult RecvKeywordToURI(const nsCString& aKeyword,
nsString* aProviderName,
OptionalInputStreamParams* aPostData,

Просмотреть файл

@ -667,7 +667,8 @@ parent:
DomainPolicyClone domainPolicy,
StructuredCloneData initialData,
FontFamilyListEntry[] fontFamilies /* used on MacOSX only */,
OptionalURIParams userContentSheetURL);
OptionalURIParams userContentSheetURL,
LookAndFeelInt[] lookAndFeelIntCache);
sync CreateChildProcess(IPCTabContext context,
ProcessPriority priority,
@ -768,9 +769,6 @@ parent:
async AccumulateMixedContentHSTS(URIParams uri, bool active, bool hasHSTSPriming);
sync GetLookAndFeelCache()
returns (LookAndFeelInt[] lookAndFeelIntCache);
nested(inside_cpow) async PHal();
async PHeapSnapshotTempFileHelper();

Просмотреть файл

@ -474,9 +474,9 @@ nsXPLookAndFeel::Init()
mozilla::dom::ContentChild* cc =
mozilla::dom::ContentChild::GetSingleton();
nsTArray<LookAndFeelInt> lookAndFeelIntCache;
cc->SendGetLookAndFeelCache(&lookAndFeelIntCache);
LookAndFeel::SetIntCache(lookAndFeelIntCache);
LookAndFeel::SetIntCache(cc->LookAndFeelCache());
// This is only ever used once during initialization, and can be cleared now.
cc->LookAndFeelCache().Clear();
}
}