chromium/third_party/blink/renderer/modules/content_index/content_index.cc

// Copyright 2019 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/modules/content_index/content_index.h"

#include <optional>

#include "base/feature_list.h"
#include "base/task/sequenced_task_runner.h"
#include "third_party/blink/public/platform/browser_interface_broker_proxy.h"
#include "third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_throw_dom_exception.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_content_icon_definition.h"
#include "third_party/blink/renderer/core/dom/dom_exception.h"
#include "third_party/blink/renderer/core/execution_context/execution_context.h"
#include "third_party/blink/renderer/modules/content_index/content_description_type_converter.h"
#include "third_party/blink/renderer/modules/content_index/content_index_icon_loader.h"
#include "third_party/blink/renderer/modules/service_worker/service_worker_registration.h"
#include "third_party/blink/renderer/platform/bindings/exception_state.h"
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
#include "third_party/blink/renderer/platform/heap/persistent.h"
#include "third_party/blink/renderer/platform/weborigin/security_origin.h"

namespace features {

// If enabled, registering content index entries will perform a check
// to see if the provided launch url is offline-capable.
BASE_FEATURE();

}  // namespace features

namespace blink {

namespace {

// Validates |description|. If there is an error, an error message to be passed
// to a TypeError is passed. Otherwise a null string is returned.
WTF::String ValidateDescription(const ContentDescription& description,
                                ServiceWorkerRegistration* registration) {}

}  // namespace

ContentIndex::ContentIndex(ServiceWorkerRegistration* registration,
                           scoped_refptr<base::SequencedTaskRunner> task_runner)
    :{}

ContentIndex::~ContentIndex() = default;

ScriptPromise<IDLUndefined> ContentIndex::add(
    ScriptState* script_state,
    const ContentDescription* description,
    ExceptionState& exception_state) {}

void ContentIndex::DidGetIconSizes(
    mojom::blink::ContentDescriptionPtr description,
    ScriptPromiseResolver<IDLUndefined>* resolver,
    const Vector<gfx::Size>& icon_sizes) {}

void ContentIndex::DidGetIcons(ScriptPromiseResolver<IDLUndefined>* resolver,
                               mojom::blink::ContentDescriptionPtr description,
                               Vector<SkBitmap> icons) {}

void ContentIndex::DidCheckOfflineCapability(
    KURL launch_url,
    mojom::blink::ContentDescriptionPtr description,
    Vector<SkBitmap> icons,
    ScriptPromiseResolver<IDLUndefined>* resolver,
    bool is_offline_capable) {}

void ContentIndex::DidAdd(ScriptPromiseResolver<IDLUndefined>* resolver,
                          mojom::blink::ContentIndexError error) {}

ScriptPromise<IDLUndefined> ContentIndex::deleteDescription(
    ScriptState* script_state,
    const String& id,
    ExceptionState& exception_state) {}

void ContentIndex::DidDeleteDescription(
    ScriptPromiseResolver<IDLUndefined>* resolver,
    mojom::blink::ContentIndexError error) {}

ScriptPromise<IDLSequence<ContentDescription>> ContentIndex::getDescriptions(
    ScriptState* script_state,
    ExceptionState& exception_state) {}

void ContentIndex::DidGetDescriptions(
    ScriptPromiseResolver<IDLSequence<ContentDescription>>* resolver,
    mojom::blink::ContentIndexError error,
    Vector<mojom::blink::ContentDescriptionPtr> descriptions) {}

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

mojom::blink::ContentIndexService* ContentIndex::GetService() {}

}  // namespace blink