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

Unified Diff: chrome/browser/themes/browser_theme_pack.cc

Issue 747013003: Various optimizations to reduce the number of temporary allocations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added back calls to c_str that were removed by mistake. Created 6 years 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 | « chrome/browser/themes/browser_theme_pack.h ('k') | chrome/browser/themes/theme_properties.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/themes/browser_theme_pack.cc
diff --git a/chrome/browser/themes/browser_theme_pack.cc b/chrome/browser/themes/browser_theme_pack.cc
index fe2f645cb496e972096827d983f38a0818de9092..ab80732b0493b943bf988664ed1311d597a0bf8e 100644
--- a/chrome/browser/themes/browser_theme_pack.cc
+++ b/chrome/browser/themes/browser_theme_pack.cc
@@ -779,18 +779,18 @@ scoped_refptr<BrowserThemePack> BrowserThemePack::BuildFromDataPack(
}
// static
-void BrowserThemePack::GetThemeableImageIDRs(std::set<int>* result) {
- if (!result)
- return;
-
- result->clear();
+bool BrowserThemePack::IsPersistentImageID(int id) {
for (size_t i = 0; i < kPersistingImagesLength; ++i)
- result->insert(kPersistingImages[i].idr_id);
+ if (kPersistingImages[i].idr_id == id)
+ return true;
#if defined(USE_ASH) && !defined(OS_CHROMEOS)
for (size_t i = 0; i < kPersistingImagesDesktopAuraLength; ++i)
- result->insert(kPersistingImagesDesktopAura[i].idr_id);
+ if (kPersistingImagesDesktopAura[i].idr_id == id)
+ return true;
#endif
+
+ return false;
}
bool BrowserThemePack::WriteToDisk(const base::FilePath& path) const {
« no previous file with comments | « chrome/browser/themes/browser_theme_pack.h ('k') | chrome/browser/themes/theme_properties.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698