Fix implicit access to raw pointer of scoped_refptr.
In following patch https://codereview.chromium.org/1963323004/
scoped_refptr will have the previous flawed "Safe Bool Idiom"
implementation removed.
This feature was incorrectly used throughout the codebase
with code implicitly accessing the raw pointer from
scoped_refptr instances. A correct "Safe Bool Idiom" would
have prevented that, but the point is moot as we can now
move to Cxx11 "explicit operator bool()".
Usage has been corrected in two ways:
+ Logic tests no longer compare pointer values, but use a
boolean expression (typically just the variable name).
+ Casts to boolean types are now explicit with stati_cast<bool>().
BUG=610048
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel
Review-Url: https://codereview.chromium.org/1958823002
Cr-Commit-Position: refs/heads/master@{#393125}
diff --git a/chrome/browser/themes/theme_service.cc b/chrome/browser/themes/theme_service.cc
index 8279251d..092dab23 100644
--- a/chrome/browser/themes/theme_service.cc
+++ b/chrome/browser/themes/theme_service.cc
@@ -568,7 +568,8 @@
? chrome::kThemePackMaterialDesignFilename
: chrome::kThemePackFilename);
SwapThemeSupplier(BrowserThemePack::BuildFromDataPack(path, current_id));
- loaded_pack = theme_supplier_ != nullptr;
+ if (theme_supplier_)
+ loaded_pack = true;
}
if (loaded_pack) {