BEGIN_PUBLIC

Microsoft has updated the winrt library
END_PUBLC

PiperOrigin-RevId: 387168248
This commit is contained in:
hai007
2021-07-29 03:27:37 -07:00
committed by Janusz Sobczak
parent 09e65aeddb
commit b1815095dd
1579 changed files with 967 additions and 20157 deletions
+14 -13
View File
@@ -1,3 +1,4 @@
licenses(["notice"])
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -35,14 +36,14 @@ cc_library(
visibility = ["//visibility:private"],
deps = [
"//base",
"//absl/base:core_headers",
"//absl/synchronization",
"//absl/time",
"//platform/api:platform",
"//platform/api:types",
"//platform/base",
"//platform/base:util",
"//platform/impl/shared:posix_mutex",
"//absl/base:core_headers",
"//absl/synchronization",
"//absl/time",
"//thread",
],
)
@@ -67,16 +68,16 @@ cc_library(
visibility = ["//visibility:private"],
deps = [
":types",
"//platform/api:comm",
"//platform/base",
"//platform/base:cancellation_flag",
"//platform/base:logging",
"//platform/base:test_util",
"//absl/base:core_headers",
"//absl/container:flat_hash_map",
"//absl/container:flat_hash_set",
"//absl/strings",
"//absl/synchronization",
"//platform/api:comm",
"//platform/base",
"//platform/base:cancellation_flag",
"//platform/base:logging",
"//platform/base:test_util",
"//webrtc/api:create_peerconnection_factory", #buildcleaner: keep
"//webrtc/api:libjingle_peerconnection_api",
"//webrtc/api/task_queue:default_task_queue_factory",
@@ -91,9 +92,9 @@ cc_library(
],
visibility = ["//visibility:private"],
deps = [
"//absl/strings",
"//platform/api:types",
"//platform/base",
"//absl/strings",
"//openssl:crypto",
],
)
@@ -112,14 +113,14 @@ cc_library(
":comm",
":crypto", # build_cleaner: keep
":types",
"//absl/base:core_headers",
"//absl/memory",
"//absl/strings",
"//absl/time",
"//platform/api:comm",
"//platform/api:platform",
"//platform/api:types",
"//platform/base:test_util",
"//platform/impl/shared:file",
"//absl/base:core_headers",
"//absl/memory",
"//absl/strings",
"//absl/time",
],
)
+2 -6
View File
@@ -29,12 +29,8 @@ class AtomicUint32 : public api::AtomicUint32 {
explicit AtomicUint32(std::int32_t value) : value_(value) {}
~AtomicUint32() override = default;
std::uint32_t Get() const override {
return value_;
}
void Set(std::uint32_t value) override {
value_ = value;
}
std::uint32_t Get() const override { return value_; }
void Set(std::uint32_t value) override { value_ = value; }
private:
std::atomic<std::uint32_t> value_;
+1 -1
View File
@@ -18,11 +18,11 @@
#include <memory>
#include <string>
#include "absl/synchronization/mutex.h"
#include "platform/api/ble.h"
#include "platform/base/cancellation_flag_listener.h"
#include "platform/base/logging.h"
#include "platform/base/medium_environment.h"
#include "absl/synchronization/mutex.h"
namespace location {
namespace nearby {
+9 -11
View File
@@ -18,6 +18,10 @@
#include <memory>
#include <string>
#include "absl/container/flat_hash_map.h"
#include "absl/container/flat_hash_set.h"
#include "absl/strings/escaping.h"
#include "absl/synchronization/mutex.h"
#include "platform/api/ble.h"
#include "platform/base/byte_array.h"
#include "platform/base/input_stream.h"
@@ -26,10 +30,6 @@
#include "platform/impl/g3/bluetooth_classic.h"
#include "platform/impl/g3/multi_thread_executor.h"
#include "platform/impl/g3/pipe.h"
#include "absl/container/flat_hash_map.h"
#include "absl/container/flat_hash_set.h"
#include "absl/strings/escaping.h"
#include "absl/synchronization/mutex.h"
namespace location {
namespace nearby {
@@ -68,8 +68,7 @@ class BleSocket : public api::BleSocket {
// Returns valid BlePeripheral pointer if there is a connection, and
// nullptr otherwise.
BlePeripheral* GetRemotePeripheral() override
ABSL_LOCKS_EXCLUDED(mutex_);
BlePeripheral* GetRemotePeripheral() override ABSL_LOCKS_EXCLUDED(mutex_);
private:
void DoClose() ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_);
@@ -90,7 +89,7 @@ class BleSocket : public api::BleSocket {
// Output pipe is initialized by constructor, it remains always valid, until
// it is closed. it represents output part of a local socket. Input part of a
// local socket comes from the peer socket, after connection.
std::shared_ptr<Pipe> output_ {new Pipe};
std::shared_ptr<Pipe> output_{new Pipe};
std::shared_ptr<Pipe> input_;
mutable absl::Mutex mutex_;
BlePeripheral* peripheral_;
@@ -173,8 +172,8 @@ class BleMedium : public api::BleMedium {
// Returns true once Ble socket connection requests to service_id can be
// accepted.
bool StartAcceptingConnections(const std::string& service_id,
AcceptedConnectionCallback callback)
override ABSL_LOCKS_EXCLUDED(mutex_);
AcceptedConnectionCallback callback) override
ABSL_LOCKS_EXCLUDED(mutex_);
bool StopAcceptingConnections(const std::string& service_id) override
ABSL_LOCKS_EXCLUDED(mutex_);
@@ -184,8 +183,7 @@ class BleMedium : public api::BleMedium {
// On error, returns nullptr.
std::unique_ptr<api::BleSocket> Connect(
api::BlePeripheral& remote_peripheral, const std::string& service_id,
CancellationFlag* cancellation_flag) override
ABSL_LOCKS_EXCLUDED(mutex_);
CancellationFlag* cancellation_flag) override ABSL_LOCKS_EXCLUDED(mutex_);
BluetoothAdapter& GetAdapter() { return *adapter_; }
+3 -3
View File
@@ -17,13 +17,13 @@
#include <string>
#include "absl/base/thread_annotations.h"
#include "absl/strings/string_view.h"
#include "absl/synchronization/mutex.h"
#include "platform/api/ble.h"
#include "platform/api/bluetooth_adapter.h"
#include "platform/api/bluetooth_classic.h"
#include "platform/impl/g3/single_thread_executor.h"
#include "absl/base/thread_annotations.h"
#include "absl/strings/string_view.h"
#include "absl/synchronization/mutex.h"
namespace location {
namespace nearby {
+1 -1
View File
@@ -17,12 +17,12 @@
#include <memory>
#include <string>
#include "absl/synchronization/mutex.h"
#include "platform/api/bluetooth_classic.h"
#include "platform/base/cancellation_flag_listener.h"
#include "platform/base/logging.h"
#include "platform/base/medium_environment.h"
#include "platform/impl/g3/bluetooth_adapter.h"
#include "absl/synchronization/mutex.h"
namespace location {
namespace nearby {
+4 -5
View File
@@ -18,6 +18,9 @@
#include <memory>
#include <string>
#include "absl/container/flat_hash_map.h"
#include "absl/container/flat_hash_set.h"
#include "absl/synchronization/mutex.h"
#include "platform/api/bluetooth_classic.h"
#include "platform/base/byte_array.h"
#include "platform/base/exception.h"
@@ -26,9 +29,6 @@
#include "platform/base/output_stream.h"
#include "platform/impl/g3/bluetooth_adapter.h"
#include "platform/impl/g3/pipe.h"
#include "absl/container/flat_hash_map.h"
#include "absl/container/flat_hash_set.h"
#include "absl/synchronization/mutex.h"
namespace location {
namespace nearby {
@@ -202,8 +202,7 @@ class BluetoothClassicMedium : public api::BluetoothClassicMedium {
// On error, returns nullptr.
std::unique_ptr<api::BluetoothSocket> ConnectToService(
api::BluetoothDevice& remote_device, const std::string& service_uuid,
CancellationFlag* cancellation_flag) override
ABSL_LOCKS_EXCLUDED(mutex_);
CancellationFlag* cancellation_flag) override ABSL_LOCKS_EXCLUDED(mutex_);
BluetoothAdapter& GetAdapter() { return *adapter_; }
+1 -1
View File
@@ -15,10 +15,10 @@
#ifndef PLATFORM_IMPL_G3_CONDITION_VARIABLE_H_
#define PLATFORM_IMPL_G3_CONDITION_VARIABLE_H_
#include "absl/synchronization/mutex.h"
#include "platform/api/condition_variable.h"
#include "platform/base/exception.h"
#include "platform/impl/g3/mutex.h"
#include "absl/synchronization/mutex.h"
namespace location {
namespace nearby {
+1 -1
View File
@@ -15,10 +15,10 @@
#ifndef PLATFORM_IMPL_G3_COUNT_DOWN_LATCH_H_
#define PLATFORM_IMPL_G3_COUNT_DOWN_LATCH_H_
#include "platform/api/count_down_latch.h"
#include "absl/base/thread_annotations.h"
#include "absl/synchronization/mutex.h"
#include "absl/time/clock.h"
#include "platform/api/count_down_latch.h"
namespace location {
namespace nearby {
+1 -1
View File
@@ -17,8 +17,8 @@
#include <cstdint>
#include <string>
#include "platform/base/byte_array.h"
#include "absl/strings/string_view.h"
#include "platform/base/byte_array.h"
#include "openssl/digest.h"
namespace location {
+1 -1
View File
@@ -15,7 +15,7 @@
#ifndef PLATFORM_IMPL_G3_LOG_MESSAGE_H_
#define PLATFORM_IMPL_G3_LOG_MESSAGE_H_
#include "base/logging.h"
#include "base/check.h"
#include "platform/api/log_message.h"
namespace location {
+2 -4
View File
@@ -17,9 +17,9 @@
#include <atomic>
#include "absl/time/clock.h"
#include "platform/api/submittable_executor.h"
#include "platform/impl/g3/count_down_latch.h"
#include "absl/time/clock.h"
#include "thread/threadpool.h"
namespace location {
@@ -59,9 +59,7 @@ class MultiThreadExecutor : public api::SubmittableExecutor {
bool InShutdown() const { return shutdown_; }
private:
void DoShutdown() {
shutdown_ = true;
}
void DoShutdown() { shutdown_ = true; }
std::atomic_bool shutdown_ = false;
ThreadPool thread_pool_;
};
+1 -1
View File
@@ -15,9 +15,9 @@
#ifndef PLATFORM_IMPL_G3_MUTEX_H_
#define PLATFORM_IMPL_G3_MUTEX_H_
#include "absl/synchronization/mutex.h"
#include "platform/api/mutex.h"
#include "platform/impl/shared/posix_mutex.h"
#include "absl/synchronization/mutex.h"
namespace location {
namespace nearby {
+1 -1
View File
@@ -33,7 +33,7 @@ class Pipe : public BasePipe {
Setup(std::move(mutex), std::move(cond));
}
~Pipe() override = default;
Pipe(Pipe &&) = delete;
Pipe(Pipe&&) = delete;
Pipe& operator=(Pipe&&) = delete;
};
+6 -6
View File
@@ -17,6 +17,10 @@
#include <atomic>
#include <memory>
#include "absl/base/integral_types.h"
#include "absl/memory/memory.h"
#include "absl/strings/str_cat.h"
#include "absl/time/time.h"
#include "platform/api/atomic_boolean.h"
#include "platform/api/atomic_reference.h"
#include "platform/api/ble_v2.h"
@@ -47,10 +51,6 @@
#include "platform/impl/g3/webrtc.h"
#include "platform/impl/g3/wifi_lan.h"
#include "platform/impl/shared/file.h"
#include "absl/base/integral_types.h"
#include "absl/memory/memory.h"
#include "absl/strings/str_cat.h"
#include "absl/time/time.h"
namespace location {
namespace nearby {
@@ -82,8 +82,8 @@ ImplementationPlatform::CreateScheduledExecutor() {
return absl::make_unique<g3::ScheduledExecutor>();
}
std::unique_ptr<AtomicUint32>
ImplementationPlatform::CreateAtomicUint32(std::uint32_t value) {
std::unique_ptr<AtomicUint32> ImplementationPlatform::CreateAtomicUint32(
std::uint32_t value) {
return absl::make_unique<g3::AtomicUint32>(value);
}
+1 -1
View File
@@ -17,9 +17,9 @@
#include <atomic>
#include <memory>
#include "absl/time/clock.h"
#include "platform/api/cancelable.h"
#include "platform/base/runnable.h"
#include "absl/time/clock.h"
namespace location {
namespace nearby {
+4 -7
View File
@@ -18,11 +18,11 @@
#include <atomic>
#include <memory>
#include "absl/time/clock.h"
#include "platform/api/cancelable.h"
#include "platform/api/scheduled_executor.h"
#include "platform/base/runnable.h"
#include "platform/impl/g3/single_thread_executor.h"
#include "absl/time/clock.h"
#include "thread/threadpool.h"
namespace location {
@@ -34,9 +34,7 @@ namespace g3 {
class ScheduledExecutor final : public api::ScheduledExecutor {
public:
ScheduledExecutor() = default;
~ScheduledExecutor() override {
executor_.Shutdown();
}
~ScheduledExecutor() override { executor_.Shutdown(); }
void Execute(Runnable&& runnable) override {
executor_.Execute(std::move(runnable));
@@ -45,9 +43,8 @@ class ScheduledExecutor final : public api::ScheduledExecutor {
absl::Duration delay) override;
void Shutdown() override { executor_.Shutdown(); }
int GetTid(int index) const override {
return executor_.GetTid(index);
}
int GetTid(int index) const override { return executor_.GetTid(index); }
private:
SingleThreadExecutor executor_;
};
+1 -1
View File
@@ -14,8 +14,8 @@
#include "platform/api/system_clock.h"
#include "platform/base/exception.h"
#include "absl/time/clock.h"
#include "platform/base/exception.h"
namespace location {
namespace nearby {
+1 -3
View File
@@ -50,9 +50,7 @@ void WebRtcSignalingMessenger::StopReceivingMessages() {
WebRtcMedium::~WebRtcMedium() { single_thread_executor_.Shutdown(); }
const std::string WebRtcMedium::GetDefaultCountryCode() {
return "US";
}
const std::string WebRtcMedium::GetDefaultCountryCode() { return "US"; }
void WebRtcMedium::CreatePeerConnection(
webrtc::PeerConnectionObserver* observer, PeerConnectionCallback callback) {
+1 -1
View File
@@ -17,9 +17,9 @@
#include <memory>
#include "absl/strings/string_view.h"
#include "platform/api/webrtc.h"
#include "platform/impl/g3/single_thread_executor.h"
#include "absl/strings/string_view.h"
#include "webrtc/api/peer_connection_interface.h"
namespace location {
+1 -1
View File
@@ -18,13 +18,13 @@
#include <memory>
#include <string>
#include "absl/synchronization/mutex.h"
#include "platform/api/wifi_lan.h"
#include "platform/base/cancellation_flag_listener.h"
#include "platform/base/logging.h"
#include "platform/base/medium_environment.h"
#include "platform/base/nsd_service_info.h"
#include "platform/base/prng.h"
#include "absl/synchronization/mutex.h"
namespace location {
namespace nearby {
+4 -5
View File
@@ -19,6 +19,9 @@
#include <string>
#include <utility>
#include "absl/container/flat_hash_map.h"
#include "absl/container/flat_hash_set.h"
#include "absl/synchronization/mutex.h"
#include "platform/api/wifi_lan.h"
#include "platform/base/byte_array.h"
#include "platform/base/input_stream.h"
@@ -26,9 +29,6 @@
#include "platform/base/output_stream.h"
#include "platform/impl/g3/multi_thread_executor.h"
#include "platform/impl/g3/pipe.h"
#include "absl/container/flat_hash_map.h"
#include "absl/container/flat_hash_set.h"
#include "absl/synchronization/mutex.h"
namespace location {
namespace nearby {
@@ -205,8 +205,7 @@ class WifiLanMedium : public api::WifiLanMedium {
std::unique_ptr<api::WifiLanSocket> Connect(
api::WifiLanService& remote_wifi_lan_service,
const std::string& service_id,
CancellationFlag* cancellation_flag) override
ABSL_LOCKS_EXCLUDED(mutex_);
CancellationFlag* cancellation_flag) override ABSL_LOCKS_EXCLUDED(mutex_);
api::WifiLanService* GetRemoteService(const std::string& ip_address,
int port) override;