зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1312606 - Use live pref values when syncing gfxPrefs to the GPU process r=dvander
This commit is contained in:
Родитель
4657cb7a0f
Коммит
0bbc03d938
|
@ -76,7 +76,7 @@ gfxPrefs::Pref::OnChange()
|
|||
if (auto gpm = gfx::GPUProcessManager::Get()) {
|
||||
if (gfx::GPUChild* gpu = gpm->GetGPUChild()) {
|
||||
GfxPrefValue value;
|
||||
GetCachedValue(&value);
|
||||
GetLiveValue(&value);
|
||||
Unused << gpu->SendUpdatePref(gfx::GfxPrefSetting(mIndex, value));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -112,6 +112,9 @@ public:
|
|||
// Returns true if the value is default, false if changed.
|
||||
virtual bool HasDefaultValue() const = 0;
|
||||
|
||||
// Returns the pref value as a discriminated union.
|
||||
virtual void GetLiveValue(GfxPrefValue* aOutValue) const = 0;
|
||||
|
||||
// Returns the pref value as a discriminated union.
|
||||
virtual void GetCachedValue(GfxPrefValue* aOutValue) const = 0;
|
||||
|
||||
|
@ -228,6 +231,10 @@ private:
|
|||
const char *Name() const override {
|
||||
return Prefname();
|
||||
}
|
||||
void GetLiveValue(GfxPrefValue* aOutValue) const override {
|
||||
T value = GetLiveValue();
|
||||
CopyPrefValue(&value, aOutValue);
|
||||
}
|
||||
// When using the Preferences service, the change callback can be triggered
|
||||
// *before* our cached value is updated, so we expose a method to grab the
|
||||
// true live value.
|
||||
|
|
Загрузка…
Ссылка в новой задаче