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; ...@@ -19,7 +19,7 @@ namespace errors = manifest_errors;
namespace { namespace {
const AppIconColorInfo& GetInfo(const Extension* extension) { const AppIconColorInfo& GetAppIconColorInfo(const Extension* extension) {
CR_DEFINE_STATIC_LOCAL(const AppIconColorInfo, fallback, ()); CR_DEFINE_STATIC_LOCAL(const AppIconColorInfo, fallback, ());
AppIconColorInfo* info = static_cast<AppIconColorInfo*>( AppIconColorInfo* info = static_cast<AppIconColorInfo*>(
...@@ -37,13 +37,13 @@ AppIconColorInfo::~AppIconColorInfo() { ...@@ -37,13 +37,13 @@ AppIconColorInfo::~AppIconColorInfo() {
// static // static
SkColor AppIconColorInfo::GetIconColor(const Extension* extension) { SkColor AppIconColorInfo::GetIconColor(const Extension* extension) {
return GetInfo(extension).icon_color_; return GetAppIconColorInfo(extension).icon_color_;
} }
// static // static
const std::string& AppIconColorInfo::GetIconColorString( const std::string& AppIconColorInfo::GetIconColorString(
const Extension* extension) { const Extension* extension) {
return GetInfo(extension).icon_color_string_; return GetAppIconColorInfo(extension).icon_color_string_;
} }
AppIconColorHandler::AppIconColorHandler() { AppIconColorHandler::AppIconColorHandler() {
......
...@@ -22,12 +22,6 @@ namespace { ...@@ -22,12 +22,6 @@ namespace {
static base::LazyInstance<LinkedAppIcons>::DestructorAtExit static base::LazyInstance<LinkedAppIcons>::DestructorAtExit
g_empty_linked_app_icons = LAZY_INSTANCE_INITIALIZER; 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 } // namespace
LinkedAppIcons::IconInfo::IconInfo() { LinkedAppIcons::IconInfo::IconInfo() {
...@@ -47,7 +41,9 @@ LinkedAppIcons::~LinkedAppIcons() { ...@@ -47,7 +41,9 @@ LinkedAppIcons::~LinkedAppIcons() {
// static // static
const LinkedAppIcons& LinkedAppIcons::GetLinkedAppIcons( const LinkedAppIcons& LinkedAppIcons::GetLinkedAppIcons(
const Extension* extension) { 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() { 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