Cleanup return values in chrome/common/extensions

This CL turns const by value return values into const by ref.

Replacing const value by a const ref when a member variable is returned
is safe, because the member variable will live at least as long as the
temporary object returned now. It can also be more efficient, because
returning a ref can spare copying.

BUG=393155

Review URL: https://codereview.chromium.org/423483006

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@285691 0039d316-1c4b-4281-b951-d872f2087c98
parent 8a120a4e
......@@ -48,7 +48,7 @@ class FileBrowserHandler {
void ClearPatterns();
// Action icon path.
const std::string icon_path() const { return default_icon_path_; }
const std::string& icon_path() const { return default_icon_path_; }
void set_icon_path(const std::string& path) {
default_icon_path_ = path;
}
......
......@@ -39,7 +39,7 @@ class MimeTypesHandler {
handler_url_ = handler_url;
}
// The URL that will be used to handle MIME type requests.
const std::string handler_url() const { return handler_url_; }
const std::string& handler_url() const { return handler_url_; }
const std::set<std::string>& mime_type_set() const { return mime_type_set_; }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment