Lines Matching refs:path

31 std::unique_ptr<Asset> AssetsProvider::Open(const std::string& path, Asset::AccessMode mode,  in Open()  argument
33 return OpenInternal(path, mode, file_exists); in Open()
36 std::unique_ptr<Asset> AssetsProvider::CreateAssetFromFile(const std::string& path) { in CreateAssetFromFile() argument
37 base::unique_fd fd(base::utf8::open(path.c_str(), O_RDONLY | O_CLOEXEC)); in CreateAssetFromFile()
39 LOG(ERROR) << "Failed to open file '" << path << "': " << base::SystemErrorCodeToString(errno); in CreateAssetFromFile()
43 return CreateAssetFromFd(std::move(fd), path.c_str()); in CreateAssetFromFile()
47 const char* path, in CreateAssetFromFd() argument
56 LOG(ERROR) << "Failed to get size of file '" << ((path) ? path : "anon") << "': " in CreateAssetFromFd()
63 if (!file_map.Create(fd, offset, static_cast<size_t>(length), path)) { in CreateAssetFromFd()
64 LOG(ERROR) << "Failed to mmap file '" << ((path != nullptr) ? path : "anon") << "': " in CreateAssetFromFd()
73 (path != nullptr) ? base::unique_fd(-1) : std::move(fd)); in CreateAssetFromFd()
88 ZipAssetsProvider::ZipAssetsProvider(ZipArchiveHandle handle, PathOrDebugName&& path, in ZipAssetsProvider() argument
91 name_(std::move(path)), in ZipAssetsProvider()
95 std::unique_ptr<ZipAssetsProvider> ZipAssetsProvider::Create(std::string path, in Create() argument
100 if (int32_t result = released_fd < 0 ? OpenArchive(path.c_str(), &handle) in Create()
101 : OpenArchiveFd(released_fd, path.c_str(), &handle)) { in Create()
102 LOG(ERROR) << "Failed to open APK '" << path << "': " << ::ErrorCodeString(result); in Create()
109 if (!isReadonlyFilesystem(path.c_str())) { in Create()
110 if ((released_fd < 0 ? stat(path.c_str(), &sb) : fstat(released_fd, &sb)) < 0) { in Create()
114 PLOG(WARNING) << "Failed to stat file '" << path << "'"; in Create()
119 new ZipAssetsProvider(handle, PathOrDebugName::Path(std::move(path)), flags, sb.st_mtime)); in Create()
156 std::unique_ptr<Asset> ZipAssetsProvider::OpenInternal(const std::string& path, in OpenInternal() argument
164 if (FindEntry(zip_handle_.get(), path, &entry) != 0) { in OpenInternal()
179 LOG(ERROR) << "Failed to mmap file '" << path << "' in APK '" << name_.GetDebugName() in OpenInternal()
187 LOG(ERROR) << "Failed to decompress '" << path << "' in APK '" << name_.GetDebugName() in OpenInternal()
196 LOG(ERROR) << "Failed to mmap file '" << path << "' in APK '" << name_.GetDebugName() << "'"; in OpenInternal()
207 LOG(ERROR) << "Unable to dup fd '" << path << "' in APK '" << name_.GetDebugName() << "'"; in OpenInternal()
214 LOG(ERROR) << "Failed to mmap file '" << path << "' in APK '" << name_.GetDebugName() << "'"; in OpenInternal()
266 std::optional<uint32_t> ZipAssetsProvider::GetCrc(std::string_view path) const { in GetCrc()
268 if (FindEntry(zip_handle_.get(), path, &entry) != 0) { in GetCrc()
298 DirectoryAssetsProvider::DirectoryAssetsProvider(std::string&& path, time_t last_mod_time) in DirectoryAssetsProvider() argument
299 : dir_(std::move(path)), last_mod_time_(last_mod_time) {} in DirectoryAssetsProvider()
301 std::unique_ptr<DirectoryAssetsProvider> DirectoryAssetsProvider::Create(std::string path) { in Create() argument
303 const int result = stat(path.c_str(), &sb); in Create()
305 LOG(ERROR) << "Failed to find directory '" << path << "'."; in Create()
310 LOG(ERROR) << "Path '" << path << "' is not a directory."; in Create()
314 if (path.back() != OS_PATH_SEPARATOR) { in Create()
315 path += OS_PATH_SEPARATOR; in Create()
318 const bool isReadonly = isReadonlyFilesystem(path.c_str()); in Create()
320 new DirectoryAssetsProvider(std::move(path), isReadonly ? -1 : sb.st_mtime)); in Create()
323 std::unique_ptr<Asset> DirectoryAssetsProvider::OpenInternal(const std::string& path, in OpenInternal() argument
326 const std::string resolved_path = dir_ + path; in OpenInternal()
379 std::unique_ptr<Asset> MultiAssetsProvider::OpenInternal(const std::string& path, in OpenInternal() argument
382 auto asset = primary_->Open(path, mode, file_exists); in OpenInternal()
383 return (asset) ? std::move(asset) : secondary_->Open(path, mode, file_exists); in OpenInternal()
404 EmptyAssetsProvider::EmptyAssetsProvider(std::optional<std::string>&& path) : in EmptyAssetsProvider() argument
405 path_(std::move(path)) {} in EmptyAssetsProvider()
411 std::unique_ptr<AssetsProvider> EmptyAssetsProvider::Create(std::string path) { in Create() argument
412 return std::unique_ptr<EmptyAssetsProvider>(new EmptyAssetsProvider(std::move(path))); in Create()