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

Unified Diff: extensions/browser/extension_icon_image.cc

Issue 448193002: Cleanup: Make ExtensionIconSet::Get return a const std::string& rather than a (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 | « chrome/browser/extensions/sandboxed_unpacker.cc ('k') | extensions/common/extension_icon_set.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/extension_icon_image.cc
diff --git a/extensions/browser/extension_icon_image.cc b/extensions/browser/extension_icon_image.cc
index e2c7e138541813cfa1742cd122ef6f17f0e442bf..a70924d7aad2f7a22fba53dcd4ea769a6a849bbd 100644
--- a/extensions/browser/extension_icon_image.cc
+++ b/extensions/browser/extension_icon_image.cc
@@ -47,11 +47,9 @@ extensions::ExtensionResource GetExtensionIconResource(
const ExtensionIconSet& icons,
int size,
ExtensionIconSet::MatchType match_type) {
- std::string path = icons.Get(size, match_type);
- if (path.empty())
- return extensions::ExtensionResource();
-
- return extension->GetResource(path);
+ const std::string& path = icons.Get(size, match_type);
+ return path.empty() ? extensions::ExtensionResource()
+ : extension->GetResource(path);
}
class BlankImageSource : public gfx::CanvasImageSource {
« no previous file with comments | « chrome/browser/extensions/sandboxed_unpacker.cc ('k') | extensions/common/extension_icon_set.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698