[fuchsia] Enable Perfetto IPC support for Fuchsia.

Turns on "enable_perfetto_ipc" and conditionally builds related
POSIX classes for Fuchsia. Fuchsia's POSIX support might be
a little patchy, but mmap() does work properly.

Bug: chromium:1166873
Change-Id: Id96014cbaaf4660e23abec72b71d54f2d4b7b074
diff --git a/gn/perfetto.gni b/gn/perfetto.gni
index 42e35b8..e979235 100644
--- a/gn/perfetto.gni
+++ b/gn/perfetto.gni
@@ -147,9 +147,8 @@
   # For now the IPC layer is conservatively not enabled on Chromium+Windows
   # builds.
   enable_perfetto_ipc =
-      !is_fuchsia && !is_nacl &&
-      (perfetto_build_standalone || perfetto_build_with_android ||
-       (build_with_chromium && !is_win))
+      !is_nacl && (perfetto_build_standalone || perfetto_build_with_android ||
+                   (build_with_chromium && !is_win))
 
   # Makes the heap profiling daemon target reachable. It works only on Android,
   # but is built on Linux as well for test/compiler coverage.
diff --git a/src/tracing/ipc/posix_shared_memory.cc b/src/tracing/ipc/posix_shared_memory.cc
index 3a59948..a21a290 100644
--- a/src/tracing/ipc/posix_shared_memory.cc
+++ b/src/tracing/ipc/posix_shared_memory.cc
@@ -18,7 +18,8 @@
 
 #if PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) ||   \
     PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) || \
-    PERFETTO_BUILDFLAG(PERFETTO_OS_APPLE)
+    PERFETTO_BUILDFLAG(PERFETTO_OS_APPLE) ||   \
+    PERFETTO_BUILDFLAG(PERFETTO_OS_FUCHSIA)
 
 #include <fcntl.h>
 #include <stdint.h>
diff --git a/src/tracing/ipc/posix_shared_memory.h b/src/tracing/ipc/posix_shared_memory.h
index 18c7dd7..0ba1a31 100644
--- a/src/tracing/ipc/posix_shared_memory.h
+++ b/src/tracing/ipc/posix_shared_memory.h
@@ -21,7 +21,8 @@
 
 #if PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) ||   \
     PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) || \
-    PERFETTO_BUILDFLAG(PERFETTO_OS_APPLE)
+    PERFETTO_BUILDFLAG(PERFETTO_OS_APPLE) || \
+    PERFETTO_BUILDFLAG(PERFETTO_OS_FUCHSIA)
 
 #include <stddef.h>