summaryrefslogtreecommitdiffstats
path: root/extensions/browser/extension_icon_image.cc
diff options
context:
space:
mode:
authorkalman@chromium.org <kalman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-07 22:52:16 +0000
committerkalman@chromium.org <kalman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-07 22:52:16 +0000
commit1771f16ad88aa9ba84c1b13a7cb75754357e10fd (patch)
tree632d2a0abb4c713b6a7bd2832873b8f4a117572d /extensions/browser/extension_icon_image.cc
parent88d32daf4c01eebc0aa75a928e7b41c6c5446a7d (diff)
downloadchromium_src-1771f16ad88aa9ba84c1b13a7cb75754357e10fd.zip
chromium_src-1771f16ad88aa9ba84c1b13a7cb75754357e10fd.tar.gz
chromium_src-1771f16ad88aa9ba84c1b13a7cb75754357e10fd.tar.bz2
Cleanup: Make ExtensionIconSet::Get return a const std::string& rather than a
std::string. R=mek@chromium.org Review URL: https://codereview.chromium.org/448193002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@288156 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'extensions/browser/extension_icon_image.cc')
-rw-r--r--extensions/browser/extension_icon_image.cc8
1 files changed, 3 insertions, 5 deletions
diff --git a/extensions/browser/extension_icon_image.cc b/extensions/browser/extension_icon_image.cc
index e2c7e13..a70924d 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 {