diff --git a/connections/clients/ios/Internal/GNCPayloadListener.mm b/connections/clients/ios/Internal/GNCPayloadListener.mm index 037e0711..128375b4 100644 --- a/connections/clients/ios/Internal/GNCPayloadListener.mm +++ b/connections/clients/ios/Internal/GNCPayloadListener.mm @@ -147,8 +147,7 @@ void GNCPayloadListener::OnPayload(const std::string &endpoint_id, Payload paylo case PayloadType::kFile: if (handlers.filePayloadHandler) { InputFile *payloadInputFile = payload.AsFile(); - NSString *fileString = - ObjCStringFromCppString(std::string(payloadInputFile->GetFilePath())); + NSString *fileString = ObjCStringFromCppString(payloadInputFile->GetFilePath()); NSURL *fileURL = [NSURL fileURLWithPath:fileString]; int64_t fileSize = payloadInputFile->GetTotalSize(); NSProgress *progress = [NSProgress progressWithTotalUnitCount:fileSize]; diff --git a/connections/clients/windows/dart/core_adapter_dart.h b/connections/clients/windows/dart/core_adapter_dart.h index 5c83c8b4..084ffb06 100644 --- a/connections/clients/windows/dart/core_adapter_dart.h +++ b/connections/clients/windows/dart/core_adapter_dart.h @@ -42,9 +42,6 @@ struct Mediums { int64_t ble; int64_t wifi_lan; int64_t wifi_hotspot; - int64_t nfc; - int64_t wifi_aware; - int64_t wifi_direct; int64_t web_rtc; // LINT.ThenChange(//depot/google3/location/nearby/apps/helloconnections/flutter/lib/mediums.dart) }; @@ -56,7 +53,6 @@ struct AdvertisingOptionsDart { StrategyDart strategy; int64_t auto_upgrade_bandwidth; int64_t enforce_topology_constraints; - int64_t use_fast_advertisements; int64_t low_power; // Whether this is intended to be used in conjunction with InjectEndpoint(). @@ -77,12 +73,10 @@ struct ConnectionOptionsDart { // Whether this is intended to be used in conjunction with InjectEndpoint(). int64_t is_out_of_band_connection = false; - - int64_t keep_alive_interval_millis; - int64_t keep_alive_timeout_millis; - char *remote_bluetooth_mac_address; char *fast_advertisement_service_uuid; + int64_t keep_alive_interval_millis; + int64_t keep_alive_timeout_millis; Mediums mediums; // LINT.ThenChange(//depot/google3/location/nearby/apps/helloconnections/flutter/lib/connection_options.dart) @@ -93,14 +87,11 @@ struct DiscoveryOptionsDart { StrategyDart strategy; int64_t auto_upgrade_bandwidth; int64_t enforce_topology_constraints; - int64_t discover_fast_advertisements; - - // Whether this is intended to be used in conjunction with InjectEndpoint(). - int64_t is_out_of_band_connection = false; - int64_t keep_alive_interval_millis = 0; int64_t keep_alive_timeout_millis = 0; + // Whether this is intended to be used in conjunction with InjectEndpoint(). + int64_t is_out_of_band_connection = false; const char *fast_advertisement_service_uuid; const char *remote_bluetooth_mac_address; diff --git a/connections/clients/windows/medium_selector_w.h b/connections/clients/windows/medium_selector_w.h index 4669d986..9cf056c3 100644 --- a/connections/clients/windows/medium_selector_w.h +++ b/connections/clients/windows/medium_selector_w.h @@ -25,26 +25,21 @@ template struct MediumSelectorW { T bluetooth; T ble; + T web_rtc; T wifi_lan; T wifi_hotspot; - T nfc; - T wifi_aware; - T wifi_direct; - T web_rtc; constexpr MediumSelectorW() = default; constexpr MediumSelectorW(const MediumSelectorW&) = default; constexpr MediumSelectorW& operator=(const MediumSelectorW&) = default; constexpr bool Any(const T& value) const { - return bluetooth == value || ble == value || wifi_lan == value || - wifi_hotspot == value || nfc == value || wifi_aware == value || - wifi_direct == value || web_rtc == value; + return bluetooth == value || ble == value || web_rtc == value || + wifi_lan == value || wifi_hotspot == value; } constexpr bool All(const T& value) const { - return bluetooth == value && ble == value && wifi_lan == value && - wifi_hotspot == value && nfc == value && wifi_aware == value && - wifi_direct == value && web_rtc == value; + return bluetooth == value && ble == value && web_rtc == value && + wifi_lan == value && wifi_hotspot == value; } constexpr int Count(const T& value) const { @@ -53,9 +48,6 @@ struct MediumSelectorW { if (ble == value) ++count; if (wifi_lan == value) ++count; if (wifi_hotspot == value) ++count; - if (nfc == value) ++count; - if (wifi_aware == value) ++count; - if (wifi_direct == value) ++count; if (web_rtc == value) ++count; return count; } @@ -63,12 +55,9 @@ struct MediumSelectorW { constexpr MediumSelectorW& SetAll(const T& value) { bluetooth = value; ble = value; + web_rtc = value; wifi_lan = value; wifi_hotspot = value; - nfc = value; - wifi_aware = value; - wifi_direct = value; - web_rtc = value; return *this; } @@ -80,9 +69,6 @@ struct MediumSelectorW { if (web_rtc == value) mediums.push_back(MediumW::WEB_RTC); if (bluetooth == value) mediums.push_back(MediumW::BLUETOOTH); if (ble == value) mediums.push_back(MediumW::BLE); - if (nfc == value) mediums.push_back(MediumW::NFC); - if (wifi_aware == value) mediums.push_back(MediumW::WIFI_AWARE); - if (wifi_direct == value) mediums.push_back(MediumW::WIFI_DIRECT); return mediums; } }; diff --git a/connections/payload.cc b/connections/payload.cc index b30e9d5c..9b05384d 100644 --- a/connections/payload.cc +++ b/connections/payload.cc @@ -21,14 +21,14 @@ namespace nearby { namespace connections { namespace { -std::string_view SepFinder(std::string_view s, size_t index) { - std::string_view filename = s.substr(index + 1, s.length() - index); +std::string SepFinder(std::string s, size_t index) { + std::string filename = s.substr(index + 1, s.length() - index); size_t lastindex = filename.find_last_of('.'); - std::string_view rawname = filename.substr(0, lastindex); + std::string rawname = filename.substr(0, lastindex); return rawname; } -std::string_view getFileName(const std::string_view s) { +std::string getFileName(const std::string& s) { char forwardSep = '/'; char backwardSep = '\\'; @@ -46,20 +46,20 @@ std::string_view getFileName(const std::string_view s) { // and if backward sep doesn't exist if (lastBackwardSepIndex == std::string::npos) { // Construct filename from forward sep - std::string_view rawname = SepFinder(s, lastForwardSepIndex); + std::string rawname = SepFinder(s, lastForwardSepIndex); return (rawname); } // backward sep also exists if (lastForwardSepIndex > lastBackwardSepIndex) { // the forward sep is the last - std::string_view rawname = SepFinder(s, lastForwardSepIndex); + std::string rawname = SepFinder(s, lastForwardSepIndex); return (rawname); } // The backward sep is the last - std::string_view rawname = SepFinder(s, lastBackwardSepIndex); + std::string rawname = SepFinder(s, lastBackwardSepIndex); return (rawname); } - std::string_view rawname = SepFinder(s, lastBackwardSepIndex); + std::string rawname = SepFinder(s, lastBackwardSepIndex); return (rawname); } @@ -84,7 +84,7 @@ Payload::Payload(const ByteArray& bytes) : type_(PayloadType::kBytes), content_(bytes) {} Payload::Payload(InputFile input_file) - : id_(std::hash()(input_file.GetFilePath())), + : id_(std::hash()(input_file.GetFilePath())), file_name_(getFileName(input_file.GetFilePath())), type_(PayloadType::kFile), content_(std::move(input_file)) {} @@ -97,7 +97,7 @@ Payload::Payload(Id id, InputFile input_file) Payload::Payload(std::string parent_folder, std::string file_name, InputFile input_file) - : id_(std::hash()(input_file.GetFilePath())), + : id_(std::hash()(input_file.GetFilePath())), parent_folder_(parent_folder), file_name_(file_name), type_(PayloadType::kFile), diff --git a/internal/platform/file.cc b/internal/platform/file.cc index 9aabab66..c1516467 100644 --- a/internal/platform/file.cc +++ b/internal/platform/file.cc @@ -33,7 +33,7 @@ ExceptionOr InputFile::Read(std::int64_t size) { } // Returns a string that uniqely identifies this file. -std::string_view InputFile::GetFilePath() const { return impl_->GetFilePath(); } +std::string InputFile::GetFilePath() const { return impl_->GetFilePath(); } // Returns total size of this file in bytes. std::int64_t InputFile::GetTotalSize() const { return impl_->GetTotalSize(); } diff --git a/internal/platform/file.h b/internal/platform/file.h index b08e8ee1..93be7af3 100644 --- a/internal/platform/file.h +++ b/internal/platform/file.h @@ -50,7 +50,7 @@ class InputFile final { ExceptionOr Read(std::int64_t size); // Returns a string that uniqely identifies this file. - std::string_view GetFilePath() const; + std::string GetFilePath() const; // Returns total size of this file in bytes. std::int64_t GetTotalSize() const; diff --git a/internal/platform/implementation/input_file.h b/internal/platform/implementation/input_file.h index 437fdd7a..4129b52a 100644 --- a/internal/platform/implementation/input_file.h +++ b/internal/platform/implementation/input_file.h @@ -29,7 +29,7 @@ namespace api { class InputFile : public InputStream { public: ~InputFile() override = default; - virtual std::string_view GetFilePath() const = 0; + virtual std::string GetFilePath() const = 0; virtual std::int64_t GetTotalSize() const = 0; }; diff --git a/internal/platform/implementation/shared/file.h b/internal/platform/implementation/shared/file.h index 663eb134..2efcc6d4 100644 --- a/internal/platform/implementation/shared/file.h +++ b/internal/platform/implementation/shared/file.h @@ -35,7 +35,9 @@ class IOFile final : public api::InputFile, public api::OutputFile { static std::unique_ptr CreateOutputFile(const absl::string_view path); ExceptionOr Read(std::int64_t size) override; - std::string_view GetFilePath() const override { return path_; } + std::string GetFilePath() const override { + return std::string(path_.data(), path_.size()); + } std::int64_t GetTotalSize() const override { return total_size_; } Exception Close() override; diff --git a/internal/platform/implementation/windows/bluetooth_adapter.cc b/internal/platform/implementation/windows/bluetooth_adapter.cc index ab561817..21cf2703 100644 --- a/internal/platform/implementation/windows/bluetooth_adapter.cc +++ b/internal/platform/implementation/windows/bluetooth_adapter.cc @@ -52,7 +52,8 @@ BluetoothAdapter::BluetoothAdapter() { winrt::Windows::Devices::Bluetooth::BluetoothAdapter::GetDefaultAsync() .get(); if (windows_bluetooth_adapter_ == nullptr) { - NEARBY_LOGS(ERROR) << __func__ << ": No Bluetooth adapter on this device."; + NEARBY_LOGS(ERROR) + << __func__ << ": No Bluetooth adapter on this device."; } else { // Gets the radio represented by this Bluetooth adapter. // https://docs.microsoft.com/en-us/uwp/api/windows.devices.bluetooth.bluetoothadapter.getradioasync?view=winrt-20348 @@ -64,7 +65,8 @@ BluetoothAdapter::BluetoothAdapter() { // returns true if the operation was a success. bool BluetoothAdapter::SetStatus(Status status) { if (windows_bluetooth_radio_ == nullptr) { - NEARBY_LOGS(ERROR) << __func__ << ": No Bluetooth radio on this device."; + NEARBY_LOGS(ERROR) + << __func__ << ": No Bluetooth radio on this device."; return false; } if (status == Status::kDisabled) { @@ -82,7 +84,8 @@ bool BluetoothAdapter::SetStatus(Status status) { // Status::Value::kEnabled. bool BluetoothAdapter::IsEnabled() const { if (windows_bluetooth_radio_ == nullptr) { - NEARBY_LOGS(ERROR) << __func__ << ": No Bluetooth radio on this device."; + NEARBY_LOGS(ERROR) + << __func__ << ": No Bluetooth radio on this device."; return false; } // Gets the current state of the radio represented by this object. @@ -151,7 +154,7 @@ std::string BluetoothAdapter::GetName() const { // key if (status == ERROR_SUCCESS) { - DWORD local_name_size = 0; + DWORD local_name_size; DWORD value_type; // Retrieves the size of the data for the specified value name associated @@ -170,42 +173,42 @@ std::string BluetoothAdapter::GetName() const { &local_name_size); // A pointer to a variable that specifies the // size of the buffer pointed to by the lpData // parameter, in bytes. - if (status == ERROR_SUCCESS) { - unsigned char *local_name = new unsigned char[local_name_size]; - memset(local_name, '\0', local_name_size); - - status = RegQueryValueExA( - hKey, // A handle to an open registry key. - BLUETOOTH_RADIO_REGISTRY_NAME_KEY, // The name of the registry - // value. - nullptr, // This parameter is reserved and must be NULL. - &value_type, // A pointer to a variable that receives a code - // indicating the type of data stored in the - // specified value. - local_name, // A pointer to a buffer that - // receives the value's data. - &local_name_size); // A pointer to a variable that specifies the - // size of the buffer pointed to by the lpData - // parameter, in bytes. - - // Closes a handle to the specified registry key. - // https://docs.microsoft.com/en-us/windows/win32/api/winreg/nf-winreg-regclosekey - RegCloseKey(hKey); - - if (status == ERROR_SUCCESS) { - std::string local_name_return = std::string( - local_name, local_name + local_name_size / sizeof local_name[0]); - - delete[] local_name; - - return local_name_return; - } - delete[] local_name; - } else { + if (status != ERROR_SUCCESS) { NEARBY_LOGS(ERROR) << __func__ << ": Failed to get the required size of the local name buffer"; + return {}; } + unsigned char *local_name = new unsigned char[local_name_size]; + memset(local_name, '\0', local_name_size); + + status = RegQueryValueExA( + hKey, // A handle to an open registry key. + BLUETOOTH_RADIO_REGISTRY_NAME_KEY, // The name of the registry + // value. + nullptr, // This parameter is reserved and must be NULL. + &value_type, // A pointer to a variable that receives a code + // indicating the type of data stored in the + // specified value. + local_name, // A pointer to a buffer that + // receives the value's data. + &local_name_size); // A pointer to a variable that specifies the + // size of the buffer pointed to by the lpData + // parameter, in bytes. + + // Closes a handle to the specified registry key. + // https://docs.microsoft.com/en-us/windows/win32/api/winreg/nf-winreg-regclosekey + RegCloseKey(hKey); + + if (status == ERROR_SUCCESS) { + std::string local_name_return = std::string( + local_name, local_name + local_name_size / sizeof local_name[0]); + + delete[] local_name; + + return local_name_return; + } + delete[] local_name; } // The local name is not in the registry, return the machine name @@ -219,7 +222,7 @@ std::string BluetoothAdapter::GetName() const { return {}; } - local_name.resize(name_size); + local_name.reserve(name_size); // Retrieves the NetBIOS name of the local computer. // https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-getcomputernamea @@ -395,8 +398,9 @@ bool BluetoothAdapter::SetName(absl::string_view name) { 0, // This parameter is reserved and must be zero. REG_BINARY, // The type of data pointed to by the lpData parameter. (LPBYTE)std::string(name).c_str(), // The data to be stored. - std::string(name).size()); // The size of the information pointed - // to by the lpData parameter, in bytes. + strlen(std::string(name) + .c_str())); // The size of the information pointed + // to by the lpData parameter, in bytes. } else { // If we are told to set the key to "", we treat this as a reset // If we delete the key value the OS will default to the system @@ -547,7 +551,8 @@ char *BluetoothAdapter::GetGenericBluetoothAdapterInstanceID(void) const { // Returns BT MAC address assigned to this adapter. std::string BluetoothAdapter::GetMacAddress() const { if (windows_bluetooth_adapter_ == nullptr) { - NEARBY_LOGS(ERROR) << __func__ << ": No Bluetooth adapter on this device."; + NEARBY_LOGS(ERROR) + << __func__ << ": No Bluetooth adapter on this device."; return ""; } return uint64_to_mac_address_string( diff --git a/internal/platform/implementation/windows/bluetooth_classic_medium.cc b/internal/platform/implementation/windows/bluetooth_classic_medium.cc index fd672aae..d93d88ac 100644 --- a/internal/platform/implementation/windows/bluetooth_classic_medium.cc +++ b/internal/platform/implementation/windows/bluetooth_classic_medium.cc @@ -68,7 +68,6 @@ void BluetoothClassicMedium::OnScanModeChanged( bool BluetoothClassicMedium::StartDiscovery( BluetoothClassicMedium::DiscoveryCallback discovery_callback) { EnterCriticalSection(&critical_section_); - NEARBY_LOGS(INFO) << "StartDisovery entered critical section."; bool result = false; discovery_callback_ = discovery_callback; @@ -78,14 +77,13 @@ bool BluetoothClassicMedium::StartDiscovery( } LeaveCriticalSection(&critical_section_); - NEARBY_LOGS(INFO) << "StartDisovery left critical section."; return result; } bool BluetoothClassicMedium::StopDiscovery() { EnterCriticalSection(&critical_section_); - NEARBY_LOGS(INFO) << "StopDiscovery entered critical section."; + bool result = false; if (IsWatcherStarted()) { @@ -93,7 +91,6 @@ bool BluetoothClassicMedium::StopDiscovery() { } LeaveCriticalSection(&critical_section_); - NEARBY_LOGS(INFO) << "StopDiscovery left critical section."; return result; } @@ -185,7 +182,6 @@ std::unique_ptr BluetoothClassicMedium::ConnectToService( } EnterCriticalSection(&critical_section_); - NEARBY_LOGS(INFO) << "ConnectToService entered critical section."; std::unique_ptr rfcommSocket = std::make_unique(); @@ -204,13 +200,11 @@ std::unique_ptr BluetoothClassicMedium::ConnectToService( << exception.what(); LeaveCriticalSection(&critical_section_); - NEARBY_LOGS(INFO) << "ConnectToService left critical section."; return nullptr; } LeaveCriticalSection(&critical_section_); - NEARBY_LOGS(INFO) << "ConnectToService left critical section."; return rfcommSocket; } @@ -372,9 +366,6 @@ bool BluetoothClassicMedium::StopScanning() { winrt::fire_and_forget BluetoothClassicMedium::DeviceWatcher_Added( DeviceWatcher sender, DeviceInformation deviceInfo) { - EnterCriticalSection(&critical_section_); - NEARBY_LOGS(INFO) << "DeviceWatcher_Added entered critical section."; - NEARBY_LOGS(INFO) << "Device added " << winrt::to_string(deviceInfo.Id()); if (IsWatcherStarted()) { // Represents a Bluetooth device. // https://docs.microsoft.com/en-us/uwp/api/windows.devices.bluetooth.bluetoothdevice?view=winrt-20348 @@ -387,52 +378,45 @@ winrt::fire_and_forget BluetoothClassicMedium::DeviceWatcher_Added( // Add to our internal list if necessary if (it != discovered_devices_by_id_.end()) { - // We're already tracking this one NEARBY_LOGS(INFO) << - // "DeviceWatcher_Added entered critical section."; - - LeaveCriticalSection(&critical_section_); - NEARBY_LOGS(INFO) << "DeviceWatcher_Added left critical section."; - + // We're already tracking this one return winrt::fire_and_forget(); } // Create a bluetooth device out of this id - auto bluetoothDevice = - winrt::Windows::Devices::Bluetooth::BluetoothDevice::FromIdAsync( - deviceInfo.Id()) - .get(); + winrt::Windows::Devices::Bluetooth::BluetoothDevice::FromIdAsync( + deviceInfo.Id()) + .Completed([this, deviceInfo]( + winrt::Windows::Foundation::IAsyncOperation< + winrt::Windows::Devices::Bluetooth::BluetoothDevice> + bluetoothDevice, + winrt::Windows::Foundation::AsyncStatus status) { + EnterCriticalSection(&critical_section_); - auto bluetoothDeviceP = - absl::WrapUnique(new BluetoothDevice(bluetoothDevice)); + auto bluetoothDeviceP = + absl::WrapUnique(new BluetoothDevice(bluetoothDevice.get())); - discovered_devices_by_id_[deviceInfo.Id()] = std::move(bluetoothDeviceP); + discovered_devices_by_id_[deviceInfo.Id()] = + std::move(bluetoothDeviceP); - if (discovery_callback_.device_discovered_cb != nullptr) { - discovery_callback_.device_discovered_cb( - *discovered_devices_by_id_[deviceInfo.Id()]); - } + if (discovery_callback_.device_discovered_cb != nullptr) { + discovery_callback_.device_discovered_cb( + *discovered_devices_by_id_[deviceInfo.Id()]); + } + + LeaveCriticalSection(&critical_section_); + }); } - LeaveCriticalSection(&critical_section_); - NEARBY_LOGS(INFO) << "DeviceWatcher_Added left critical section."; - return winrt::fire_and_forget(); } winrt::fire_and_forget BluetoothClassicMedium::DeviceWatcher_Updated( DeviceWatcher sender, DeviceInformationUpdate deviceInfoUpdate) { EnterCriticalSection(&critical_section_); - NEARBY_LOGS(INFO) << "DeviceWatcher_Updated entered critical section."; - - NEARBY_LOGS(INFO) - << "Device updated " - << discovered_devices_by_id_[deviceInfoUpdate.Id()]->GetName() << " (" - << winrt::to_string(deviceInfoUpdate.Id()) << ")"; if (!IsWatcherStarted()) { // Spurious call, watcher has stopped or wasn't started LeaveCriticalSection(&critical_section_); - NEARBY_LOGS(INFO) << "DeviceWatcher_Updated left critical section."; return winrt::fire_and_forget(); } @@ -440,7 +424,6 @@ winrt::fire_and_forget BluetoothClassicMedium::DeviceWatcher_Updated( if (it == discovered_devices_by_id_.end()) { LeaveCriticalSection(&critical_section_); - NEARBY_LOGS(INFO) << "DeviceWatcher_Updated left critical section."; // Not tracking this device return winrt::fire_and_forget(); } @@ -452,7 +435,6 @@ winrt::fire_and_forget BluetoothClassicMedium::DeviceWatcher_Updated( } LeaveCriticalSection(&critical_section_); - NEARBY_LOGS(INFO) << "DeviceWatcher_Updated left critical section."; return winrt::fire_and_forget(); } @@ -460,15 +442,8 @@ winrt::fire_and_forget BluetoothClassicMedium::DeviceWatcher_Updated( winrt::fire_and_forget BluetoothClassicMedium::DeviceWatcher_Removed( DeviceWatcher sender, DeviceInformationUpdate deviceInfo) { EnterCriticalSection(&critical_section_); - NEARBY_LOGS(INFO) << "DeviceWatcher_Removed entered critical section."; - NEARBY_LOGS(INFO) << "Device removed " - << discovered_devices_by_id_[deviceInfo.Id()]->GetName() - << " (" << winrt::to_string(deviceInfo.Id()) << ")"; if (!IsWatcherStarted()) { - LeaveCriticalSection(&critical_section_); - NEARBY_LOGS(INFO) << "DeviceWatcher_Removed left critical section."; - return winrt::fire_and_forget(); } @@ -480,7 +455,6 @@ winrt::fire_and_forget BluetoothClassicMedium::DeviceWatcher_Removed( discovered_devices_by_id_.erase(deviceInfo.Id()); LeaveCriticalSection(&critical_section_); - NEARBY_LOGS(INFO) << "DeviceWatcher_Removed left critical section."; return winrt::fire_and_forget(); } diff --git a/internal/platform/implementation/windows/bluetooth_classic_server_socket.h b/internal/platform/implementation/windows/bluetooth_classic_server_socket.h index f1448860..6e9811e8 100644 --- a/internal/platform/implementation/windows/bluetooth_classic_server_socket.h +++ b/internal/platform/implementation/windows/bluetooth_classic_server_socket.h @@ -96,9 +96,7 @@ class BluetoothServerSocket : public api::BluetoothServerSocket { void SetScanMode(bool radioDiscoverable) { StopAdvertising(); radio_discoverable_ = radioDiscoverable; - if (radio_discoverable_) { - StartAdvertising(); - } + StartAdvertising(); } private: diff --git a/internal/platform/implementation/windows/input_file.h b/internal/platform/implementation/windows/input_file.h index aa74e5e7..c9ac8792 100644 --- a/internal/platform/implementation/windows/input_file.h +++ b/internal/platform/implementation/windows/input_file.h @@ -29,7 +29,7 @@ class InputFile : public api::InputFile { // TODO(b/184975123): replace with real implementation. ~InputFile() override = default; // TODO(b/184975123): replace with real implementation. - std::string_view GetFilePath() const override { return "Un-implemented"; } + std::string GetFilePath() const override { return "Un-implemented"; } // TODO(b/184975123): replace with real implementation. std::int64_t GetTotalSize() const override { return 0; }