Upgrade openscreen to 9d9da7b805d37b9e1bb890cf0200e8e505ef8b39

Test: make
Change-Id: Ibded80f41034de5725807574938bbf8b9cc22777
diff --git a/METADATA b/METADATA
index fcce72a..980b6ba 100644
--- a/METADATA
+++ b/METADATA
@@ -9,7 +9,7 @@
     type: GIT
     value: "https://chromium.googlesource.com/openscreen"
   }
-  version: "b98dcaa0db83132203774a577c0a64c39f7092e9"
+  version: "9d9da7b805d37b9e1bb890cf0200e8e505ef8b39"
   license_type: NOTICE
   last_upgrade_date {
     year: 2021
diff --git a/cast/common/BUILD.gn b/cast/common/BUILD.gn
index c1a8acd..ae32bf4 100644
--- a/cast/common/BUILD.gn
+++ b/cast/common/BUILD.gn
@@ -66,12 +66,12 @@
     "channel/virtual_connection.h",
     "channel/virtual_connection_router.cc",
     "channel/virtual_connection_router.h",
-    "public/cast_socket.h",
   ]
 
   deps = [ "certificate/proto:certificate_proto" ]
 
   public_deps = [
+    ":public",
     "../../platform",
     "../../third_party/abseil",
     "../../util",
@@ -81,6 +81,7 @@
 
 source_set("public") {
   sources = [
+    "public/cast_socket.h",
     "public/message_port.h",
     "public/service_info.cc",
     "public/service_info.h",
@@ -128,6 +129,7 @@
     ":certificate",
     ":channel",
     ":public",
+    "../../discovery:dnssd",
     "../../platform:test",
     "../../testing/util",
     "../../third_party/abseil",
diff --git a/cast/streaming/BUILD.gn b/cast/streaming/BUILD.gn
index f9a7b81..04424cf 100644
--- a/cast/streaming/BUILD.gn
+++ b/cast/streaming/BUILD.gn
@@ -67,6 +67,7 @@
     "../../third_party/abseil",
     "../../third_party/boringssl",
     "../common:channel",
+    "../common:public",
     "../common/certificate/proto:certificate_proto",
   ]
 
@@ -137,6 +138,8 @@
     "testing/simple_socket_subscriber.h",
   ]
 
+  public_deps = [ ":common" ]
+
   deps = [
     "../../third_party/googletest:gmock",
     "../../third_party/googletest:gtest",
@@ -184,6 +187,7 @@
     ":receiver",
     ":sender",
     ":test_helpers",
+    "../../platform:test",
     "../../third_party/googletest:gmock",
     "../../third_party/googletest:gtest",
     "../../util",
diff --git a/cast/streaming/offer_messages.cc b/cast/streaming/offer_messages.cc
index 858038b..dfc5a15 100644
--- a/cast/streaming/offer_messages.cc
+++ b/cast/streaming/offer_messages.cc
@@ -16,7 +16,6 @@
 #include "absl/strings/str_split.h"
 #include "cast/streaming/capture_recommendations.h"
 #include "cast/streaming/constants.h"
-#include "cast/streaming/receiver_session.h"
 #include "platform/base/error.h"
 #include "util/big_endian.h"
 #include "util/enum_name_table.h"
diff --git a/discovery/BUILD.gn b/discovery/BUILD.gn
index 923b8fc..2f5ff33 100644
--- a/discovery/BUILD.gn
+++ b/discovery/BUILD.gn
@@ -61,6 +61,7 @@
   ]
 }
 
+# TODO(issuetracker.google.com/179705382): Separate out a public target.
 source_set("dnssd") {
   sources = [
     "dnssd/impl/conversion_layer.cc",
@@ -95,6 +96,7 @@
   public_deps = [
     ":common",
     ":mdns",
+    "../util",
   ]
 }
 
@@ -108,6 +110,7 @@
   public_deps = [
     ":common",
     ":dnssd",
+    "../util",
   ]
 }
 
