#include "content/browser/devtools/protocol/preload.h"
#include "content/browser/devtools/protocol/protocol.h"
#include "third_party/inspector_protocol/crdtp/cbor.h"
#include "third_party/inspector_protocol/crdtp/find_by_first.h"
#include "third_party/inspector_protocol/crdtp/span.h"
namespace content {
namespace protocol {
namespace Preload {
DeserializerState;
ProtocolTypeTraits;
const char Metainfo::domainName[] = …;
const char Metainfo::commandPrefix[] = …;
const char Metainfo::version[] = …;
namespace SpeculationActionEnum {
const char Prefetch[] = …;
const char Prerender[] = …;
}
namespace SpeculationTargetHintEnum {
const char Blank[] = …;
const char Self[] = …;
}
CRDTP_BEGIN_DESERIALIZER(…)
CRDTP_BEGIN_SERIALIZER(…);
namespace PrerenderFinalStatusEnum {
const char Activated[] = …;
const char Destroyed[] = …;
const char LowEndDevice[] = …;
const char InvalidSchemeRedirect[] = …;
const char InvalidSchemeNavigation[] = …;
const char NavigationRequestBlockedByCsp[] = …;
const char MainFrameNavigation[] = …;
const char MojoBinderPolicy[] = …;
const char RendererProcessCrashed[] = …;
const char RendererProcessKilled[] = …;
const char Download[] = …;
const char TriggerDestroyed[] = …;
const char NavigationNotCommitted[] = …;
const char NavigationBadHttpStatus[] = …;
const char ClientCertRequested[] = …;
const char NavigationRequestNetworkError[] = …;
const char CancelAllHostsForTesting[] = …;
const char DidFailLoad[] = …;
const char Stop[] = …;
const char SslCertificateError[] = …;
const char LoginAuthRequested[] = …;
const char UaChangeRequiresReload[] = …;
const char BlockedByClient[] = …;
const char AudioOutputDeviceRequested[] = …;
const char MixedContent[] = …;
const char TriggerBackgrounded[] = …;
const char MemoryLimitExceeded[] = …;
const char DataSaverEnabled[] = …;
const char TriggerUrlHasEffectiveUrl[] = …;
const char ActivatedBeforeStarted[] = …;
const char InactivePageRestriction[] = …;
const char StartFailed[] = …;
const char TimeoutBackgrounded[] = …;
const char CrossSiteRedirectInInitialNavigation[] = …;
const char CrossSiteNavigationInInitialNavigation[] = …;
const char SameSiteCrossOriginRedirectNotOptInInInitialNavigation[] = …;
const char SameSiteCrossOriginNavigationNotOptInInInitialNavigation[] = …;
const char ActivationNavigationParameterMismatch[] = …;
const char ActivatedInBackground[] = …;
const char EmbedderHostDisallowed[] = …;
const char ActivationNavigationDestroyedBeforeSuccess[] = …;
const char TabClosedByUserGesture[] = …;
const char TabClosedWithoutUserGesture[] = …;
const char PrimaryMainFrameRendererProcessCrashed[] = …;
const char PrimaryMainFrameRendererProcessKilled[] = …;
const char ActivationFramePolicyNotCompatible[] = …;
const char PreloadingDisabled[] = …;
const char BatterySaverEnabled[] = …;
const char ActivatedDuringMainFrameNavigation[] = …;
const char PreloadingUnsupportedByWebContents[] = …;
const char CrossSiteRedirectInMainFrameNavigation[] = …;
const char CrossSiteNavigationInMainFrameNavigation[] = …;
const char SameSiteCrossOriginRedirectNotOptInInMainFrameNavigation[] = …;
const char SameSiteCrossOriginNavigationNotOptInInMainFrameNavigation[] = …;
const char MemoryPressureOnTrigger[] = …;
const char MemoryPressureAfterTriggered[] = …;
const char PrerenderingDisabledByDevTools[] = …;
const char SpeculationRuleRemoved[] = …;
const char ActivatedWithAuxiliaryBrowsingContexts[] = …;
const char MaxNumOfRunningEagerPrerendersExceeded[] = …;
const char MaxNumOfRunningNonEagerPrerendersExceeded[] = …;
const char MaxNumOfRunningEmbedderPrerendersExceeded[] = …;
const char PrerenderingUrlHasEffectiveUrl[] = …;
const char RedirectedPrerenderingUrlHasEffectiveUrl[] = …;
const char ActivationUrlHasEffectiveUrl[] = …;
const char JavaScriptInterfaceAdded[] = …;
const char JavaScriptInterfaceRemoved[] = …;
const char AllPrerenderingCanceled[] = …;
const char WindowClosed[] = …;
const char SlowNetwork[] = …;
const char OtherPrerenderedPageActivated[] = …;
}
namespace PreloadingStatusEnum {
const char Pending[] = …;
const char Running[] = …;
const char Ready[] = …;
const char Success[] = …;
const char Failure[] = …;
const char NotSupported[] = …;
}
namespace PrefetchStatusEnum {
const char PrefetchAllowed[] = …;
const char PrefetchFailedIneligibleRedirect[] = …;
const char PrefetchFailedInvalidRedirect[] = …;
const char PrefetchFailedMIMENotSupported[] = …;
const char PrefetchFailedNetError[] = …;
const char PrefetchFailedNon2XX[] = …;
const char PrefetchEvictedAfterCandidateRemoved[] = …;
const char PrefetchEvictedForNewerPrefetch[] = …;
const char PrefetchHeldback[] = …;
const char PrefetchIneligibleRetryAfter[] = …;
const char PrefetchIsPrivacyDecoy[] = …;
const char PrefetchIsStale[] = …;
const char PrefetchNotEligibleBrowserContextOffTheRecord[] = …;
const char PrefetchNotEligibleDataSaverEnabled[] = …;
const char PrefetchNotEligibleExistingProxy[] = …;
const char PrefetchNotEligibleHostIsNonUnique[] = …;
const char PrefetchNotEligibleNonDefaultStoragePartition[] = …;
const char PrefetchNotEligibleSameSiteCrossOriginPrefetchRequiredProxy[] = …;
const char PrefetchNotEligibleSchemeIsNotHttps[] = …;
const char PrefetchNotEligibleUserHasCookies[] = …;
const char PrefetchNotEligibleUserHasServiceWorker[] = …;
const char PrefetchNotEligibleBatterySaverEnabled[] = …;
const char PrefetchNotEligiblePreloadingDisabled[] = …;
const char PrefetchNotFinishedInTime[] = …;
const char PrefetchNotStarted[] = …;
const char PrefetchNotUsedCookiesChanged[] = …;
const char PrefetchProxyNotAvailable[] = …;
const char PrefetchResponseUsed[] = …;
const char PrefetchSuccessfulButNotUsed[] = …;
const char PrefetchNotUsedProbeFailed[] = …;
}
CRDTP_BEGIN_DESERIALIZER(…)
CRDTP_BEGIN_SERIALIZER(…);
void Frontend::PreloadEnabledStateUpdated(bool disabledByPreference, bool disabledByDataSaver, bool disabledByBatterySaver, bool disabledByHoldbackPrefetchSpeculationRules, bool disabledByHoldbackPrerenderSpeculationRules)
{ … }
void Frontend::PrefetchStatusUpdated(std::unique_ptr<protocol::Preload::PreloadingAttemptKey> key, const String& initiatingFrameId, const String& prefetchUrl, const String& status, const String& prefetchStatus, const String& requestId)
{ … }
void Frontend::PrerenderStatusUpdated(std::unique_ptr<protocol::Preload::PreloadingAttemptKey> key, const String& status, Maybe<String> prerenderStatus, Maybe<String> disallowedMojoInterface, Maybe<protocol::Array<protocol::Preload::PrerenderMismatchedHeaders>> mismatchedHeaders)
{ … }
void Frontend::flush()
{ … }
void Frontend::sendRawNotification(std::unique_ptr<Serializable> notification)
{ … }
class DomainDispatcherImpl : public protocol::DomainDispatcher { … };
namespace {
DomainDispatcherImpl::CallHandler CommandByName(crdtp::span<uint8_t> command_name) { … }
}
std::function<void(const crdtp::Dispatchable&)> DomainDispatcherImpl::Dispatch(crdtp::span<uint8_t> command_name) { … }
namespace {
}
void DomainDispatcherImpl::enable(const crdtp::Dispatchable& dispatchable)
{ … }
namespace {
}
void DomainDispatcherImpl::disable(const crdtp::Dispatchable& dispatchable)
{ … }
namespace {
const std::vector<std::pair<crdtp::span<uint8_t>, crdtp::span<uint8_t>>>& SortedRedirects() { … }
}
void Dispatcher::wire(UberDispatcher* uber, Backend* backend)
{ … }
}
}
}