Merge "Simplify PERFETTO_EXPORT_COMPONENT"
diff --git a/gn/perfetto.gni b/gn/perfetto.gni
index 9c4ebe2..3bd3d96 100644
--- a/gn/perfetto.gni
+++ b/gn/perfetto.gni
@@ -210,7 +210,7 @@
# On Windows we default to monolithic executables, because pairing
# dllexport/import adds extra complexity for little benefit. Te only reason
# for monolithic_binaries=false is saving binary size, which matters mainly on
- # Android. See also comments on PERFETTO_EXPORTED_ENTRYPOINT in compiler.h.
+ # Android. See also comments on PERFETTO_EXPORT_ENTRYPOINT in compiler.h.
monolithic_binaries = is_win
# Whether DLOG should be enabled on debug builds (""), all builds ("on"), or
diff --git a/include/perfetto/base/export.h b/include/perfetto/base/export.h
index 7036f65..53c4eeb 100644
--- a/include/perfetto/base/export.h
+++ b/include/perfetto/base/export.h
@@ -19,26 +19,24 @@
#include "perfetto/base/build_config.h"
+#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
+#define PERFETTO_INTERNAL_DLL_EXPORT __declspec(dllexport)
+#define PERFETTO_INTERNAL_DLL_IMPORT __declspec(dllimport)
+#else
+#define PERFETTO_INTERNAL_DLL_EXPORT __attribute__((visibility("default")))
+#define PERFETTO_INTERNAL_DLL_IMPORT
+#endif
+
+// PERFETTO_EXPORT_COMPONENT: Exports a symbol among C++ components when
+// building with is_component = true (mostly used by chromium build).
#if PERFETTO_BUILDFLAG(PERFETTO_COMPONENT_BUILD)
-#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
-
#if defined(PERFETTO_IMPLEMENTATION)
-#define PERFETTO_EXPORT_COMPONENT __declspec(dllexport)
+#define PERFETTO_EXPORT_COMPONENT PERFETTO_INTERNAL_DLL_EXPORT
#else
-#define PERFETTO_EXPORT_COMPONENT __declspec(dllimport)
+#define PERFETTO_EXPORT_COMPONENT PERFETTO_INTERNAL_DLL_IMPORT
#endif
-#else // PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
-
-#if defined(PERFETTO_IMPLEMENTATION)
-#define PERFETTO_EXPORT_COMPONENT __attribute__((visibility("default")))
-#else
-#define PERFETTO_EXPORT_COMPONENT
-#endif
-
-#endif // PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
-
#else // !PERFETTO_BUILDFLAG(PERFETTO_COMPONENT_BUILD)
#define PERFETTO_EXPORT_COMPONENT