Skip to content

Commit

Permalink
Stub out directory_lister.h in net_unittests (youtube#1326)
Browse files Browse the repository at this point in the history
b/296715826

Functions in directory_lister.h are unused.

Windows platform linkers for modular builds give linker erros because of
these undefined symbols.
  • Loading branch information
niranjanyardi authored Aug 22, 2023
1 parent 6c9118f commit 328c132
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
1 change: 1 addition & 0 deletions net/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -4248,6 +4248,7 @@ static_library("test_support") {
# "disk_cache/disk_cache_test_util.cc",
# "disk_cache/disk_cache_test_util.h",

"base/directory_lister.h",
"base/test_data_stream.cc",
"base/test_data_stream.h",
"quic/quic_test_packet_maker.cc",
Expand Down
32 changes: 32 additions & 0 deletions net/base/directory_lister.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class TaskRunner;

namespace net {

#if !defined(USE_COBALT_CUSTOMIZATIONS)
// This class provides an API for asynchronously listing the contents of a
// directory on the filesystem. It runs a task on a background thread, and
// enumerates all files in the specified directory on that thread. Destroying
Expand Down Expand Up @@ -135,6 +136,37 @@ class NET_EXPORT DirectoryLister {
DISALLOW_COPY_AND_ASSIGN(DirectoryLister);
};

#else

// TODO b/296715826 Fix stubbed out class.
class NET_EXPORT DirectoryLister {
public:
struct DirectoryListerData {
base::FileEnumerator::FileInfo info;
base::FilePath path;
base::FilePath absolute_path;
};
class DirectoryListerDelegate {
public:
virtual void OnListFile(const DirectoryListerData& data) = 0;

virtual void OnListDone(int error) = 0;

protected:
virtual ~DirectoryListerDelegate() {}
};
enum ListingType {};
DirectoryLister(const base::FilePath& dir,
DirectoryListerDelegate* delegate){};
DirectoryLister(const base::FilePath& dir,
ListingType type,
DirectoryListerDelegate* delegate){};
~DirectoryLister(){};
void Start() {};
void Cancel() {};
};

#endif // !defined(USE_COBALT_CUSTOMIZATIONS)
} // namespace net

#endif // NET_BASE_DIRECTORY_LISTER_H_

0 comments on commit 328c132

Please sign in to comment.