#include "content/public/browser/process_allocation_context.h"
#include "base/feature_list.h"
namespace content {
namespace {
BASE_FEATURE(kTreatRFHInitRootAsForNavigation,
base::FEATURE_DISABLED_BY_DEFAULT);
}
bool ProcessAllocationContext::IsForNavigation() const {
switch (source) {
case ProcessAllocationSource::kRFHInitRoot:
return base::FeatureList::IsEnabled(kTreatRFHInitRootAsForNavigation);
case ProcessAllocationSource::kNavigationRequest:
return true;
case ProcessAllocationSource::kOverrideNavigationParams:
case ProcessAllocationSource::kCanRequestURL:
case ProcessAllocationSource::kAuctionProcessManager:
case ProcessAllocationSource::kServiceWorkerProcessManager:
case ProcessAllocationSource::kSharedStorageRenderThreadWorkletDriver:
case ProcessAllocationSource::kSharedWorker:
case ProcessAllocationSource::kNoProcessCreationExpected:
case ProcessAllocationSource::kTest:
case ProcessAllocationSource::kEmbedder:
return false;
}
}
ProcessAllocationContext ProcessAllocationContext::CreateForNavigationRequest(
ProcessAllocationNavigationStage stage,
int64_t navigation_id,
bool is_outermost_main_frame) {
return ProcessAllocationContext{
ProcessAllocationSource::kNavigationRequest,
NavigationProcessAllocationContext{
stage, navigation_id, RequiresNewProcessForCoop(false),
IsOutermostMainFrame(is_outermost_main_frame)}};
}
}