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

Unified Diff: ui/base/resource/resource_bundle.h

Issue 2699323002: Restrict cross-thread access to gfx::Image and gfx::Font in ResourceBundle (Closed)
Patch Set: rebase Created 3 years, 10 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
« no previous file with comments | « no previous file | ui/base/resource/resource_bundle.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/resource/resource_bundle.h
diff --git a/ui/base/resource/resource_bundle.h b/ui/base/resource/resource_bundle.h
index 12e9ccfc1fb34ce36174e3ac17cf4ca8b0ba1332..d0401d991f1c13c3c506c31a1488bcb34977c4d8 100644
--- a/ui/base/resource/resource_bundle.h
+++ b/ui/base/resource/resource_bundle.h
@@ -17,6 +17,7 @@
#include "base/files/memory_mapped_file.h"
#include "base/gtest_prod_util.h"
#include "base/macros.h"
+#include "base/sequence_checker.h"
#include "base/strings/string16.h"
#include "base/strings/string_piece.h"
#include "build/build_config.h"
@@ -393,9 +394,6 @@ class UI_BASE_EXPORT ResourceBundle {
// be NULL.
Delegate* delegate_;
- // Protects |images_| and font-related members.
- std::unique_ptr<base::Lock> images_and_fonts_lock_;
-
// Protects |locale_resources_data_|.
std::unique_ptr<base::Lock> locale_resources_data_lock_;
@@ -416,7 +414,7 @@ class UI_BASE_EXPORT ResourceBundle {
// The various font lists used, as a map from a signed size delta from the
// platform base font size, plus style, to the FontList. Cached to avoid
// repeated GDI creation/destruction and font derivation.
- // Must be accessed only while holding |images_and_fonts_lock_|.
+ // Must be accessed only from UI thread.
std::map<FontKey, gfx::FontList> font_cache_;
base::FilePath overridden_pak_path_;
@@ -425,6 +423,8 @@ class UI_BASE_EXPORT ResourceBundle {
bool is_test_resources_ = false;
+ base::SequenceChecker sequence_checker_;
+
DISALLOW_COPY_AND_ASSIGN(ResourceBundle);
};
« no previous file with comments | « no previous file | ui/base/resource/resource_bundle.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698