chromium/third_party/blink/renderer/core/fileapi/file.cc

/*
 * Copyright (C) 2008 Apple Inc. All Rights Reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

#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) {}

// static
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) {}

// static
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) {}

}  // namespace blink