Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2395)

Unified Diff: components/wallpaper/wallpaper_manager_base.cc

Issue 2315303002: Remove calls to IsRunningSequenceOnCurrentThread() in wallpaper API. (Closed)
Patch Set: Leaky LazyInstance Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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";

Powered by Google App Engine
This is Rietveld 408576698