Minor changes to IPC layer in preparation for Win port.

This CL doesn't introduce any major change (neither on
Windows nor on Linux). It mainly refactor the codebase
to make the Windows IPC cls easier to review:
- Rename the GN target platform_posix to platform_impl
  (Soon the same target will have a platform_windows.cc)
- Add a platform_unittest to cover the platform TLS logic.
- Refactor ThreadTaskRunner to directly expose a TaskRunner
  interface (soon platform_windows.cc will need it as well).
- Refactor a bunch of places to take a ScopedSocketHandle
  rather than a ScopedFile. They are the same type on POSIX
  but not on Windows (where the latter wraps a SOCKET).
- Remove the fd() argument from the base SharedMemory class.
  That makes sense only on POSIX and it caused a lot of empty
  implementation around (note: this will cause a Chromium
  roll failure, we need to match the removal in .MojoSharedMemory)
- Minor other tweaks to get rid of platform-specific includes.

Bug: 174454879
Test: manual on Windows.
Change-Id: Iead1ec87213c56fd3bb170c72d482f71fa33e7e3
diff --git a/Android.bp b/Android.bp
index d2eefc3..f520c93 100644
--- a/Android.bp
+++ b/Android.bp
@@ -715,7 +715,7 @@
     ":perfetto_src_tracing_ipc_consumer_consumer",
     ":perfetto_src_tracing_ipc_producer_producer",
     ":perfetto_src_tracing_ipc_service_service",
-    ":perfetto_src_tracing_platform_posix",
+    ":perfetto_src_tracing_platform_impl",
     ":perfetto_src_tracing_system_backend",
   ],
   shared_libs: [
@@ -1731,7 +1731,7 @@
     ":perfetto_src_tracing_ipc_consumer_consumer",
     ":perfetto_src_tracing_ipc_producer_producer",
     ":perfetto_src_tracing_ipc_service_service",
-    ":perfetto_src_tracing_platform_posix",
+    ":perfetto_src_tracing_platform_impl",
     ":perfetto_src_tracing_system_backend",
     ":perfetto_src_tracing_test_api_test_support",
     ":perfetto_src_tracing_test_client_api_integrationtests",
@@ -8283,9 +8283,9 @@
   ],
 }
 
-// GN: //src/tracing:platform_posix
+// GN: //src/tracing:platform_impl
 filegroup {
-  name: "perfetto_src_tracing_platform_posix",
+  name: "perfetto_src_tracing_platform_impl",
   srcs: [
     "src/tracing/platform_posix.cc",
   ],
@@ -8333,6 +8333,7 @@
 filegroup {
   name: "perfetto_src_tracing_test_tracing_integration_test",
   srcs: [
+    "src/tracing/test/platform_unittest.cc",
     "src/tracing/test/tracing_integration_test.cc",
   ],
 }
@@ -8707,6 +8708,7 @@
     ":perfetto_src_traced_probes_unittests",
     ":perfetto_src_traced_service_service",
     ":perfetto_src_traced_service_unittests",
+    ":perfetto_src_tracing_client_api_without_backends",
     ":perfetto_src_tracing_common",
     ":perfetto_src_tracing_core_core",
     ":perfetto_src_tracing_core_service",
@@ -8717,6 +8719,7 @@
     ":perfetto_src_tracing_ipc_producer_producer",
     ":perfetto_src_tracing_ipc_service_service",
     ":perfetto_src_tracing_ipc_unittests",
+    ":perfetto_src_tracing_platform_impl",
     ":perfetto_src_tracing_test_test_support",
     ":perfetto_src_tracing_test_tracing_integration_test",
     ":perfetto_tools_sanitizers_unittests_sanitizers_unittests",