0

Add SetCustomSavePath API to Nearby Connections

Custom Save Path is the number 1 requested feature from our Windows NS dogfooders program (https://docs.google.com/document/d/1EXQIANtujlTAA3AW7Ol3eSk6lO-1AATMJcARVUre1Bs/edit?usp=sharing&resourcekey=0-Z6V0m71wayqeTwf_pFEyaA). Therefore, we are planning to support this for Windows, but this requires adding an additional API to platform.h which requires adding this stub.

The relevant CLs are:
a) https://critique.corp.google.com/cl/482542038
b) https://critique.corp.google.com/cl/480953162
c) https://critique.corp.google.com/cl/483434698
d) https://critique.corp.google.com/cl/483437861
e) https://critique.corp.google.com/cl/482359860

Test: http://recall/-/enjTV9n45jvDulchchroVI/qtbwmkvneNrCKeRyJmc7P
Bug: b/253018423
Change-Id: Id75bb0aacc6d2cc43620061dc8f815c0bbc35294
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3990952
Reviewed-by: Crisrael Lucero <crisrael@google.com>
Reviewed-by: Ryan Hansberry <hansberry@chromium.org>
Commit-Queue: Aaron Yu <aaronyujiaze@google.com>
Cr-Commit-Position: refs/heads/main@{#1078888}
This commit is contained in:
Aaron Yu
2022-12-03 02:34:54 +00:00
committed by Chromium LUCI CQ
parent 6729f44e81
commit 8c9cadc411
3 changed files with 17 additions and 7 deletions
DEPS
chrome/services/sharing/nearby
third_party/nearby

2
DEPS

@ -434,7 +434,7 @@ vars = {
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling nearby
# and whatever else without interference from each other.
'nearby_revision': '2273c87b575e4c756d4d9394e1e37c84717baefa',
'nearby_revision': '49af1a96b6c135505614b5fbb269b48e525943bf',
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling securemessage
# and whatever else without interference from each other.

@ -57,14 +57,24 @@ int GetCurrentTid() {
return 0;
}
std::string ImplementationPlatform::GetCustomSavePath(
const std::string& parent_folder,
const std::string& file_name) {
// This should return the <saved_custom_path>/file_name. For now we will
// just return an empty string, since chrome doesn't call this yet.
// TODO(b/223710122): Eventually chrome should implement this method.
NOTIMPLEMENTED();
return std::string();
}
std::string ImplementationPlatform::GetDownloadPath(
absl::string_view parent_folder,
absl::string_view file_name) {
const std::string& parent_folder,
const std::string& file_name) {
// This should return the <download_path>/parent_folder/file_name. For now we
// will just return an empty string, since chrome doesn't call this yet.
// TODO(b/223710122): Eventually chrome should implement this method.
NOTIMPLEMENTED();
return std::string("");
return std::string();
}
OSName ImplementationPlatform::GetCurrentOS() {
@ -134,7 +144,7 @@ std::unique_ptr<InputFile> ImplementationPlatform::CreateInputFile(
}
std::unique_ptr<InputFile> ImplementationPlatform::CreateInputFile(
absl::string_view file_path,
const std::string& file_path,
size_t size) {
// This constructor is not called by Chrome. Returning nullptr, just in case.
// TODO(b/223710122): Eventually chrome should implement and use this
@ -152,7 +162,7 @@ std::unique_ptr<OutputFile> ImplementationPlatform::CreateOutputFile(
}
std::unique_ptr<OutputFile> ImplementationPlatform::CreateOutputFile(
absl::string_view file_path) {
const std::string& file_path) {
// This constructor is not called by Chrome. Returning nullptr, just in case.
// TODO(b/223710122): Eventually chrome should implement and use this
// constructor exclusively.

@ -1,7 +1,7 @@
Name: Nearby Connections Library
Short Name: Nearby
URL: https://github.com/google/nearby
Version: 2273c87b575e4c756d4d9394e1e37c84717baefa
Version: 49af1a96b6c135505614b5fbb269b48e525943bf
License: Apache 2.0
License File: LICENSE
Security Critical: yes