#include "third_party/blink/renderer/core/fileapi/file.h"
#include <memory>
#include "base/memory/scoped_refptr.h"
#include "third_party/blink/public/mojom/filesystem/file_system.mojom-blink.h"
#include "third_party/blink/public/platform/file_path_conversion.h"
#include "third_party/blink/public/platform/platform.h"
#include "third_party/blink/renderer/bindings/core/v8/to_v8_traits.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_file_property_bag.h"
#include "third_party/blink/renderer/core/core_initializer.h"
#include "third_party/blink/renderer/core/execution_context/execution_context.h"
#include "third_party/blink/renderer/core/fileapi/file_backed_blob_factory_dispatcher.h"
#include "third_party/blink/renderer/core/frame/web_feature.h"
#include "third_party/blink/renderer/core/html/forms/form_controller.h"
#include "third_party/blink/renderer/platform/bindings/exception_state.h"
#include "third_party/blink/renderer/platform/bindings/script_state.h"
#include "third_party/blink/renderer/platform/blob/blob_data.h"
#include "third_party/blink/renderer/platform/file_metadata.h"
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
#include "third_party/blink/renderer/platform/instrumentation/use_counter.h"
#include "third_party/blink/renderer/platform/network/mime/mime_type_registry.h"
#include "third_party/blink/renderer/platform/wtf/date_math.h"
#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"
namespace blink {
static String GetContentTypeFromFileName(const String& name,
File::ContentTypeLookupPolicy policy) { … }
static scoped_refptr<BlobDataHandle> CreateBlobDataHandleForFileWithType(
ExecutionContext* context,
const String& path,
const String& content_type) { … }
static scoped_refptr<BlobDataHandle> CreateBlobDataHandleForFile(
ExecutionContext* context,
const String& path,
File::ContentTypeLookupPolicy policy) { … }
static scoped_refptr<BlobDataHandle> CreateBlobDataHandleForFileWithName(
ExecutionContext* context,
const String& path,
const String& file_system_name,
File::ContentTypeLookupPolicy policy) { … }
static scoped_refptr<BlobDataHandle> CreateBlobDataHandleForFileWithMetadata(
ExecutionContext* context,
const String& file_system_name,
const FileMetadata& metadata) { … }
File* File::Create(ExecutionContext* context,
const HeapVector<Member<V8BlobPart>>& file_bits,
const String& file_name,
const FilePropertyBag* options) { … }
File* File::CreateFromControlState(ExecutionContext* context,
const FormControlState& state,
wtf_size_t& index) { … }
String File::PathFromControlState(const FormControlState& state,
wtf_size_t& index) { … }
File* File::CreateWithRelativePath(ExecutionContext* context,
const String& path,
const String& relative_path) { … }
File* File::CreateForFileSystemFile(ExecutionContext& context,
const KURL& url,
const FileMetadata& metadata,
UserVisibility user_visibility) { … }
File::File(ExecutionContext* context,
const String& path,
ContentTypeLookupPolicy policy,
UserVisibility user_visibility)
: … { … }
File::File(ExecutionContext* context,
const String& path,
const String& name,
ContentTypeLookupPolicy policy,
UserVisibility user_visibility)
: … { … }
File::File(const String& path,
const String& name,
const String& relative_path,
UserVisibility user_visibility,
bool has_snapshot_data,
uint64_t size,
const std::optional<base::Time>& last_modified,
scoped_refptr<BlobDataHandle> blob_data_handle)
: … { … }
File::File(const String& name,
const std::optional<base::Time>& modification_time,
scoped_refptr<BlobDataHandle> blob_data_handle)
: … { … }
File::File(ExecutionContext* context,
const String& name,
const FileMetadata& metadata,
UserVisibility user_visibility)
: … { … }
File::File(const KURL& file_system_url,
const FileMetadata& metadata,
UserVisibility user_visibility,
scoped_refptr<BlobDataHandle> blob_data_handle)
: … { … }
File::File(const File& other)
: … { … }
File* File::Clone(const String& name) const { … }
base::Time File::LastModifiedTime() const { … }
int64_t File::lastModified() const { … }
ScriptValue File::lastModifiedDate(ScriptState* script_state) const { … }
std::optional<base::Time> File::LastModifiedTimeForSerialization() const { … }
uint64_t File::size() const { … }
void File::CaptureSnapshotIfNeeded() const { … }
bool File::HasSameSource(const File& other) const { … }
bool File::AppendToControlState(FormControlState& state) { … }
}