@@ -159,7 +162,10 @@
   deps = [
     ":dnssd",
     ":mdns",
+    ":public",
     ":testing",
+    "../platform:test",
+    "../third_party/abseil",
     "../third_party/googletest:gmock",
     "../third_party/googletest:gtest",
     "../util",
diff --git a/osp/BUILD.gn b/osp/BUILD.gn
index 031ae2e..14bb1ae 100644
--- a/osp/BUILD.gn
+++ b/osp/BUILD.gn
@@ -5,22 +5,14 @@
 import("build/config/services.gni")
 
 source_set("osp") {
-  public_deps = [
-    "public",
-  ]
-  deps = [
-    "impl",
-  ]
+  public_deps = [ "public" ]
+  deps = [ "impl" ]
 }
 
 if (use_chromium_quic) {
   source_set("osp_with_chromium_quic") {
-    public_deps = [
-      ":osp",
-    ]
-    deps = [
-      "impl:chromium_quic_integration",
-    ]
+    public_deps = [ ":osp" ]
+    deps = [ "impl:chromium_quic_integration" ]
   }
 }
 
@@ -44,10 +36,13 @@
   ]
 
   deps = [
+    "../platform:base",
     "../platform:test",
     "../third_party/abseil",
     "../third_party/googletest:gmock",
     "../third_party/googletest:gtest",
+    "../third_party/tinycbor",
+    "../util",
     "impl",
     "impl/quic:test_support",
     "public",
@@ -63,9 +58,7 @@
 
 if (use_chromium_quic && use_mdns_responder) {
   executable("osp_demo") {
-    sources = [
-      "demo/osp_demo.cc",
-    ]
+    sources = [ "demo/osp_demo.cc" ]
     deps = [
       ":osp_with_chromium_quic",
       "//osp/impl/discovery/mdns",
diff --git a/osp/impl/BUILD.gn b/osp/impl/BUILD.gn
index 779300b..83326f5 100644
--- a/osp/impl/BUILD.gn
+++ b/osp/impl/BUILD.gn
@@ -8,6 +8,7 @@
   sources = [
     "mdns_platform_service.cc",
     "mdns_platform_service.h",
+    "message_demuxer.cc",
     "network_service_manager.cc",
     "presentation/presentation_common.cc",
     "presentation/presentation_common.h",
@@ -38,8 +39,8 @@
   }
 
   public_deps = [
-    "../../osp/msgs",
-    "../../osp/public",
+    "../msgs",
+    "../public",
   ]
   deps = [
     "../../platform",
@@ -63,11 +64,11 @@
     public_configs = [ "../../third_party/chromium_quic:chromium_quic_config" ]
 
     deps = [
-      "../../osp/msgs",
       "../../platform",
       "../../third_party/abseil",
       "../../third_party/chromium_quic",
       "../../util",
+      "../msgs",
       "quic",
     ]
   }
diff --git a/osp/public/message_demuxer.cc b/osp/impl/message_demuxer.cc
similarity index 100%
rename from osp/public/message_demuxer.cc
rename to osp/impl/message_demuxer.cc
diff --git a/osp/impl/presentation/presentation_controller.cc b/osp/impl/presentation/presentation_controller.cc
index 6d948ce..7aa093c 100644
--- a/osp/impl/presentation/presentation_controller.cc
+++ b/osp/impl/presentation/presentation_controller.cc
@@ -11,10 +11,10 @@
 #include "absl/types/optional.h"
 #include "osp/impl/presentation/url_availability_requester.h"
 #include "osp/msgs/osp_messages.h"
-#include "osp/msgs/request_response_handler.h"
 #include "osp/public/message_demuxer.h"
 #include "osp/public/network_service_manager.h"
 #include "osp/public/protocol_connection_client.h"
+#include "osp/public/request_response_handler.h"
 #include "util/osp_logging.h"
 
 namespace openscreen {
diff --git a/osp/impl/quic/BUILD.gn b/osp/impl/quic/BUILD.gn
index 221af39..e9f1e2c 100644
--- a/osp/impl/quic/BUILD.gn
+++ b/osp/impl/quic/BUILD.gn
@@ -33,8 +33,14 @@
     "testing/quic_test_support.h",
   ]
 
-  deps = [
+  public_deps = [
+    ":quic",
     "../../../platform",
+    "../../../platform:test",
+    "../../public",
+  ]
+
+  deps = [
     "../../../third_party/abseil",
     "../../../third_party/googletest:gmock",
     "../../../util",
diff --git a/osp/msgs/BUILD.gn b/osp/msgs/BUILD.gn
index 0e18ea9..8dcb69d 100644
--- a/osp/msgs/BUILD.gn
+++ b/osp/msgs/BUILD.gn
@@ -6,12 +6,9 @@
   sources = [
     target_gen_dir + "/osp_messages.cc",
     target_gen_dir + "/osp_messages.h",
-    "request_response_handler.h",
   ]
 
-  public_deps = [
-    ":cddl_gen",
-  ]
+  public_deps = [ ":cddl_gen" ]
   deps = [
     "../../third_party/abseil",
     "../../third_party/tinycbor",
@@ -29,9 +26,7 @@
 
 action("cddl_gen") {
   script = "../../tools/cddl/cddl.py"
-  sources = [
-    "osp_messages.cddl",
-  ]
+  sources = [ "osp_messages.cddl" ]
   outputs_src = rebase_path([
                               "osp_messages.h",
                               "osp_messages.cc",
@@ -61,17 +56,13 @@
         rebase_path("cddl.log", "//"),
       ] + rebase_path(sources, root_build_dir)
 
-  deps = [
-    cddl_label,
-  ]
+  deps = [ cddl_label ]
 }
 
 source_set("unittests") {
   testonly = true
 
-  sources = [
-    "messages_unittest.cc",
-  ]
+  sources = [ "messages_unittest.cc" ]
 
   deps = [
     ":msgs",
diff --git a/osp/public/BUILD.gn b/osp/public/BUILD.gn
index 779d1d9..cc915c6 100644
--- a/osp/public/BUILD.gn
+++ b/osp/public/BUILD.gn
@@ -12,7 +12,6 @@
     "endpoint_request_ids.h",
     "mdns_service_listener_factory.h",
     "mdns_service_publisher_factory.h",
-    "message_demuxer.cc",
     "message_demuxer.h",
     "network_metrics.h",
     "network_service_manager.h",
@@ -27,6 +26,7 @@
     "protocol_connection_server.cc",
     "protocol_connection_server.h",
     "protocol_connection_server_factory.h",
+    "request_response_handler.h",
     "server_config.cc",
     "server_config.h",
     "service_info.cc",
@@ -38,9 +38,7 @@
     "timestamp.h",
   ]
 
-  public_deps = [
-    "../msgs",
-  ]
+  public_deps = [ "../msgs" ]
 
   deps = [
     "../../platform",
@@ -51,7 +49,5 @@
 source_set("test_support") {
   testonly = true
 
-  sources = [
-    "testing/message_demuxer_test_support.h",
-  ]
+  sources = [ "testing/message_demuxer_test_support.h" ]
 }
diff --git a/osp/msgs/request_response_handler.h b/osp/public/request_response_handler.h
similarity index 97%
rename from osp/msgs/request_response_handler.h
rename to osp/public/request_response_handler.h
index c0cc882..de783ef 100644
--- a/osp/msgs/request_response_handler.h
+++ b/osp/public/request_response_handler.h
@@ -2,12 +2,14 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef OSP_MSGS_REQUEST_RESPONSE_HANDLER_H_
-#define OSP_MSGS_REQUEST_RESPONSE_HANDLER_H_
+#ifndef OSP_PUBLIC_REQUEST_RESPONSE_HANDLER_H_
+#define OSP_PUBLIC_REQUEST_RESPONSE_HANDLER_H_
 
 #include <cstddef>
 #include <cstdint>
 #include <type_traits>
+#include <utility>
+#include <vector>
 
 #include "absl/types/optional.h"
 #include "osp/public/message_demuxer.h"
@@ -224,4 +226,4 @@
 }  // namespace osp
 }  // namespace openscreen
 
-#endif  // OSP_MSGS_REQUEST_RESPONSE_HANDLER_H_
+#endif  // OSP_PUBLIC_REQUEST_RESPONSE_HANDLER_H_
diff --git a/platform/BUILD.gn b/platform/BUILD.gn
index 8fecb36..e98067f 100644
--- a/platform/BUILD.gn
+++ b/platform/BUILD.gn
@@ -186,6 +186,11 @@
     sources += [ "test/paths_internal_other.cc" ]
   }
 
+  public_deps = [
+    ":api",
+    ":base",
+  ]
+
   deps = [
     ":platform",
     "../third_party/abseil",
diff --git a/util/BUILD.gn b/util/BUILD.gn
index 1cb3436..3e915eb 100644
--- a/util/BUILD.gn
+++ b/util/BUILD.gn
@@ -73,6 +73,8 @@
   ]
 
   public_deps = [
+    "../platform:api",
+    "../platform:base",
     "../third_party/abseil",
     "../third_party/jsoncpp",
   ]