Index: components/wallpaper/wallpaper_manager_base.cc |
diff --git a/components/wallpaper/wallpaper_manager_base.cc b/components/wallpaper/wallpaper_manager_base.cc |
index a29a4b36365458ceb80982075c66a9cc8ee43295..e0d38e34ad41ab8e692ff6cb46cf6b7e69bc2c41 100644 |
--- a/components/wallpaper/wallpaper_manager_base.cc |
+++ b/components/wallpaper/wallpaper_manager_base.cc |
@@ -10,6 +10,7 @@ |
#include "base/command_line.h" |
#include "base/files/file_path.h" |
#include "base/files/file_util.h" |
+#include "base/lazy_instance.h" |
#include "base/logging.h" |
#include "base/metrics/histogram.h" |
#include "base/path_service.h" |
@@ -63,6 +64,11 @@ const unsigned kLoadMaxDelayMs = 2000; |
// color. |
const SkColor kDefaultWallpaperColor = SK_ColorGRAY; |
+#if DCHECK_IS_ON() |
+base::LazyInstance<base::SequenceChecker>::Leaky g_wallpaper_sequence_checker = |
+ LAZY_INSTANCE_INITIALIZER; |
+#endif |
+ |
// The path ids for directories. |
int dir_user_data_path_id = -1; // chrome::DIR_USER_DATA |
int dir_chromeos_wallpapers_path_id = -1; // chrome::DIR_CHROMEOS_WALLPAPERS |
@@ -158,6 +164,12 @@ WallpaperInfo::WallpaperInfo(const std::string& in_location, |
WallpaperInfo::~WallpaperInfo() { |
} |
+void AssertCalledOnWallpaperSequence() { |
+#if DCHECK_IS_ON() |
+ DCHECK(g_wallpaper_sequence_checker.Get().CalledOnValidSequence()); |
+#endif |
+} |
+ |
const char kWallpaperSequenceTokenName[] = "wallpaper-sequence"; |
const char kSmallWallpaperSuffix[] = "_small"; |