chromium/content/public/renderer/content_renderer_client.cc

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

#include "content/public/renderer/content_renderer_client.h"

#include <string_view>

#include "base/command_line.h"
#include "base/task/sequenced_task_runner.h"
#include "base/task/single_thread_task_runner.h"
#include "build/build_config.h"
#include "build/chromecast_buildflags.h"
#include "content/public/common/content_switches.h"
#include "media/base/demuxer.h"
#include "media/base/renderer_factory.h"
#include "third_party/blink/public/common/security/protocol_handler_security_level.h"
#include "third_party/blink/public/platform/web_audio_device.h"
#include "third_party/blink/public/platform/web_prescient_networking.h"
#include "ui/gfx/icc_profile.h"
#include "url/gurl.h"
#include "url/origin.h"
#include "v8/include/v8-initialization.h"

namespace content {

void ContentRendererClient::SetUpWebAssemblyTrapHandler() {}

SkBitmap* ContentRendererClient::GetSadPluginBitmap() {}

SkBitmap* ContentRendererClient::GetSadWebViewBitmap() {}

bool ContentRendererClient::IsPluginHandledExternally(
    RenderFrame* embedder_frame,
    const blink::WebElement& owner_element,
    const GURL& original_url,
    const std::string& original_mime_type) {}

bool ContentRendererClient::IsDomStorageDisabled() const {}

v8::Local<v8::Object> ContentRendererClient::GetScriptableObject(
    const blink::WebElement& plugin_element,
    v8::Isolate* isolate) {}

bool ContentRendererClient::OverrideCreatePlugin(
    RenderFrame* render_frame,
    const blink::WebPluginParams& params,
    blink::WebPlugin** plugin) {}

blink::WebPlugin* ContentRendererClient::CreatePluginReplacement(
    RenderFrame* render_frame,
    const base::FilePath& plugin_path) {}

void ContentRendererClient::PrepareErrorPageForHttpStatusError(
    content::RenderFrame* render_frame,
    const blink::WebURLError& error,
    const std::string& http_method,
    int http_status,
    mojom::AlternativeErrorPageOverrideInfoPtr alternative_error_page_info,
    std::string* error_html) {}

bool ContentRendererClient::DeferMediaLoad(RenderFrame* render_frame,
                                           bool has_played_media_before,
                                           base::OnceClosure closure) {}

std::unique_ptr<media::Demuxer> ContentRendererClient::OverrideDemuxerForUrl(
    RenderFrame* render_frame,
    const GURL& url,
    scoped_refptr<base::SequencedTaskRunner> task_runner) {}

std::unique_ptr<blink::WebSocketHandshakeThrottleProvider>
ContentRendererClient::CreateWebSocketHandshakeThrottleProvider() {}

bool ContentRendererClient::ShouldUseCodeCacheWithHashing(
    const blink::WebURL& request_url) const {}

void ContentRendererClient::PostIOThreadCreated(
    base::SingleThreadTaskRunner* io_thread_task_runner) {}

void ContentRendererClient::PostCompositorThreadCreated(
    base::SingleThreadTaskRunner* compositor_thread_task_runner) {}

bool ContentRendererClient::RunIdleHandlerWhenWidgetsHidden() {}

bool ContentRendererClient::AllowPopup() {}

bool ContentRendererClient::ShouldNotifyServiceWorkerOnWebSocketActivity(
    v8::Local<v8::Context> context) {}

blink::ProtocolHandlerSecurityLevel
ContentRendererClient::GetProtocolHandlerSecurityLevel(
    const url::Origin& origin) {}

#if BUILDFLAG(IS_ANDROID)
bool ContentRendererClient::HandleNavigation(
    RenderFrame* render_frame,
    blink::WebFrame* frame,
    const blink::WebURLRequest& request,
    blink::WebNavigationType type,
    blink::WebNavigationPolicy default_policy,
    bool is_redirect) {
  return false;
}
#endif

void ContentRendererClient::WillSendRequest(
    blink::WebLocalFrame* frame,
    ui::PageTransition transition_type,
    const blink::WebURL& upstream_url,
    const blink::WebURL& target_url,
    const net::SiteForCookies& site_for_cookies,
    const url::Origin* initiator_origin,
    GURL* new_url) {}

bool ContentRendererClient::IsPrefetchOnly(RenderFrame* render_frame) {}

uint64_t ContentRendererClient::VisitedLinkHash(
    std::string_view canonical_url) {}

uint64_t ContentRendererClient::PartitionedVisitedLinkFingerprint(
    std::string_view canonical_link_url,
    const net::SchemefulSite& top_level_site,
    const url::Origin& frame_origin) {}

bool ContentRendererClient::IsLinkVisited(uint64_t link_hash) {}

void ContentRendererClient::AddOrUpdateVisitedLinkSalt(
    const url::Origin& origin,
    uint64_t salt) {}

std::unique_ptr<blink::WebPrescientNetworking>
ContentRendererClient::CreatePrescientNetworking(RenderFrame* render_frame) {}

bool ContentRendererClient::IsExternalPepperPlugin(
    const std::string& module_name) {}

bool ContentRendererClient::IsOriginIsolatedPepperPlugin(
    const base::FilePath& plugin_path) {}

std::unique_ptr<media::KeySystemSupportRegistration>
ContentRendererClient::GetSupportedKeySystems(
    RenderFrame* render_frame,
    media::GetSupportedKeySystemsCB cb) {}

bool ContentRendererClient::IsSupportedAudioType(const media::AudioType& type) {}

bool ContentRendererClient::IsSupportedVideoType(const media::VideoType& type) {}

media::ExternalMemoryAllocator* ContentRendererClient::GetMediaAllocator() {}

bool ContentRendererClient::IsSupportedBitstreamAudioCodec(
    media::AudioCodec codec) {}

bool ContentRendererClient::ShouldReportDetailedMessageForSource(
    const std::u16string& source) {}

std::unique_ptr<blink::WebContentSettingsClient>
ContentRendererClient::CreateWorkerContentSettingsClient(
    RenderFrame* render_frame) {}

#if !BUILDFLAG(IS_ANDROID)
std::unique_ptr<media::SpeechRecognitionClient>
ContentRendererClient::CreateSpeechRecognitionClient(
    RenderFrame* render_frame) {}
#endif

bool ContentRendererClient::IsPluginAllowedToUseCameraDeviceAPI(
    const GURL& url) {}

bool ContentRendererClient::AllowScriptExtensionForServiceWorker(
    const url::Origin& script_origin) {}

bool ContentRendererClient::ShouldEnforceWebRTCRoutingPreferences() {}

GURL ContentRendererClient::OverrideFlashEmbedWithHTML(const GURL& url) {}

bool ContentRendererClient::IsIdleMediaSuspendEnabled() {}

std::unique_ptr<blink::URLLoaderThrottleProvider>
ContentRendererClient::CreateURLLoaderThrottleProvider(
    blink::URLLoaderThrottleProviderType provider_type) {}

blink::WebFrame* ContentRendererClient::FindFrame(
    blink::WebLocalFrame* relative_to_frame,
    const std::string& name) {}

bool ContentRendererClient::IsSafeRedirectTarget(const GURL& from_url,
                                                 const GURL& to_url) {}

void ContentRendererClient::DidSetUserAgent(const std::string& user_agent) {}

std::optional<::media::AudioRendererAlgorithmParameters>
ContentRendererClient::GetAudioRendererAlgorithmParameters(
    media::AudioParameters audio_parameters) {}

void ContentRendererClient::AppendContentSecurityPolicy(
    const blink::WebURL& url,
    blink::WebVector<blink::WebContentSecurityPolicyHeader>* csp) {}

std::unique_ptr<media::RendererFactory>
ContentRendererClient::GetBaseRendererFactory(
    content::RenderFrame* render_frame,
    media::MediaLog* media_log,
    media::DecoderFactory* decoder_factory,
    base::RepeatingCallback<media::GpuVideoAcceleratorFactories*()>
        get_gpu_factories_cb,
    int element_id) {}

#if BUILDFLAG(ENABLE_CAST_RECEIVER)
std::unique_ptr<cast_streaming::ResourceProvider>
ContentRendererClient::CreateCastStreamingResourceProvider() {
  return nullptr;
}
#endif

std::unique_ptr<blink::WebLinkPreviewTriggerer>
ContentRendererClient::CreateLinkPreviewTriggerer() {}

}  // namespace content