Commit 3e491595 authored by Daniel Bratell's avatar Daniel Bratell Committed by Commit Bot

Avoid having two global GetInfo() methods in the same module

In jumbo builds a whole build target can compile together
and share the same anonymous namespace. Then two methods with
the same name and arguments will clash which happens in
chrome/common.

This resolves that clash twice over by giving one GetInfo a
longer name and inlining the other one since it was only used
once in a one line function.

Bug: 890323
Change-Id: Icbb1d768bdf9c1385f35bebd54d0d008e4be49d9
Reviewed-on: https://chromium-review.googlesource.com/1251603Reviewed-by: default avatarIstiaque Ahmed <lazyboy@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#595765}
parent 611a195c
......@@ -19,7 +19,7 @@ namespace errors = manifest_errors;
namespace {
const AppIconColorInfo& GetInfo(const Extension* extension) {
const AppIconColorInfo& GetAppIconColorInfo(const Extension* extension) {
CR_DEFINE_STATIC_LOCAL(const AppIconColorInfo, fallback, ());
AppIconColorInfo* info = static_cast<AppIconColorInfo*>(
......@@ -37,13 +37,13 @@ AppIconColorInfo::~AppIconColorInfo() {
// static
SkColor AppIconColorInfo::GetIconColor(const Extension* extension) {
return GetInfo(extension).icon_color_;
return GetAppIconColorInfo(extension).icon_color_;
}
// static
const std::string& AppIconColorInfo::GetIconColorString(
const Extension* extension) {
return GetInfo(extension).icon_color_string_;
return GetAppIconColorInfo(extension).icon_color_string_;
}
AppIconColorHandler::AppIconColorHandler() {
......
......@@ -22,12 +22,6 @@ namespace {
static base::LazyInstance<LinkedAppIcons>::DestructorAtExit
g_empty_linked_app_icons = LAZY_INSTANCE_INITIALIZER;
const LinkedAppIcons& GetInfo(const Extension* extension) {
LinkedAppIcons* info = static_cast<LinkedAppIcons*>(
extension->GetManifestData(keys::kLinkedAppIcons));
return info ? *info : g_empty_linked_app_icons.Get();
}
} // namespace
LinkedAppIcons::IconInfo::IconInfo() {
......@@ -47,7 +41,9 @@ LinkedAppIcons::~LinkedAppIcons() {
// static
const LinkedAppIcons& LinkedAppIcons::GetLinkedAppIcons(
const Extension* extension) {
return GetInfo(extension);
LinkedAppIcons* info = static_cast<LinkedAppIcons*>(
extension->GetManifestData(keys::kLinkedAppIcons));
return info ? *info : g_empty_linked_app_icons.Get();
}
LinkedAppIconsHandler::LinkedAppIconsHandler() {
......
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