chromium/third_party/blink/renderer/core/loader/modulescript/module_tree_linker.cc

// Copyright 2017 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "third_party/blink/renderer/core/loader/modulescript/module_tree_linker.h"

#include "third_party/blink/public/mojom/fetch/fetch_api_request.mojom-blink.h"
#include "third_party/blink/renderer/bindings/core/v8/module_record.h"
#include "third_party/blink/renderer/bindings/core/v8/module_request.h"
#include "third_party/blink/renderer/core/execution_context/execution_context.h"
#include "third_party/blink/renderer/core/frame/web_feature.h"
#include "third_party/blink/renderer/core/loader/modulescript/module_script_creation_params.h"
#include "third_party/blink/renderer/core/loader/modulescript/module_script_fetch_request.h"
#include "third_party/blink/renderer/core/loader/modulescript/module_tree_linker_registry.h"
#include "third_party/blink/renderer/core/script/module_script.h"
#include "third_party/blink/renderer/platform/bindings/v8_throw_exception.h"
#include "third_party/blink/renderer/platform/instrumentation/use_counter.h"
#include "third_party/blink/renderer/platform/loader/fetch/resource_fetcher.h"
#include "third_party/blink/renderer/platform/loader/fetch/resource_loading_log.h"
#include "third_party/blink/renderer/platform/weborigin/security_policy.h"
#include "third_party/blink/renderer/platform/wtf/vector.h"
#include "v8/include/v8.h"

// <specdef label="IMSGF"
// href="https://html.spec.whatwg.org/C/#internal-module-script-graph-fetching-procedure">

// <specdef label="fetch-a-module-script-tree"
// href="https://html.spec.whatwg.org/C/#fetch-a-module-script-tree">

// <specdef
// label="fetch-a-module-worker-script-tree"
// href="https://html.spec.whatwg.org/C/#fetch-a-module-worker-script-tree">

// <specdef label="fetch-an-import()-module-script-graph"
// href="https://html.spec.whatwg.org/C/#fetch-an-import()-module-script-graph">

namespace blink {

namespace {

struct ModuleScriptFetchTarget {};

}  // namespace

ModuleTreeLinker::ModuleTreeLinker(
    ResourceFetcher* fetch_client_settings_object_fetcher,
    mojom::blink::RequestContextType context_type,
    network::mojom::RequestDestination destination,
    Modulator* modulator,
    ModuleScriptCustomFetchType custom_fetch_type,
    ModuleTreeLinkerRegistry* registry,
    ModuleTreeClient* client,
    base::PassKey<ModuleTreeLinkerRegistry>)
    :{}

void ModuleTreeLinker::Trace(Visitor* visitor) const {}

#if DCHECK_IS_ON()
const char* ModuleTreeLinker::StateToString(ModuleTreeLinker::State state) {}
#endif

void ModuleTreeLinker::AdvanceState(State new_state) {}

// #fetch-a-module-script-tree, #fetch-an-import()-module-script-graph, and
// #fetch-a-module-worker-script-tree.
void ModuleTreeLinker::FetchRoot(const KURL& original_url,
                                 ModuleType module_type,
                                 const ScriptFetchOptions& options,
                                 base::PassKey<ModuleTreeLinkerRegistry>,
                                 String referrer) {}

// <specdef
// href="https://html.spec.whatwg.org/C/#fetch-an-inline-module-script-graph">
void ModuleTreeLinker::FetchRootInline(
    ModuleScript* module_script,
    base::PassKey<ModuleTreeLinkerRegistry>) {}

// Returning from #fetch-a-single-module-script, calling from
// #fetch-a-module-script-tree, #fetch-an-import()-module-script-graph, and
// #fetch-a-module-worker-script-tree, and IMSGF.
void ModuleTreeLinker::NotifyModuleLoadFinished(ModuleScript* module_script) {}

// <specdef
// href="https://html.spec.whatwg.org/C/#fetch-the-descendants-of-a-module-script">
// See also https://github.com/whatwg/html/pull/5658/ which adds ModuleRequest
// and module type to the HTML spec.
void ModuleTreeLinker::FetchDescendants(const ModuleScript* module_script) {}

void ModuleTreeLinker::FinalizeFetchDescendantsForOneModuleScript() {}

// <specdef
// href="https://html.spec.whatwg.org/C/#fetch-the-descendants-of-and-instantiate-a-module-script">
void ModuleTreeLinker::Instantiate() {}

// <specdef
// href="https://html.spec.whatwg.org/C/#finding-the-first-parse-error">
// This returns non-empty ScriptValue iff a parse error is found.
ScriptValue ModuleTreeLinker::FindFirstParseError(
    const ModuleScript* module_script,
    HeapHashSet<Member<const ModuleScript>>* discovered_set) const {}

#if DCHECK_IS_ON()
std::ostream& operator<<(std::ostream& stream, ModuleType module_type) {}

std::ostream& operator<<(std::ostream& stream, const ModuleTreeLinker& linker) {}
#endif

}  // namespace blink