Bug 1550422 - P19. Convert gfxPrefs::LayersWindowRecordingPath to gfxVars. r=jrmuizel

StaticPrefs doesn't support nsCString type and the changes required to support this would be rather big. Seeing that there was only a single gfxPrefs using this, and this is a "Once" pref ; we move it to gfxVars instead.

Differential Revision: https://phabricator.services.mozilla.com/D31462

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Jean-Yves Avenard 2019-05-26 14:30:57 +00:00
Родитель 321b1d810f
Коммит 5322579cda
4 изменённых файлов: 8 добавлений и 5 удалений

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

@ -49,7 +49,8 @@ class gfxVarReceiver;
_(ProfDirectory, nsString, nsString()) \
_(UseOMTP, bool, false) \
_(AllowD3D11KeyedMutex, bool, false) \
_(SystemTextQuality, int32_t, 5 /* CLEARTYPE_QUALITY */)
_(SystemTextQuality, int32_t, 5 /* CLEARTYPE_QUALITY */) \
_(LayersWindowRecordingPath, nsCString, nsCString())
/* Add new entries above this line. */

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

@ -7,7 +7,7 @@
#include "CompositionRecorder.h"
#include "gfxUtils.h"
#include "mozilla/gfx/2D.h"
#include "gfxPrefs.h"
#include "mozilla/gfx/gfxVars.h"
#include <ctime>
#include <iomanip>
@ -37,7 +37,7 @@ void CompositionRecorder::WriteCollectedFrames() {
std::time_t t = std::time(nullptr);
std::tm tm = *std::localtime(&t);
std::stringstream str;
str << gfxPrefs::LayersWindowRecordingPath() << "windowrecording-"
str << gfxVars::LayersWindowRecordingPath() << "windowrecording-"
<< std::put_time(&tm, "%Y%m%d%H%M%S");
#ifdef XP_WIN

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

@ -893,6 +893,10 @@ void gfxPlatform::Init() {
}
gfxUtils::RemoveShaderCacheFromDiskIfNecessary();
nsAutoCString path;
Preferences::GetCString("layers.windowrecording.path", path);
gfxVars::SetLayersWindowRecordingPath(path);
}
// Drop a note in the crash report if we end up forcing an option that could

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

@ -289,8 +289,6 @@ class gfxPrefs final {
// will keep these in an alphabetical order to make it easier to see if a
// method accessing a pref already exists. Just add yours in the list.
DECL_GFX_PREF(Once, "layers.windowrecording.path", LayersWindowRecordingPath, std::string, std::string());
// WARNING:
// Please make sure that you've added your new preference to the list above
// in alphabetical order.