Skip to content

armgit / moli

Public Imported from GitHub
0

Best headless browser for AI agents. Lite, Fast, High-Compatibility. Built in Rust

refactor(emulation): simplify document creation inputs

ldm0538e35f96f66
diff --git a/moli-core/src/page/settings_support.rs b/moli-core/src/page/settings_support.rs
index e786c530b..b58f1afc0 100644
--- a/moli-core/src/page/settings_support.rs
+++ b/moli-core/src/page/settings_support.rs
@@ -320,31 +320,6 @@ impl Page {
)
}
- pub async fn set_cpu_throttling_rate_async(&mut self, rate: f64) -> Result<()> {
- self.dispatch_unit_page_command_async(
- RendererPageCommand::SetCpuThrottlingRate(rate),
- "set CPU throttling rate",
- )
- .await
- }
-
- pub fn start_set_cpu_throttling_rate(&self, rate: f64) -> Result<PendingPageCommand> {
- self.start_page_command(RendererPageCommand::SetCpuThrottlingRate(rate))
- }
-
- pub fn finish_set_cpu_throttling_rate(
- &mut self,
- completion: CompletedPageCommand,
- ) -> Result<()> {
- let reply = self.finish_page_command(completion);
- expect_page_reply!(
- reply,
- "set CPU throttling rate",
- "a unit reply",
- RendererPageReply::Unit => Ok(()),
- )
- }
-
pub async fn set_emulated_media_async(
&mut self,
overrides: &EmulatedMediaOverrides,
diff --git a/moli-core/src/runtime/mod.rs b/moli-core/src/runtime/mod.rs
index 024ac9bac..82c7bd968 100644
--- a/moli-core/src/runtime/mod.rs
+++ b/moli-core/src/runtime/mod.rs
@@ -1283,7 +1283,7 @@ impl Browser {
pending_download,
) = self
.js_runtime
- .create_streaming_raw_page_from_external_body_with_inspector_session_restores(
+ .create_streaming_raw_page_from_external_body(
requested_url,
final_url,
None,
@@ -1298,30 +1298,20 @@ impl Browser {
self.partition.session_storage_store(),
),
raw_body,
- Some(self.partition.weak_indexed_db_manager()),
- Some(self.partition.storage_bucket_store()),
- document_start_scripts,
- vec![],
- vec![],
- self.config.script_execution_disabled(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
- Vec::new(),
self.config.wpt_extensions_enabled(),
stage,
reply_boundary,
moli_renderer_v8::RendererTopLevelNavigationDispatch::FollowInStandaloneAdapter,
moli_renderer_v8::RendererNavigationReplyPolicy::FollowBeforeReply,
- None,
reserved_service_worker_client,
- None,
lifecycle_decider,
+ moli_renderer_v8::RendererDocumentOptions {
+ indexed_db_manager: Some(self.partition.weak_indexed_db_manager()),
+ storage_bucket_store: Some(self.partition.storage_bucket_store()),
+ document_start_scripts,
+ script_execution_disabled: self.config.script_execution_disabled(),
+ ..Default::default()
+ },
)
.await?;
if pending_download.is_some() {
diff --git a/moli-core/src/runtime/navigation_engine.rs b/moli-core/src/runtime/navigation_engine.rs
index 37afa1170..324051f38 100644
--- a/moli-core/src/runtime/navigation_engine.rs
+++ b/moli-core/src/runtime/navigation_engine.rs
@@ -53,7 +53,6 @@ struct DocumentPageLoadOptions {
pub extra_http_headers: Vec<(String, String)>,
pub script_execution_disabled: bool,
pub bypass_content_security_policy: bool,
- pub cpu_throttling_rate: f64,
pub emulated_media: EmulatedMediaOverrides,
pub viewport_surface: Option<ViewportSurface>,
pub network_offline: bool,
@@ -202,7 +201,6 @@ pub struct PreparedDocumentPageCommitConfiguration {
pub extra_http_headers: Vec<(String, String)>,
pub script_execution_disabled: bool,
pub bypass_content_security_policy: bool,
- pub cpu_throttling_rate: f64,
pub emulated_media: EmulatedMediaOverrides,
pub idle_override: Option<crate::page::EmulatedIdleOverride>,
pub navigator_overrides: moli_page_types::NavigatorOverrides,
@@ -264,7 +262,6 @@ impl PreparedDocumentPage {
extra_http_headers: configuration.extra_http_headers,
script_execution_disabled: configuration.script_execution_disabled,
bypass_content_security_policy: configuration.bypass_content_security_policy,
- cpu_throttling_rate: configuration.cpu_throttling_rate,
emulated_media: configuration.emulated_media,
idle_override: configuration.idle_override,
navigator_overrides: configuration.navigator_overrides,
@@ -327,7 +324,6 @@ impl PreparedDocumentPage {
/// [`Self::await_ready`] when the resulting page is needed.
pub struct PendingBuiltDocumentPage {
pending: moli_renderer_v8::PendingHtmlPage,
- document_activity: moli_page_types::DocumentActivity,
}
impl PendingBuiltDocumentPage {
@@ -343,10 +339,7 @@ impl PendingBuiltDocumentPage {
.await_ready()
.await
.context("failed to build html page")?;
- let mut page = Page::from_attached_handle(handle, page_state);
- page.set_document_activity_async(self.document_activity)
- .await
- .context("failed to apply native document activity")?;
+ let page = Page::from_attached_handle(handle, page_state);
Ok(BuiltDocumentPage {
page,
page_creation_diagnostics,
@@ -1172,7 +1165,6 @@ impl NavigationEngine {
runtime_inspector_session_restore_snapshots: Vec<RendererInspectorSessionRestoreSnapshot>,
extra_http_headers: Vec<(String, String)>,
script_execution_disabled: bool,
- cpu_throttling_rate: f64,
emulated_media: EmulatedMediaOverrides,
viewport_surface: Option<ViewportSurface>,
network_offline: bool,
@@ -1206,7 +1198,6 @@ impl NavigationEngine {
extra_http_headers,
script_execution_disabled,
bypass_content_security_policy: false,
- cpu_throttling_rate,
emulated_media,
viewport_surface,
network_offline,
@@ -1234,7 +1225,6 @@ impl NavigationEngine {
runtime_bindings: Vec<crate::page::RuntimeBindingRegistration>,
extra_http_headers: Vec<(String, String)>,
script_execution_disabled: bool,
- cpu_throttling_rate: f64,
emulated_media: EmulatedMediaOverrides,
viewport_surface: Option<ViewportSurface>,
network_offline: bool,
@@ -1252,7 +1242,6 @@ impl NavigationEngine {
Vec::new(),
extra_http_headers,
script_execution_disabled,
- cpu_throttling_rate,
emulated_media,
viewport_surface,
network_offline,
@@ -1277,7 +1266,6 @@ impl NavigationEngine {
runtime_inspector_session_restore_snapshots: Vec<RendererInspectorSessionRestoreSnapshot>,
extra_http_headers: Vec<(String, String)>,
script_execution_disabled: bool,
- cpu_throttling_rate: f64,
emulated_media: EmulatedMediaOverrides,
viewport_surface: Option<ViewportSurface>,
network_offline: bool,
@@ -1302,7 +1290,6 @@ impl NavigationEngine {
runtime_inspector_session_restore_snapshots,
extra_http_headers,
script_execution_disabled,
- cpu_throttling_rate,
emulated_media,
viewport_surface,
network_offline,
@@ -1336,7 +1323,6 @@ impl NavigationEngine {
extra_http_headers: Vec<(String, String)>,
script_execution_disabled: bool,
bypass_content_security_policy: bool,
- cpu_throttling_rate: f64,
emulated_media: EmulatedMediaOverrides,
viewport_surface: Option<ViewportSurface>,
network_offline: bool,
@@ -1369,7 +1355,6 @@ impl NavigationEngine {
extra_http_headers,
script_execution_disabled,
bypass_content_security_policy,
- cpu_throttling_rate,
emulated_media,
viewport_surface,
network_offline,
@@ -1397,7 +1382,6 @@ impl NavigationEngine {
runtime_bindings: Vec<crate::page::RuntimeBindingRegistration>,
extra_http_headers: Vec<(String, String)>,
script_execution_disabled: bool,
- cpu_throttling_rate: f64,
emulated_media: EmulatedMediaOverrides,
viewport_surface: Option<ViewportSurface>,
network_offline: bool,
@@ -1421,7 +1405,6 @@ impl NavigationEngine {
extra_http_headers,
script_execution_disabled,
false,
- cpu_throttling_rate,
emulated_media,
viewport_surface,
network_offline,
@@ -1452,7 +1435,6 @@ impl NavigationEngine {
extra_http_headers: Vec<(String, String)>,
script_execution_disabled: bool,
bypass_content_security_policy: bool,
- cpu_throttling_rate: f64,
emulated_media: EmulatedMediaOverrides,
viewport_surface: Option<ViewportSurface>,
network_offline: bool,
@@ -1483,7 +1465,6 @@ impl NavigationEngine {
extra_http_headers,
script_execution_disabled,
bypass_content_security_policy,
- cpu_throttling_rate,
emulated_media,
viewport_surface,
network_offline,
@@ -1525,7 +1506,6 @@ impl NavigationEngine {
extra_http_headers: Vec<(String, String)>,
script_execution_disabled: bool,
bypass_content_security_policy: bool,
- cpu_throttling_rate: f64,
emulated_media: EmulatedMediaOverrides,
viewport_surface: Option<ViewportSurface>,
network_offline: bool,
@@ -1540,20 +1520,21 @@ impl NavigationEngine {
loader.set_extra_http_headers(&extra_http_headers);
loader.set_network_offline(network_offline);
loader.set_blocked_url_patterns(&blocked_url_patterns);
- let pending = self
- .js_runtime
- .start_create_html_page_from_response_with_inspector_session_restores_and_activity(
- page_reservation,
- requested_url,
- final_url,
- navigation_initiator_url,
- redirected,
- redirect_count,
- response_status,
- response_headers,
- &loader,
- web_storage,
- response_body,
+ let pending = self.js_runtime.start_create_html_page_from_response(
+ page_reservation,
+ requested_url,
+ final_url,
+ navigation_initiator_url,
+ redirected,
+ redirect_count,
+ response_status,
+ response_headers,
+ &loader,
+ web_storage,
+ response_body,
+ top_level_storage_key,
+ moli_renderer_v8::RendererTopLevelNavigationDispatch::DelegateToBrowser,
+ moli_renderer_v8::RendererDocumentOptions {
indexed_db_manager,
storage_bucket_store,
document_start_scripts,
@@ -1561,24 +1542,19 @@ impl NavigationEngine {
extra_http_headers,
script_execution_disabled,
bypass_content_security_policy,
- cpu_throttling_rate,
emulated_media,
viewport_surface,
- self.document_activity,
+ document_activity: self.document_activity,
network_offline,
blocked_url_patterns,
fetch_subresource_interception_enabled,
fetch_subresource_interception_resource_type,
runtime_inspector_session_restore_snapshots,
root_frame_id,
- top_level_storage_key,
- moli_renderer_v8::RendererTopLevelNavigationDispatch::DelegateToBrowser,
main_document_commit,
- )?;
- Ok(PendingBuiltDocumentPage {
- pending,
- document_activity: self.document_activity,
- })
+ },
+ )?;
+ Ok(PendingBuiltDocumentPage { pending })
}
#[allow(clippy::too_many_arguments)]
@@ -1597,7 +1573,6 @@ impl NavigationEngine {
runtime_bindings: Vec<crate::page::RuntimeBindingRegistration>,
extra_http_headers: Vec<(String, String)>,
script_execution_disabled: bool,
- cpu_throttling_rate: f64,
emulated_media: EmulatedMediaOverrides,
viewport_surface: Option<ViewportSurface>,
network_offline: bool,
@@ -1623,7 +1598,6 @@ impl NavigationEngine {
extra_http_headers,
script_execution_disabled,
false,
- cpu_throttling_rate,
emulated_media,
viewport_surface,
network_offline,
@@ -1655,7 +1629,6 @@ impl NavigationEngine {
extra_http_headers: Vec<(String, String)>,
script_execution_disabled: bool,
bypass_content_security_policy: bool,
- cpu_throttling_rate: f64,
emulated_media: EmulatedMediaOverrides,
viewport_surface: Option<ViewportSurface>,
network_offline: bool,
@@ -1688,7 +1661,6 @@ impl NavigationEngine {
extra_http_headers,
script_execution_disabled,
bypass_content_security_policy,
- cpu_throttling_rate,
emulated_media,
viewport_surface,
network_offline,
@@ -1721,7 +1693,6 @@ impl NavigationEngine {
runtime_inspector_session_restore_snapshots: Vec<RendererInspectorSessionRestoreSnapshot>,
extra_http_headers: Vec<(String, String)>,
script_execution_disabled: bool,
- cpu_throttling_rate: f64,
emulated_media: EmulatedMediaOverrides,
viewport_surface: Option<ViewportSurface>,
network_offline: bool,
@@ -1757,7 +1728,6 @@ impl NavigationEngine {
extra_http_headers,
script_execution_disabled,
false,
- cpu_throttling_rate,
emulated_media,
viewport_surface,
network_offline,
@@ -1798,7 +1768,6 @@ impl NavigationEngine {
extra_http_headers: Vec<(String, String)>,
script_execution_disabled: bool,
bypass_content_security_policy: bool,
- cpu_throttling_rate: f64,
emulated_media: EmulatedMediaOverrides,
viewport_surface: Option<ViewportSurface>,
network_offline: bool,
@@ -1822,7 +1791,7 @@ impl NavigationEngine {
loader.set_blocked_url_patterns(&blocked_url_patterns);
let prepared = self
.js_runtime
- .prepare_streaming_raw_document_from_external_body_with_inspector_session_restores_and_activity(
+ .prepare_streaming_raw_document_from_external_body(
page_reservation,
requested_url,
final_url,
@@ -1835,31 +1804,32 @@ impl NavigationEngine {
&loader,
web_storage,
raw_body,
- indexed_db_manager,
- storage_bucket_store,
- document_start_scripts,
- runtime_bindings,
- extra_http_headers,
- script_execution_disabled,
- bypass_content_security_policy,
- cpu_throttling_rate,
- emulated_media,
- viewport_surface,
- self.document_activity,
- network_offline,
- blocked_url_patterns,
- fetch_subresource_interception_enabled,
- fetch_subresource_interception_resource_type,
- runtime_inspector_session_restore_snapshots,
false,
stage,
reply_boundary,
moli_renderer_v8::RendererTopLevelNavigationDispatch::DelegateToBrowser,
moli_renderer_v8::RendererNavigationReplyPolicy::ReturnWithPendingNavigation,
- root_frame_id,
reserved_service_worker_client,
- main_document_commit,
None,
+ moli_renderer_v8::RendererDocumentOptions {
+ indexed_db_manager,
+ storage_bucket_store,
+ document_start_scripts,
+ runtime_bindings,
+ extra_http_headers,
+ script_execution_disabled,
+ bypass_content_security_policy,
+ emulated_media,
+ viewport_surface,
+ document_activity: self.document_activity,
+ network_offline,
+ blocked_url_patterns,
+ fetch_subresource_interception_enabled,
+ fetch_subresource_interception_resource_type,
+ runtime_inspector_session_restore_snapshots,
+ root_frame_id,
+ main_document_commit,
+ },
)
.await
.context("failed to prepare streaming raw page")?;
@@ -1882,7 +1852,6 @@ impl NavigationEngine {
runtime_bindings: Vec<crate::page::RuntimeBindingRegistration>,
extra_http_headers: Vec<(String, String)>,
script_execution_disabled: bool,
- cpu_throttling_rate: f64,
emulated_media: EmulatedMediaOverrides,
viewport_surface: Option<ViewportSurface>,
network_offline: bool,
@@ -1906,7 +1875,6 @@ impl NavigationEngine {
Vec::new(),
extra_http_headers,
script_execution_disabled,
- cpu_throttling_rate,
emulated_media,
viewport_surface,
network_offline,
@@ -1940,7 +1908,6 @@ impl NavigationEngine {
runtime_inspector_session_restore_snapshots: Vec<RendererInspectorSessionRestoreSnapshot>,
extra_http_headers: Vec<(String, String)>,
script_execution_disabled: bool,
- cpu_throttling_rate: f64,
emulated_media: EmulatedMediaOverrides,
viewport_surface: Option<ViewportSurface>,
network_offline: bool,
@@ -1974,7 +1941,6 @@ impl NavigationEngine {
runtime_inspector_session_restore_snapshots,
extra_http_headers,
script_execution_disabled,
- cpu_throttling_rate,
emulated_media,
viewport_surface,
network_offline,
@@ -2010,7 +1976,6 @@ impl NavigationEngine {
extra_http_headers: Vec<(String, String)>,
script_execution_disabled: bool,
bypass_content_security_policy: bool,
- cpu_throttling_rate: f64,
emulated_media: EmulatedMediaOverrides,
viewport_surface: Option<ViewportSurface>,
network_offline: bool,
@@ -2046,7 +2011,6 @@ impl NavigationEngine {
extra_http_headers,
script_execution_disabled,
bypass_content_security_policy,
- cpu_throttling_rate,
emulated_media,
viewport_surface,
network_offline,
@@ -2087,7 +2051,7 @@ impl NavigationEngine {
pending_download,
) = self
.js_runtime
- .create_html_page_from_response_with_inspector_session_restores_and_activity(
+ .create_html_page_from_response(
options.requested_url.clone(),
options.final_url,
options.navigation_initiator_url,
@@ -2098,31 +2062,32 @@ impl NavigationEngine {
&loader,
web_storage,
options.response_body,
- indexed_db_manager,
- storage_bucket_store,
- options.document_start_scripts,
- options.runtime_bindings,
- options.extra_http_headers,
- options.script_execution_disabled,
- options.bypass_content_security_policy,
- options.cpu_throttling_rate,
- options.emulated_media,
- options.viewport_surface,
- self.document_activity,
- options.network_offline,
- options.blocked_url_patterns,
- options.fetch_subresource_interception_enabled,
- options.fetch_subresource_interception_resource_type,
- options.runtime_inspector_session_restore_snapshots,
- options.root_frame_id,
- options.main_document_commit,
+ moli_renderer_v8::RendererDocumentOptions {
+ indexed_db_manager,
+ storage_bucket_store,
+ document_start_scripts: options.document_start_scripts,
+ runtime_bindings: options.runtime_bindings,
+ extra_http_headers: options.extra_http_headers,
+ script_execution_disabled: options.script_execution_disabled,
+ bypass_content_security_policy: options.bypass_content_security_policy,
+ emulated_media: options.emulated_media,
+ viewport_surface: options.viewport_surface,
+ document_activity: self.document_activity,
+ network_offline: options.network_offline,
+ blocked_url_patterns: options.blocked_url_patterns,
+ fetch_subresource_interception_enabled: options
+ .fetch_subresource_interception_enabled,
+ fetch_subresource_interception_resource_type: options
+ .fetch_subresource_interception_resource_type,
+ runtime_inspector_session_restore_snapshots: options
+ .runtime_inspector_session_restore_snapshots,
+ root_frame_id: options.root_frame_id,
+ main_document_commit: options.main_document_commit,
+ },
)
.await
.context("failed to build html page")?;
- let mut page = Page::from_attached_handle(handle, page_state);
- page.set_document_activity_async(self.document_activity)
- .await
- .context("failed to apply native document activity")?;
+ let page = Page::from_attached_handle(handle, page_state);
Ok(BuiltDocumentPage {
page,
page_creation_diagnostics,
@@ -2163,7 +2128,6 @@ impl NavigationEngine {
options.extra_http_headers,
options.script_execution_disabled,
options.bypass_content_security_policy,
- options.cpu_throttling_rate,
options.emulated_media,
options.viewport_surface,
options.network_offline,
@@ -2223,7 +2187,6 @@ impl NavigationEngine {
extra_http_headers: Vec<(String, String)>,
script_execution_disabled: bool,
bypass_content_security_policy: bool,
- cpu_throttling_rate: f64,
emulated_media: EmulatedMediaOverrides,
viewport_surface: Option<ViewportSurface>,
network_offline: bool,
@@ -2260,7 +2223,6 @@ impl NavigationEngine {
extra_http_headers,
script_execution_disabled,
bypass_content_security_policy,
- cpu_throttling_rate,
emulated_media,
viewport_surface,
network_offline,
@@ -2289,7 +2251,6 @@ impl NavigationEngine {
runtime_bindings: Vec<crate::page::RuntimeBindingRegistration>,
extra_http_headers: Vec<(String, String)>,
script_execution_disabled: bool,
- cpu_throttling_rate: f64,
emulated_media: EmulatedMediaOverrides,
viewport_surface: Option<ViewportSurface>,
network_offline: bool,
@@ -2323,7 +2284,6 @@ impl NavigationEngine {
extra_http_headers,
script_execution_disabled,
bypass_content_security_policy: false,
- cpu_throttling_rate,
emulated_media,
viewport_surface,
network_offline,
diff --git a/moli-core/src/runtime/tests.rs b/moli-core/src/runtime/tests.rs
index 951601317..cca4f7c23 100644
--- a/moli-core/src/runtime/tests.rs
+++ b/moli-core/src/runtime/tests.rs
@@ -1546,7 +1546,6 @@ async fn navigation_engine_keeps_network_runtime_when_web_storage_changes() -> R
Vec::new(),
Vec::new(),
false,
- 1.0,
Default::default(),
None,
false,
@@ -1581,7 +1580,6 @@ async fn navigation_engine_keeps_network_runtime_when_web_storage_changes() -> R
Vec::new(),
Vec::new(),
false,
- 1.0,
Default::default(),
None,
false,
diff --git a/moli-protocol/src/conn/browser_context/emulation_owner.rs b/moli-protocol/src/conn/browser_context/emulation_owner.rs
index 31411999d..94985de3c 100644
--- a/moli-protocol/src/conn/browser_context/emulation_owner.rs
+++ b/moli-protocol/src/conn/browser_context/emulation_owner.rs
@@ -41,11 +41,6 @@ impl TargetEmulationStateUpdate<'_> {
self.effective.emulated_device_metrics = emulated_device_metrics;
}
- pub(crate) fn set_cpu_throttling_rate(&mut self, cpu_throttling_rate: f64) {
- self.raw.cpu_throttling_rate = cpu_throttling_rate;
- self.effective.cpu_throttling_rate = cpu_throttling_rate;
- }
-
pub(crate) fn set_max_touch_points(&mut self, max_touch_points: u32) {
self.raw.max_touch_points = max_touch_points;
self.effective.max_touch_points = max_touch_points;
diff --git a/moli-protocol/src/conn/browser_context/target_session_owner.rs b/moli-protocol/src/conn/browser_context/target_session_owner.rs
index 73ba788cc..412894229 100644
--- a/moli-protocol/src/conn/browser_context/target_session_owner.rs
+++ b/moli-protocol/src/conn/browser_context/target_session_owner.rs
@@ -166,7 +166,6 @@ pub(crate) struct TargetNavigationLoadInputs {
pub(crate) extra_http_headers: Vec<(String, String)>,
pub(crate) script_execution_disabled: bool,
pub(crate) bypass_content_security_policy: bool,
- pub(crate) cpu_throttling_rate: f64,
pub(crate) emulated_media: moli_core::page::EmulatedMediaOverrides,
pub(crate) viewport_surface: Option<moli_core::page::ViewportSurface>,
pub(crate) document_activity: moli_page_types::DocumentActivity,
@@ -315,7 +314,6 @@ impl TargetNavigationLoadInputs {
.effective_emulation_state
.script_execution_disabled,
bypass_content_security_policy: page_state.devtools_sessions.page_bypass_csp_enabled(),
- cpu_throttling_rate: page_state.effective_emulation_state.cpu_throttling_rate,
emulated_media: (&page_state.effective_emulation_state.emulated_media).into(),
viewport_surface: emulated_device_metrics
.as_ref()
@@ -387,7 +385,6 @@ impl TargetNavigationLoadInputs {
extra_http_headers: Vec::new(),
script_execution_disabled: false,
bypass_content_security_policy: false,
- cpu_throttling_rate: 1.0,
emulated_media: Default::default(),
viewport_surface: None,
document_activity: Default::default(),
diff --git a/moli-protocol/src/conn/runtime_load.rs b/moli-protocol/src/conn/runtime_load.rs
index 88187922f..d3692de7b 100644
--- a/moli-protocol/src/conn/runtime_load.rs
+++ b/moli-protocol/src/conn/runtime_load.rs
@@ -1379,7 +1379,6 @@ async fn build_navigation_from_streaming_raw_response_with_engine_async(
load_inputs.extra_http_headers.clone(),
load_inputs.script_execution_disabled,
load_inputs.bypass_content_security_policy,
- load_inputs.cpu_throttling_rate,
load_inputs.emulated_media.clone(),
load_inputs.viewport_surface,
load_inputs.network_offline,
@@ -1449,7 +1448,6 @@ async fn build_navigation_from_streaming_raw_response_with_engine_async(
load_inputs.extra_http_headers.clone(),
load_inputs.script_execution_disabled,
load_inputs.bypass_content_security_policy,
- load_inputs.cpu_throttling_rate,
load_inputs.emulated_media.clone(),
load_inputs.viewport_surface,
load_inputs.network_offline,
@@ -1557,7 +1555,6 @@ impl CdpConnection {
extra_http_headers: load_inputs.extra_http_headers,
script_execution_disabled: load_inputs.script_execution_disabled,
bypass_content_security_policy: load_inputs.bypass_content_security_policy,
- cpu_throttling_rate: load_inputs.cpu_throttling_rate,
emulated_media: load_inputs.emulated_media,
idle_override,
navigator_overrides: load_inputs.navigator_overrides,
@@ -1684,7 +1681,6 @@ impl CdpConnection {
load_inputs.extra_http_headers.clone(),
load_inputs.script_execution_disabled,
load_inputs.bypass_content_security_policy,
- load_inputs.cpu_throttling_rate,
load_inputs.emulated_media.clone(),
load_inputs.viewport_surface,
load_inputs.network_offline,
@@ -1942,7 +1938,6 @@ impl CdpConnection {
load_inputs.extra_http_headers.clone(),
load_inputs.script_execution_disabled,
load_inputs.bypass_content_security_policy,
- load_inputs.cpu_throttling_rate,
load_inputs.emulated_media.clone(),
load_inputs.viewport_surface,
load_inputs.network_offline,
@@ -2898,7 +2893,6 @@ impl CdpConnection {
load_inputs.extra_http_headers.clone(),
load_inputs.script_execution_disabled,
load_inputs.bypass_content_security_policy,
- load_inputs.cpu_throttling_rate,
load_inputs.emulated_media.clone(),
load_inputs.viewport_surface,
load_inputs.network_offline,
@@ -3212,7 +3206,6 @@ impl CdpConnection {
load_inputs.extra_http_headers.clone(),
load_inputs.script_execution_disabled,
load_inputs.bypass_content_security_policy,
- load_inputs.cpu_throttling_rate,
load_inputs.emulated_media.clone(),
load_inputs.viewport_surface,
load_inputs.network_offline,
@@ -3844,7 +3837,6 @@ async fn prepare_captured_document_response_with_engine_async(
load_inputs.extra_http_headers.clone(),
load_inputs.script_execution_disabled,
load_inputs.bypass_content_security_policy,
- load_inputs.cpu_throttling_rate,
load_inputs.emulated_media.clone(),
load_inputs.viewport_surface,
load_inputs.network_offline,
@@ -3934,9 +3926,6 @@ async fn apply_navigation_load_input_overrides_async(
page.set_bypass_content_security_policy_async(load_inputs.bypass_content_security_policy)
.await
.map_err(|error| format!("failed to apply page CSP bypass override: {error}"))?;
- page.set_cpu_throttling_rate_async(load_inputs.cpu_throttling_rate)
- .await
- .map_err(|error| format!("failed to apply page CPU throttling rate: {error}"))?;
page.set_emulated_media_async(&load_inputs.emulated_media)
.await
.map_err(|error| format!("failed to apply page emulated media: {error}"))?;
diff --git a/moli-protocol/src/conn/state/devtools_session.rs b/moli-protocol/src/conn/state/devtools_session.rs
index cd0308ef4..2ccab442c 100644
--- a/moli-protocol/src/conn/state/devtools_session.rs
+++ b/moli-protocol/src/conn/state/devtools_session.rs
@@ -666,7 +666,7 @@ pub(crate) struct DevToolsNetworkSessionState {
pub(crate) service_worker_fetch_diagnostic_entries: usize,
}
-#[derive(Clone, Debug, PartialEq)]
+#[derive(Clone, Debug, PartialEq, Default)]
pub(crate) struct DevToolsEmulationSessionState {
// UA, Accept-Language, and platform are independent handler contributions.
pub(crate) browser_identity_override: Option<DevToolsBrowserIdentityOverride>,
@@ -674,30 +674,12 @@ pub(crate) struct DevToolsEmulationSessionState {
pub(crate) geolocation_override: Option<super::EmulatedGeolocationOverrideState>,
pub(crate) emulated_media: super::EmulatedMediaOverrides,
pub(crate) emulated_device_metrics: Option<super::EmulatedDeviceMetrics>,
- pub(crate) cpu_throttling_rate: f64,
pub(crate) max_touch_points: u32,
pub(crate) emit_touch_events_for_mouse: bool,
pub(crate) focus_emulation_enabled: bool,
pub(crate) script_execution_disabled: bool,
}
-impl Default for DevToolsEmulationSessionState {
- fn default() -> Self {
- Self {
- browser_identity_override: None,
- network_conditions: None,
- geolocation_override: None,
- emulated_media: super::EmulatedMediaOverrides::default(),
- emulated_device_metrics: None,
- cpu_throttling_rate: 1.0,
- max_touch_points: 0,
- emit_touch_events_for_mouse: false,
- focus_emulation_enabled: false,
- script_execution_disabled: false,
- }
- }
-}
-
#[derive(Clone, Debug, PartialEq)]
pub(crate) struct DevToolsBrowserIdentityOverride {
// Keep individual command contributions instead of a flattened profile:
diff --git a/moli-protocol/src/conn/state/emulation.rs b/moli-protocol/src/conn/state/emulation.rs
index c4f18fdba..6b59652ef 100644
--- a/moli-protocol/src/conn/state/emulation.rs
+++ b/moli-protocol/src/conn/state/emulation.rs
@@ -170,42 +170,24 @@ impl From<&EmulatedMediaOverrides> for moli_core::page::EmulatedMediaOverrides {
/// A DevTools session keeps its own raw Emulation handler state separately.
/// Commands copy the calling handler's value into this shared surface, just as
/// Chromium's per-session Emulation handlers update one target-wide renderer.
-#[derive(Debug, Clone, PartialEq)]
+#[derive(Debug, Clone, PartialEq, Default)]
pub(crate) struct EffectiveTargetEmulationState {
pub(crate) network_conditions: Option<EmulatedNetworkConditions>,
pub(crate) geolocation_override: Option<EmulatedGeolocationOverrideState>,
pub(crate) emulated_media: EmulatedMediaOverrides,
pub(crate) emulated_device_metrics: Option<EmulatedDeviceMetrics>,
- pub(crate) cpu_throttling_rate: f64,
pub(crate) max_touch_points: u32,
pub(crate) emit_touch_events_for_mouse: bool,
pub(crate) focus_emulation_enabled: bool,
pub(crate) script_execution_disabled: bool,
}
-impl Default for EffectiveTargetEmulationState {
- fn default() -> Self {
- Self {
- network_conditions: None,
- geolocation_override: None,
- emulated_media: EmulatedMediaOverrides::default(),
- emulated_device_metrics: None,
- cpu_throttling_rate: 1.0,
- max_touch_points: 0,
- emit_touch_events_for_mouse: false,
- focus_emulation_enabled: false,
- script_execution_disabled: false,
- }
- }
-}
-
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq)]
pub(crate) struct EffectiveTargetEmulationStateDelta {
pub(crate) network_conditions: bool,
pub(crate) geolocation_override: bool,
pub(crate) emulated_media: bool,
pub(crate) emulated_device_metrics: bool,
- pub(crate) cpu_throttling_rate: bool,
pub(crate) max_touch_points: bool,
pub(crate) focus_emulation_enabled: bool,
pub(crate) script_execution_disabled: bool,
@@ -242,9 +224,6 @@ impl EffectiveTargetEmulationState {
if raw.emulated_device_metrics.is_some() {
self.emulated_device_metrics = None;
}
- if raw.cpu_throttling_rate != 1.0 {
- self.cpu_throttling_rate = 1.0;
- }
if raw.max_touch_points != 0 {
self.max_touch_points = 0;
}
@@ -263,7 +242,6 @@ impl EffectiveTargetEmulationState {
emulated_media: previous.emulated_media != self.emulated_media,
emulated_device_metrics: previous.emulated_device_metrics
!= self.emulated_device_metrics,
- cpu_throttling_rate: previous.cpu_throttling_rate != self.cpu_throttling_rate,
max_touch_points: previous.max_touch_points != self.max_touch_points,
focus_emulation_enabled: previous.focus_emulation_enabled
!= self.focus_emulation_enabled,
diff --git a/moli-protocol/src/conn/state/session.rs b/moli-protocol/src/conn/state/session.rs
index 8af138f1d..9329fac6c 100644
--- a/moli-protocol/src/conn/state/session.rs
+++ b/moli-protocol/src/conn/state/session.rs
@@ -656,7 +656,7 @@ mod tests {
.devtools_sessions
.primary_mut()
.emulation_session_state
- .cpu_throttling_rate = 4.0;
+ .max_touch_points = 4;
let effective = state.effective_policy();
assert_eq!(
effective
@@ -673,8 +673,8 @@ mod tests {
.devtools_sessions
.primary()
.emulation_session_state
- .cpu_throttling_rate,
- 4.0,
+ .max_touch_points,
+ 4,
"clearing policy contributions must leave the handler's renderer state intact"
);
assert_eq!(
diff --git a/moli-protocol/src/domains/emulation.rs b/moli-protocol/src/domains/emulation.rs
index 6cd5948a2..4b3ecf3f9 100644
--- a/moli-protocol/src/domains/emulation.rs
+++ b/moli-protocol/src/domains/emulation.rs
@@ -91,7 +91,6 @@ pub(crate) enum EmulationCommandTaskStep {
enum PendingEmulationPageOperation {
SetExtraHttpHeaders,
SetNetworkConditions,
- SetCpuThrottlingRate,
SetIdleOverride,
SetNavigatorOverrides,
SetEmulatedMedia,
@@ -107,7 +106,6 @@ impl PendingEmulationPageOperation {
Self::SetExtraHttpHeaders
| Self::SetNavigatorOverrides
| Self::SetNetworkConditions
- | Self::SetCpuThrottlingRate
| Self::SetEmulatedMedia
| Self::SetViewportSurface
| Self::SetDocumentActivity
@@ -197,9 +195,9 @@ pub(crate) fn try_start_emulation_command_dispatch(
Some(EmulationAction::ClearDeviceMetricsOverride) => {
Some(start_clear_device_metrics_override_command(conn, cmd))
}
- Some(EmulationAction::SetCpuThrottlingRate) => {
- Some(start_cpu_throttling_rate_command(conn, cmd))
- }
+ Some(EmulationAction::SetCpuThrottlingRate) => Some(EmulationCommandTaskStep::Complete(
+ cpu_throttling_rate_command_output_plan(cmd),
+ )),
Some(EmulationAction::SetTouchEmulationEnabled) => {
Some(start_touch_emulation_enabled_command(conn, cmd))
}
@@ -343,55 +341,15 @@ fn start_touch_emulation_enabled_command(
))
}
-fn start_cpu_throttling_rate_command(
- conn: &mut CdpConnection,
- cmd: &Cmd<'_>,
-) -> EmulationCommandTaskStep {
- let params: params::SetCpuThrottlingRateParams =
- match cmd.get_params::<params::SetCpuThrottlingRateParams>() {
- Ok(Some(params)) if params.rate.is_finite() => params,
- _ => {
- return EmulationCommandTaskStep::Complete(CommandOutputPlan::error(
- -32602,
- "InvalidParams",
- ));
- }
- };
- if params.rate > 1.0 {
- return EmulationCommandTaskStep::Complete(CommandOutputPlan::error(
- -32000,
- "CPU throttling is not supported",
- ));
- }
- if conn.browser_context.is_none() {
- return EmulationCommandTaskStep::Complete(CommandOutputPlan::result(json!({})));
- }
- if !conn.update_emulation_state_for_session_owner(cmd.session_id, |state| {
- if let Some(mut state) = state {
- state.set_cpu_throttling_rate(1.0);
- }
- }) {
- return EmulationCommandTaskStep::Complete(CommandOutputPlan::error(
- -31998,
- "BrowserContextNotLoaded",
- ));
- }
- let owner_scope = CommandOwnerScope::capture(conn, cmd.session_id);
- let Some(page) = loaded_page_mut_for_target_configuration(conn, cmd.session_id) else {
- return EmulationCommandTaskStep::Complete(CommandOutputPlan::result(json!({})));
+fn cpu_throttling_rate_command_output_plan(cmd: &Cmd<'_>) -> CommandOutputPlan {
+ let params = match cmd.get_params::<params::SetCpuThrottlingRateParams>() {
+ Ok(Some(params)) if params.rate.is_finite() => params,
+ _ => return CommandOutputPlan::error(-32602, "InvalidParams"),
};
- match page.start_set_cpu_throttling_rate(1.0) {
- Ok(pending) => EmulationCommandTaskStep::Pending(single_pending_emulation_dispatch(
- cmd.id,
- owner_scope,
- PendingEmulationPageOperation::SetCpuThrottlingRate,
- pending,
- None,
- )),
- Err(error) => {
- EmulationCommandTaskStep::Complete(CommandOutputPlan::error(-32000, error.to_string()))
- }
+ if params.rate > 1.0 {
+ return CommandOutputPlan::error(-32000, "CPU throttling is not supported");
}
+ CommandOutputPlan::success()
}
fn emit_touch_events_for_mouse_command_output_plan(
@@ -2399,14 +2357,6 @@ pub(crate) async fn dispose_page_session_async(
.await,
);
}
- if delta.cpu_throttling_rate {
- record_emulation_disposal_result(
- &mut first_error,
- "CPU throttling",
- page.set_cpu_throttling_rate_async(load_inputs.cpu_throttling_rate)
- .await,
- );
- }
if delta.network_conditions {
record_emulation_disposal_result(
&mut first_error,
@@ -2749,9 +2699,6 @@ fn finish_emulation_page_operation(
PendingEmulationPageOperation::SetNetworkConditions => page
.finish_set_network_offline(completion)
.map_err(|error| error.to_string()),
- PendingEmulationPageOperation::SetCpuThrottlingRate => page
- .finish_set_cpu_throttling_rate(completion)
- .map_err(|error| error.to_string()),
PendingEmulationPageOperation::SetIdleOverride => page
.finish_set_idle_override(completion)
.map_err(|error| error.to_string()),
diff --git a/moli-protocol/src/domains/emulation/tests.rs b/moli-protocol/src/domains/emulation/tests.rs
index 7662a15c5..516a7db72 100644
--- a/moli-protocol/src/domains/emulation/tests.rs
+++ b/moli-protocol/src/domains/emulation/tests.rs
@@ -439,7 +439,7 @@ async fn pending_emulation_completion_follows_the_exact_target_across_activation
!super::pending_emulation_page_configuration_will_be_replayed(
&ctx.conn,
&target,
- &super::PendingEmulationPageOperation::SetCpuThrottlingRate,
+ &super::PendingEmulationPageOperation::SetEmulatedMedia,
Some(dispatched_attachment_id),
),
"changing foreground selection must not make an error from the same Page look stale"
@@ -457,7 +457,7 @@ async fn pending_emulation_completion_follows_the_exact_target_across_activation
super::pending_emulation_page_configuration_will_be_replayed(
&ctx.conn,
&target,
- &super::PendingEmulationPageOperation::SetCpuThrottlingRate,
+ &super::PendingEmulationPageOperation::SetEmulatedMedia,
Some(dispatched_attachment_id),
),
"only replacement of the exact target attachment may retire its renderer error"
@@ -480,7 +480,7 @@ async fn pending_emulation_completion_follows_the_exact_target_across_activation
completed: super::CompletedEmulationRendererDispatch::Pages(vec![
super::CompletedEmulationPageCommand {
target,
- operation: super::PendingEmulationPageOperation::SetCpuThrottlingRate,
+ operation: super::PendingEmulationPageOperation::SetEmulatedMedia,
dispatched_attachment_id: Some(dispatched_attachment_id),
completed: Err("renderer attachment retired".to_owned()),
},
@@ -862,13 +862,6 @@ async fn pure_state_emulation_commands_complete_through_command_dispatch() {
.effective_emulation_state
.emit_touch_events_for_mouse
);
- assert_eq!(
- browser_context
- .active_page_target()
- .effective_emulation_state
- .cpu_throttling_rate,
- 1.0
- );
}
#[tokio::test(flavor = "multi_thread")]
@@ -887,17 +880,6 @@ async fn set_cpu_throttling_rate_rejects_invalid_params() {
}))
.await;
ctx.expect_error(9115, -32602, "InvalidParams");
-
- assert_eq!(
- ctx.conn
- .browser_context
- .as_ref()
- .expect("browser context")
- .active_page_target()
- .effective_emulation_state
- .cpu_throttling_rate,
- 1.0
- );
}
#[tokio::test(flavor = "multi_thread")]
@@ -954,17 +936,6 @@ async fn live_apply_emulation_commands_without_loaded_page_do_not_use_legacy_fal
&& message["result"] == json!({})
}));
}
-
- assert_eq!(
- ctx.conn
- .browser_context
- .as_ref()
- .expect("browser context")
- .active_page_target()
- .effective_emulation_state
- .cpu_throttling_rate,
- 1.0
- );
}
#[tokio::test(flavor = "multi_thread")]
@@ -1065,7 +1036,7 @@ async fn device_metrics_completion_survives_initial_page_replacement() {
}
#[tokio::test(flavor = "multi_thread")]
-async fn clearing_cpu_throttling_uses_pending_command_dispatch() {
+async fn clearing_cpu_throttling_completes_without_renderer_dispatch() {
let mut ctx = TestContext::new();
load_session_page_for_pending_emulation_test(&mut ctx).await;
@@ -1076,14 +1047,8 @@ async fn clearing_cpu_throttling_uses_pending_command_dispatch() {
"params": { "rate": 1 }
})
.to_string();
- let CdpCommandTaskStep::Pending(pending) = ctx.conn.start_command_dispatch(&raw) else {
- panic!("loaded Emulation.setCPUThrottlingRate should update the live renderer page");
- };
- let completed = pending.wait().await;
- let CdpCommandTaskStep::Complete(outcome) =
- ctx.conn.complete_pending_command_dispatch(completed).await
- else {
- panic!("CPU throttling rate should complete in one renderer phase");
+ let CdpCommandTaskStep::Complete(outcome) = ctx.conn.start_command_dispatch(&raw) else {
+ panic!("neutral CPU throttling must not enqueue a renderer command");
};
let messages = outcome.into_parts().0;
assert!(messages.iter().any(|message| {
@@ -1091,16 +1056,6 @@ async fn clearing_cpu_throttling_uses_pending_command_dispatch() {
&& message["sessionId"] == json!("SID-1")
&& message["result"] == json!({})
}));
- assert_eq!(
- ctx.conn
- .browser_context
- .as_ref()
- .expect("browser context")
- .active_page_target()
- .effective_emulation_state
- .cpu_throttling_rate,
- 1.0
- );
}
#[tokio::test(flavor = "multi_thread")]
@@ -1435,8 +1390,7 @@ async fn multi_session_emulation_separates_handler_input_from_target_effective_s
.conn
.emulation_session_state_for_session_owner(Some("SID-attached"))
.expect("attached Emulation handler state");
- assert_eq!(primary.cpu_throttling_rate, 1.0);
- assert_eq!(attached.cpu_throttling_rate, 1.0);
+
assert_eq!(
primary
.emulated_device_metrics
@@ -1460,7 +1414,7 @@ async fn multi_session_emulation_separates_handler_input_from_target_effective_s
.as_ref()
.expect("browser context")
.active_page_target();
- assert_eq!(target.effective_emulation_state.cpu_throttling_rate, 1.0);
+
assert_eq!(
target
.effective_emulation_state
@@ -1480,7 +1434,7 @@ async fn multi_session_emulation_separates_handler_input_from_target_effective_s
.as_ref()
.expect("browser context")
.active_page_target();
- assert_eq!(target.effective_emulation_state.cpu_throttling_rate, 1.0);
+
assert!(
target
.effective_emulation_state
@@ -1495,7 +1449,7 @@ async fn multi_session_emulation_separates_handler_input_from_target_effective_s
.conn
.emulation_session_state_for_session_owner(Some("SID-primary"))
.expect("primary Emulation handler state survives attached disposal");
- assert_eq!(primary.cpu_throttling_rate, 1.0);
+
assert!(primary.emulated_device_metrics.is_some());
assert!(primary.focus_emulation_enabled);
assert_eq!(
@@ -3493,7 +3447,7 @@ async fn target_session_detach_disposes_non_aggregated_emulation_state_before_re
.as_ref()
.and_then(|browser_context| browser_context.page_target("TID-1"))
.expect("detached target remains addressable");
- assert_eq!(target.effective_emulation_state.cpu_throttling_rate, 1.0);
+
assert_eq!(
target.effective_emulation_state.emulated_media,
crate::conn::EmulatedMediaOverrides::default()
diff --git a/moli-protocol/src/domains/emulation/tests/native_navigator.rs b/moli-protocol/src/domains/emulation/tests/native_navigator.rs
index 02a18d606..a959ee317 100644
--- a/moli-protocol/src/domains/emulation/tests/native_navigator.rs
+++ b/moli-protocol/src/domains/emulation/tests/native_navigator.rs
@@ -519,16 +519,6 @@ async fn unsupported_throttling_rejects_before_changing_live_offline_state() {
}
ctx.process_async(json!({"id":88001,"sessionId":"SID-1","method":"Emulation.setCPUThrottlingRate","params":{"rate":4}})).await;
ctx.expect_error(88001, -32000, "CPU throttling is not supported");
- assert_eq!(
- ctx.conn
- .browser_context
- .as_ref()
- .unwrap()
- .active_page_target()
- .effective_emulation_state
- .cpu_throttling_rate,
- 1.0
- );
}
#[tokio::test(flavor = "multi_thread")]
diff --git a/moli-renderer-v8/src/lib.rs b/moli-renderer-v8/src/lib.rs
index d80bbb95c..dcd26d948 100644
--- a/moli-renderer-v8/src/lib.rs
+++ b/moli-renderer-v8/src/lib.rs
@@ -241,7 +241,7 @@ pub use runtime::{
RendererDocumentLifecycleWaitOutcome, RendererDocumentLifecycleWaiter,
RendererDocumentNodeAttributesResolution, RendererDocumentNodeClientRect,
RendererDocumentNodeGeometry, RendererDocumentNodePropertyResolution,
- RendererDocumentNodeReference, RendererDocumentNodeTextResolution,
+ RendererDocumentNodeReference, RendererDocumentNodeTextResolution, RendererDocumentOptions,
RendererDocumentQuerySelectorNode, RendererDocumentQuerySelectorResolution,
RendererDocumentQuerySelectorWithChildNodeSnapshotEvents,
RendererDocumentSourcedSameDocumentNavigation,
diff --git a/moli-renderer-v8/src/runtime/mod.rs b/moli-renderer-v8/src/runtime/mod.rs
index 5990beaad..53a9ed6f1 100644
--- a/moli-renderer-v8/src/runtime/mod.rs
+++ b/moli-renderer-v8/src/runtime/mod.rs
@@ -289,7 +289,9 @@ pub use self::owner_local::{
RendererPageCommandPending, RendererPageHandle, RendererRuntimeInspectorSessionDetachGuard,
};
pub(crate) use self::owner_local_store::RendererPageToken;
-pub use self::page::{JsRuntime, JsRuntimeOwner, PendingHtmlPage, PreparedRendererDocument};
+pub use self::page::{
+ JsRuntime, JsRuntimeOwner, PendingHtmlPage, PreparedRendererDocument, RendererDocumentOptions,
+};
use self::page::{PageVmNavigationResponse, PageVmStateCapture};
pub(crate) use self::page_context_cancel::{
RendererPageContextCancelReason, RendererPageContextCancelReceiver,
diff --git a/moli-renderer-v8/src/runtime/owner.rs b/moli-renderer-v8/src/runtime/owner.rs
index 801823204..2361abe65 100644
--- a/moli-renderer-v8/src/runtime/owner.rs
+++ b/moli-renderer-v8/src/runtime/owner.rs
@@ -108,7 +108,6 @@ pub struct RendererPreparedDocumentCommitConfiguration {
pub extra_http_headers: Vec<(String, String)>,
pub script_execution_disabled: bool,
pub bypass_content_security_policy: bool,
- pub cpu_throttling_rate: f64,
pub emulated_media: crate::protocol_types::EmulatedMediaOverrides,
pub idle_override: Option<crate::protocol_types::EmulatedIdleOverride>,
pub navigator_overrides: moli_page_types::NavigatorOverrides,
@@ -154,7 +153,6 @@ pub struct RendererCreateHtmlPageRequest {
pub extra_http_headers: Vec<(String, String)>,
pub script_execution_disabled: bool,
pub bypass_content_security_policy: bool,
- pub cpu_throttling_rate: f64,
pub network_offline: bool,
pub blocked_url_patterns: Vec<String>,
pub indexed_db_manager: Option<crate::context_bootstrap::WeakIndexedDbManager>,
@@ -203,7 +201,6 @@ pub struct RendererCreateStreamingRawPageRequest {
pub extra_http_headers: Vec<(String, String)>,
pub script_execution_disabled: bool,
pub bypass_content_security_policy: bool,
- pub cpu_throttling_rate: f64,
pub network_offline: bool,
pub blocked_url_patterns: Vec<String>,
pub indexed_db_manager: Option<crate::context_bootstrap::WeakIndexedDbManager>,
@@ -2082,21 +2079,18 @@ impl RendererOwnerHandle {
web_storage,
final_url,
html,
- document_start_scripts,
- runtime_bindings,
- runtime_inspector_session_restore_snapshots,
- extra_http_headers,
- false,
- false,
- 1.0,
- crate::protocol_types::EmulatedMediaOverrides::default(),
- None,
- Default::default(),
- network_offline,
- blocked_url_patterns,
- fetch_subresource_interception_enabled,
- fetch_subresource_interception_resource_type,
stage,
+ crate::RendererDocumentOptions {
+ document_start_scripts,
+ runtime_bindings,
+ runtime_inspector_session_restore_snapshots,
+ extra_http_headers,
+ network_offline,
+ blocked_url_patterns,
+ fetch_subresource_interception_enabled,
+ fetch_subresource_interception_resource_type,
+ ..Default::default()
+ },
)
}
@@ -2113,26 +2107,13 @@ impl RendererOwnerHandle {
web_storage: crate::RendererWebStorageHandles,
final_url: Url,
html: String,
- document_start_scripts: Vec<DocumentStartScript>,
- runtime_bindings: Vec<crate::protocol_types::RuntimeBindingRegistration>,
- runtime_inspector_session_restore_snapshots: Vec<RendererInspectorSessionRestoreSnapshot>,
- extra_http_headers: Vec<(String, String)>,
- script_execution_disabled: bool,
- bypass_content_security_policy: bool,
- cpu_throttling_rate: f64,
- emulated_media: crate::protocol_types::EmulatedMediaOverrides,
- viewport_surface: Option<crate::protocol_types::ViewportSurface>,
- document_activity: moli_page_types::DocumentActivity,
- network_offline: bool,
- blocked_url_patterns: Vec<String>,
- fetch_subresource_interception_enabled: bool,
- fetch_subresource_interception_resource_type: Option<crate::SubresourceResourceType>,
stage: PageVmInitStage,
+ options: crate::RendererDocumentOptions,
) -> RendererCreateHtmlPageRequest {
RendererCreateHtmlPageRequest {
page_reservation,
- root_frame_id: None,
- main_document_commit: None,
+ root_frame_id: options.root_frame_id,
+ main_document_commit: options.main_document_commit,
top_level_storage_key: None,
requested_url,
navigation_initiator_url,
@@ -2145,26 +2126,27 @@ impl RendererOwnerHandle {
web_storage,
final_url,
html,
- document_start_scripts,
- runtime_bindings,
- runtime_inspector_session_restore_snapshots,
+ document_start_scripts: options.document_start_scripts,
+ runtime_bindings: options.runtime_bindings,
+ runtime_inspector_session_restore_snapshots: options
+ .runtime_inspector_session_restore_snapshots,
runtime_isolated_worlds: Vec::new(),
permission_overrides: Vec::new(),
- extra_http_headers,
- script_execution_disabled,
- bypass_content_security_policy,
- cpu_throttling_rate,
- network_offline,
- blocked_url_patterns,
- indexed_db_manager: None,
- storage_bucket_store: None,
- emulated_media,
+ extra_http_headers: options.extra_http_headers,
+ script_execution_disabled: options.script_execution_disabled,
+ bypass_content_security_policy: options.bypass_content_security_policy,
+ network_offline: options.network_offline,
+ blocked_url_patterns: options.blocked_url_patterns,
+ indexed_db_manager: options.indexed_db_manager,
+ storage_bucket_store: options.storage_bucket_store,
+ emulated_media: options.emulated_media,
idle_override: None,
navigator_overrides: Default::default(),
- viewport_surface,
- document_activity,
- fetch_subresource_interception_enabled,
- fetch_subresource_interception_resource_type,
+ viewport_surface: options.viewport_surface,
+ document_activity: options.document_activity,
+ fetch_subresource_interception_enabled: options.fetch_subresource_interception_enabled,
+ fetch_subresource_interception_resource_type: options
+ .fetch_subresource_interception_resource_type,
layout_policy: self.seal_layout_policy_for_page_creation(),
wpt_extensions_enabled: false,
stage,
@@ -2189,25 +2171,12 @@ impl RendererOwnerHandle {
loader: &ResourceRequestClient,
web_storage: crate::RendererWebStorageHandles,
raw_body: ExternalRawDocumentBodyStream,
- document_start_scripts: Vec<DocumentStartScript>,
- runtime_bindings: Vec<crate::protocol_types::RuntimeBindingRegistration>,
- runtime_inspector_session_restore_snapshots: Vec<RendererInspectorSessionRestoreSnapshot>,
- extra_http_headers: Vec<(String, String)>,
- script_execution_disabled: bool,
- bypass_content_security_policy: bool,
- cpu_throttling_rate: f64,
- emulated_media: crate::protocol_types::EmulatedMediaOverrides,
- viewport_surface: Option<crate::protocol_types::ViewportSurface>,
- document_activity: moli_page_types::DocumentActivity,
- network_offline: bool,
- blocked_url_patterns: Vec<String>,
- fetch_subresource_interception_enabled: bool,
- fetch_subresource_interception_resource_type: Option<crate::SubresourceResourceType>,
stage: PageVmInitStage,
+ options: crate::RendererDocumentOptions,
) -> RendererCreateStreamingRawPageRequest {
RendererCreateStreamingRawPageRequest {
- root_frame_id: None,
- main_document_commit: None,
+ root_frame_id: options.root_frame_id,
+ main_document_commit: options.main_document_commit,
requested_url,
final_url,
navigation_initiator_url,
@@ -2220,26 +2189,27 @@ impl RendererOwnerHandle {
navigator_identity: loader.browser_identity().clone(),
web_storage,
raw_body,
- document_start_scripts,
- runtime_bindings,
- runtime_inspector_session_restore_snapshots,
+ document_start_scripts: options.document_start_scripts,
+ runtime_bindings: options.runtime_bindings,
+ runtime_inspector_session_restore_snapshots: options
+ .runtime_inspector_session_restore_snapshots,
runtime_isolated_worlds: Vec::new(),
permission_overrides: Vec::new(),
- extra_http_headers,
- script_execution_disabled,
- bypass_content_security_policy,
- cpu_throttling_rate,
- emulated_media,
+ extra_http_headers: options.extra_http_headers,
+ script_execution_disabled: options.script_execution_disabled,
+ bypass_content_security_policy: options.bypass_content_security_policy,
+ emulated_media: options.emulated_media,
idle_override: None,
navigator_overrides: Default::default(),
- viewport_surface,
- document_activity,
- network_offline,
- blocked_url_patterns,
- indexed_db_manager: None,
- storage_bucket_store: None,
- fetch_subresource_interception_enabled,
- fetch_subresource_interception_resource_type,
+ viewport_surface: options.viewport_surface,
+ document_activity: options.document_activity,
+ network_offline: options.network_offline,
+ blocked_url_patterns: options.blocked_url_patterns,
+ indexed_db_manager: options.indexed_db_manager,
+ storage_bucket_store: options.storage_bucket_store,
+ fetch_subresource_interception_enabled: options.fetch_subresource_interception_enabled,
+ fetch_subresource_interception_resource_type: options
+ .fetch_subresource_interception_resource_type,
layout_policy: self.seal_layout_policy_for_page_creation(),
wpt_extensions_enabled: false,
stage,
@@ -6830,7 +6800,6 @@ impl RendererOwnerHandle {
extra_http_headers,
script_execution_disabled,
bypass_content_security_policy,
- cpu_throttling_rate,
network_offline,
blocked_url_patterns,
indexed_db_manager,
@@ -6920,7 +6889,6 @@ impl RendererOwnerHandle {
document_last_modified,
script_execution_disabled,
bypass_content_security_policy,
- cpu_throttling_rate,
emulated_media,
idle_override,
navigator_overrides,
@@ -7143,7 +7111,6 @@ impl RendererOwnerHandle {
extra_http_headers,
script_execution_disabled,
bypass_content_security_policy,
- cpu_throttling_rate,
network_offline,
blocked_url_patterns,
indexed_db_manager,
@@ -7221,7 +7188,6 @@ impl RendererOwnerHandle {
document_last_modified,
script_execution_disabled,
bypass_content_security_policy,
- cpu_throttling_rate,
emulated_media,
idle_override,
navigator_overrides,
diff --git a/moli-renderer-v8/src/runtime/owner_local_store/mod.rs b/moli-renderer-v8/src/runtime/owner_local_store/mod.rs
index cbe13f366..b3a1dd663 100644
--- a/moli-renderer-v8/src/runtime/owner_local_store/mod.rs
+++ b/moli-renderer-v8/src/runtime/owner_local_store/mod.rs
@@ -913,7 +913,6 @@ impl RendererOwnerLocalStore {
request.script_execution_disabled = configuration.script_execution_disabled;
request.bypass_content_security_policy =
configuration.bypass_content_security_policy;
- request.cpu_throttling_rate = configuration.cpu_throttling_rate;
request.emulated_media = configuration.emulated_media;
request.idle_override = configuration.idle_override;
request.navigator_overrides = configuration.navigator_overrides;
diff --git a/moli-renderer-v8/src/runtime/page.rs b/moli-renderer-v8/src/runtime/page.rs
index 074daa9ac..d3cc3d9af 100644
--- a/moli-renderer-v8/src/runtime/page.rs
+++ b/moli-renderer-v8/src/runtime/page.rs
@@ -24,6 +24,29 @@ use super::{
RendererReservedServiceWorkerClient,
};
+/// Optional document bootstrap inputs shared by HTML and streaming creation.
+/// Applied before document-start scripts; live updates use Page commands.
+#[derive(Default)]
+pub struct RendererDocumentOptions {
+ pub indexed_db_manager: Option<crate::context_bootstrap::WeakIndexedDbManager>,
+ pub storage_bucket_store: Option<crate::context_bootstrap::SharedStorageBucketStore>,
+ pub document_start_scripts: Vec<DocumentStartScript>,
+ pub runtime_bindings: Vec<crate::protocol_types::RuntimeBindingRegistration>,
+ pub extra_http_headers: Vec<(String, String)>,
+ pub script_execution_disabled: bool,
+ pub bypass_content_security_policy: bool,
+ pub emulated_media: crate::protocol_types::EmulatedMediaOverrides,
+ pub viewport_surface: Option<crate::protocol_types::ViewportSurface>,
+ pub document_activity: moli_page_types::DocumentActivity,
+ pub network_offline: bool,
+ pub blocked_url_patterns: Vec<String>,
+ pub fetch_subresource_interception_enabled: bool,
+ pub fetch_subresource_interception_resource_type: Option<crate::SubresourceResourceType>,
+ pub runtime_inspector_session_restore_snapshots: Vec<RendererInspectorSessionRestoreSnapshot>,
+ pub root_frame_id: Option<String>,
+ pub main_document_commit: Option<crate::RendererMainDocumentCommit>,
+}
+
pub(crate) struct PageVmStateCapture {
pub(crate) final_url: Url,
pub(crate) document_title: String,
@@ -221,7 +244,7 @@ impl JsRuntime {
) -> Result<PendingHtmlPage> {
let url = Url::parse("https://reservation.test/")
.expect("static reservation test URL should parse");
- self.start_create_html_page_from_response_with_inspector_session_restores(
+ self.start_create_html_page_from_response(
page_reservation,
url.clone(),
url,
@@ -234,24 +257,10 @@ impl JsRuntime {
crate::RendererWebStorageHandles::ephemeral(),
"<!doctype html>".to_owned(),
None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
- Vec::new(),
- None,
- None,
crate::RendererTopLevelNavigationDispatch::FollowInStandaloneAdapter,
- None,
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
)
}
@@ -324,143 +333,8 @@ impl JsRuntime {
.set_renderer_output_transport_sender(sender);
}
- pub async fn create_html_page_from_response(
- &self,
- requested_url: Url,
- final_url: Url,
- navigation_initiator_url: Option<Url>,
- navigation_redirected: bool,
- navigation_redirect_count: usize,
- response_status: u16,
- response_headers: Vec<(String, String)>,
- loader: &ResourceRequestClient,
- web_storage: crate::RendererWebStorageHandles,
- html: String,
- indexed_db_manager: Option<crate::context_bootstrap::WeakIndexedDbManager>,
- storage_bucket_store: Option<crate::context_bootstrap::SharedStorageBucketStore>,
- document_start_scripts: Vec<DocumentStartScript>,
- runtime_bindings: Vec<crate::protocol_types::RuntimeBindingRegistration>,
- extra_http_headers: Vec<(String, String)>,
- script_execution_disabled: bool,
- cpu_throttling_rate: f64,
- emulated_media: crate::protocol_types::EmulatedMediaOverrides,
- viewport_surface: Option<crate::protocol_types::ViewportSurface>,
- network_offline: bool,
- blocked_url_patterns: Vec<String>,
- fetch_subresource_interception_enabled: bool,
- fetch_subresource_interception_resource_type: Option<crate::SubresourceResourceType>,
- ) -> Result<(
- RendererPageHandle,
- Arc<RendererPageState>,
- RendererPageCreationDiagnostics,
- RendererPageCreationArtifacts,
- Option<RendererPendingDownloadActivation>,
- )> {
- self.create_html_page_from_response_with_inspector_session_restores(
- requested_url,
- final_url,
- navigation_initiator_url,
- navigation_redirected,
- navigation_redirect_count,
- response_status,
- response_headers,
- loader,
- web_storage,
- html,
- indexed_db_manager,
- storage_bucket_store,
- document_start_scripts,
- runtime_bindings,
- extra_http_headers,
- script_execution_disabled,
- false,
- cpu_throttling_rate,
- emulated_media,
- viewport_surface,
- network_offline,
- blocked_url_patterns,
- fetch_subresource_interception_enabled,
- fetch_subresource_interception_resource_type,
- Vec::new(),
- None,
- None,
- )
- .await
- }
-
- /// Creates a document using the default focused/visible activity state.
#[allow(clippy::too_many_arguments)]
- pub async fn create_html_page_from_response_with_inspector_session_restores(
- &self,
- requested_url: Url,
- final_url: Url,
- navigation_initiator_url: Option<Url>,
- navigation_redirected: bool,
- navigation_redirect_count: usize,
- response_status: u16,
- response_headers: Vec<(String, String)>,
- loader: &ResourceRequestClient,
- web_storage: crate::RendererWebStorageHandles,
- html: String,
- indexed_db_manager: Option<crate::context_bootstrap::WeakIndexedDbManager>,
- storage_bucket_store: Option<crate::context_bootstrap::SharedStorageBucketStore>,
- document_start_scripts: Vec<DocumentStartScript>,
- runtime_bindings: Vec<crate::protocol_types::RuntimeBindingRegistration>,
- extra_http_headers: Vec<(String, String)>,
- script_execution_disabled: bool,
- bypass_content_security_policy: bool,
- cpu_throttling_rate: f64,
- emulated_media: crate::protocol_types::EmulatedMediaOverrides,
- viewport_surface: Option<crate::protocol_types::ViewportSurface>,
- network_offline: bool,
- blocked_url_patterns: Vec<String>,
- fetch_subresource_interception_enabled: bool,
- fetch_subresource_interception_resource_type: Option<crate::SubresourceResourceType>,
- runtime_inspector_session_restore_snapshots: Vec<RendererInspectorSessionRestoreSnapshot>,
- root_frame_id: Option<String>,
- main_document_commit: Option<crate::RendererMainDocumentCommit>,
- ) -> Result<(
- RendererPageHandle,
- Arc<RendererPageState>,
- RendererPageCreationDiagnostics,
- RendererPageCreationArtifacts,
- Option<RendererPendingDownloadActivation>,
- )> {
- self.create_html_page_from_response_with_inspector_session_restores_and_activity(
- requested_url,
- final_url,
- navigation_initiator_url,
- navigation_redirected,
- navigation_redirect_count,
- response_status,
- response_headers,
- loader,
- web_storage,
- html,
- indexed_db_manager,
- storage_bucket_store,
- document_start_scripts,
- runtime_bindings,
- extra_http_headers,
- script_execution_disabled,
- bypass_content_security_policy,
- cpu_throttling_rate,
- emulated_media,
- viewport_surface,
- Default::default(),
- network_offline,
- blocked_url_patterns,
- fetch_subresource_interception_enabled,
- fetch_subresource_interception_resource_type,
- runtime_inspector_session_restore_snapshots,
- root_frame_id,
- main_document_commit,
- )
- .await
- }
-
- #[allow(clippy::too_many_arguments)]
- pub async fn create_html_page_from_response_with_inspector_session_restores_and_activity(
+ pub async fn create_html_page_from_response(
&self,
requested_url: Url,
final_url: Url,
@@ -472,24 +346,7 @@ impl JsRuntime {
loader: &ResourceRequestClient,
web_storage: crate::RendererWebStorageHandles,
html: String,
- indexed_db_manager: Option<crate::context_bootstrap::WeakIndexedDbManager>,
- storage_bucket_store: Option<crate::context_bootstrap::SharedStorageBucketStore>,
- document_start_scripts: Vec<DocumentStartScript>,
- runtime_bindings: Vec<crate::protocol_types::RuntimeBindingRegistration>,
- extra_http_headers: Vec<(String, String)>,
- script_execution_disabled: bool,
- bypass_content_security_policy: bool,
- cpu_throttling_rate: f64,
- emulated_media: crate::protocol_types::EmulatedMediaOverrides,
- viewport_surface: Option<crate::protocol_types::ViewportSurface>,
- document_activity: moli_page_types::DocumentActivity,
- network_offline: bool,
- blocked_url_patterns: Vec<String>,
- fetch_subresource_interception_enabled: bool,
- fetch_subresource_interception_resource_type: Option<crate::SubresourceResourceType>,
- runtime_inspector_session_restore_snapshots: Vec<RendererInspectorSessionRestoreSnapshot>,
- root_frame_id: Option<String>,
- main_document_commit: Option<crate::RendererMainDocumentCommit>,
+ options: RendererDocumentOptions,
) -> Result<(
RendererPageHandle,
Arc<RendererPageState>,
@@ -497,7 +354,7 @@ impl JsRuntime {
RendererPageCreationArtifacts,
Option<RendererPendingDownloadActivation>,
)> {
- let mut request = self
+ let request = self
.inner
.renderer_owner
.build_create_html_page_request_with_env(
@@ -512,26 +369,9 @@ impl JsRuntime {
web_storage,
final_url,
html,
- document_start_scripts,
- runtime_bindings,
- runtime_inspector_session_restore_snapshots,
- extra_http_headers,
- script_execution_disabled,
- bypass_content_security_policy,
- cpu_throttling_rate,
- emulated_media,
- viewport_surface,
- document_activity,
- network_offline,
- blocked_url_patterns,
- fetch_subresource_interception_enabled,
- fetch_subresource_interception_resource_type,
PageVmInitStage::Load,
+ options,
);
- request.indexed_db_manager = indexed_db_manager;
- request.storage_bucket_store = storage_bucket_store;
- request.root_frame_id = root_frame_id;
- request.main_document_commit = main_document_commit;
let reply = self
.inner
.renderer_owner
@@ -542,78 +382,8 @@ impl JsRuntime {
.materialize_page_created_reply_parts(reply)
}
- /// Fire-and-defer variant of [`Self::create_html_page_from_response`].
- ///
- /// Performs the synchronous request preparation, enqueues the renderer
- /// command, and returns a [`PendingHtmlPage`] without awaiting the reply.
- /// The renderer thread can then process the heavy V8/parse work in
- /// parallel with conn-side bookkeeping; the caller awaits the result via
- /// [`PendingHtmlPage::await_ready`] when the page is actually needed.
#[allow(clippy::too_many_arguments)]
pub fn start_create_html_page_from_response(
- &self,
- requested_url: Url,
- final_url: Url,
- navigation_initiator_url: Option<Url>,
- navigation_redirected: bool,
- navigation_redirect_count: usize,
- response_status: u16,
- response_headers: Vec<(String, String)>,
- loader: &ResourceRequestClient,
- web_storage: crate::RendererWebStorageHandles,
- html: String,
- indexed_db_manager: Option<crate::context_bootstrap::WeakIndexedDbManager>,
- storage_bucket_store: Option<crate::context_bootstrap::SharedStorageBucketStore>,
- document_start_scripts: Vec<DocumentStartScript>,
- runtime_bindings: Vec<crate::protocol_types::RuntimeBindingRegistration>,
- extra_http_headers: Vec<(String, String)>,
- script_execution_disabled: bool,
- cpu_throttling_rate: f64,
- emulated_media: crate::protocol_types::EmulatedMediaOverrides,
- viewport_surface: Option<crate::protocol_types::ViewportSurface>,
- network_offline: bool,
- blocked_url_patterns: Vec<String>,
- fetch_subresource_interception_enabled: bool,
- fetch_subresource_interception_resource_type: Option<crate::SubresourceResourceType>,
- ) -> Result<PendingHtmlPage> {
- self.start_create_html_page_from_response_with_inspector_session_restores(
- self.reserve_page_for_creation(),
- requested_url,
- final_url,
- navigation_initiator_url,
- navigation_redirected,
- navigation_redirect_count,
- response_status,
- response_headers,
- loader,
- web_storage,
- html,
- indexed_db_manager,
- storage_bucket_store,
- document_start_scripts,
- runtime_bindings,
- extra_http_headers,
- script_execution_disabled,
- false,
- cpu_throttling_rate,
- emulated_media,
- viewport_surface,
- network_offline,
- blocked_url_patterns,
- fetch_subresource_interception_enabled,
- fetch_subresource_interception_resource_type,
- Vec::new(),
- None,
- None,
- crate::RendererTopLevelNavigationDispatch::FollowInStandaloneAdapter,
- None,
- )
- }
-
- /// Starts a document creation with the default focused/visible activity
- /// state.
- #[allow(clippy::too_many_arguments)]
- pub fn start_create_html_page_from_response_with_inspector_session_restores(
&self,
page_reservation: RendererPageReservationToken,
requested_url: Url,
@@ -626,95 +396,9 @@ impl JsRuntime {
loader: &ResourceRequestClient,
web_storage: crate::RendererWebStorageHandles,
html: String,
- indexed_db_manager: Option<crate::context_bootstrap::WeakIndexedDbManager>,
- storage_bucket_store: Option<crate::context_bootstrap::SharedStorageBucketStore>,
- document_start_scripts: Vec<DocumentStartScript>,
- runtime_bindings: Vec<crate::protocol_types::RuntimeBindingRegistration>,
- extra_http_headers: Vec<(String, String)>,
- script_execution_disabled: bool,
- bypass_content_security_policy: bool,
- cpu_throttling_rate: f64,
- emulated_media: crate::protocol_types::EmulatedMediaOverrides,
- viewport_surface: Option<crate::protocol_types::ViewportSurface>,
- network_offline: bool,
- blocked_url_patterns: Vec<String>,
- fetch_subresource_interception_enabled: bool,
- fetch_subresource_interception_resource_type: Option<crate::SubresourceResourceType>,
- runtime_inspector_session_restore_snapshots: Vec<RendererInspectorSessionRestoreSnapshot>,
- root_frame_id: Option<String>,
top_level_storage_key: Option<moli_storage_key::MoliStorageKey>,
top_level_navigation_dispatch: crate::RendererTopLevelNavigationDispatch,
- main_document_commit: Option<crate::RendererMainDocumentCommit>,
- ) -> Result<PendingHtmlPage> {
- self.start_create_html_page_from_response_with_inspector_session_restores_and_activity(
- page_reservation,
- requested_url,
- final_url,
- navigation_initiator_url,
- navigation_redirected,
- navigation_redirect_count,
- response_status,
- response_headers,
- loader,
- web_storage,
- html,
- indexed_db_manager,
- storage_bucket_store,
- document_start_scripts,
- runtime_bindings,
- extra_http_headers,
- script_execution_disabled,
- bypass_content_security_policy,
- cpu_throttling_rate,
- emulated_media,
- viewport_surface,
- Default::default(),
- network_offline,
- blocked_url_patterns,
- fetch_subresource_interception_enabled,
- fetch_subresource_interception_resource_type,
- runtime_inspector_session_restore_snapshots,
- root_frame_id,
- top_level_storage_key,
- top_level_navigation_dispatch,
- main_document_commit,
- )
- }
-
- #[allow(clippy::too_many_arguments)]
- pub fn start_create_html_page_from_response_with_inspector_session_restores_and_activity(
- &self,
- page_reservation: RendererPageReservationToken,
- requested_url: Url,
- final_url: Url,
- navigation_initiator_url: Option<Url>,
- navigation_redirected: bool,
- navigation_redirect_count: usize,
- response_status: u16,
- response_headers: Vec<(String, String)>,
- loader: &ResourceRequestClient,
- web_storage: crate::RendererWebStorageHandles,
- html: String,
- indexed_db_manager: Option<crate::context_bootstrap::WeakIndexedDbManager>,
- storage_bucket_store: Option<crate::context_bootstrap::SharedStorageBucketStore>,
- document_start_scripts: Vec<DocumentStartScript>,
- runtime_bindings: Vec<crate::protocol_types::RuntimeBindingRegistration>,
- extra_http_headers: Vec<(String, String)>,
- script_execution_disabled: bool,
- bypass_content_security_policy: bool,
- cpu_throttling_rate: f64,
- emulated_media: crate::protocol_types::EmulatedMediaOverrides,
- viewport_surface: Option<crate::protocol_types::ViewportSurface>,
- document_activity: moli_page_types::DocumentActivity,
- network_offline: bool,
- blocked_url_patterns: Vec<String>,
- fetch_subresource_interception_enabled: bool,
- fetch_subresource_interception_resource_type: Option<crate::SubresourceResourceType>,
- runtime_inspector_session_restore_snapshots: Vec<RendererInspectorSessionRestoreSnapshot>,
- root_frame_id: Option<String>,
- top_level_storage_key: Option<moli_storage_key::MoliStorageKey>,
- top_level_navigation_dispatch: crate::RendererTopLevelNavigationDispatch,
- main_document_commit: Option<crate::RendererMainDocumentCommit>,
+ options: RendererDocumentOptions,
) -> Result<PendingHtmlPage> {
let mut request = self
.inner
@@ -731,28 +415,11 @@ impl JsRuntime {
web_storage,
final_url,
html,
- document_start_scripts,
- runtime_bindings,
- runtime_inspector_session_restore_snapshots,
- extra_http_headers,
- script_execution_disabled,
- bypass_content_security_policy,
- cpu_throttling_rate,
- emulated_media,
- viewport_surface,
- document_activity,
- network_offline,
- blocked_url_patterns,
- fetch_subresource_interception_enabled,
- fetch_subresource_interception_resource_type,
PageVmInitStage::Load,
+ options,
);
- request.indexed_db_manager = indexed_db_manager;
- request.storage_bucket_store = storage_bucket_store;
- request.root_frame_id = root_frame_id;
request.top_level_storage_key = top_level_storage_key;
request.top_level_navigation_dispatch = top_level_navigation_dispatch;
- request.main_document_commit = main_document_commit;
let reply_rx = self
.inner
.renderer_owner
@@ -768,90 +435,13 @@ impl JsRuntime {
///
/// Protocol coordinators that must route pre-install output bind this
/// identity to their target first, then pass it to
- /// [`Self::start_create_html_page_from_response_with_inspector_session_restores`].
+ /// [`Self::start_create_html_page_from_response`].
pub fn reserve_page_for_creation(&self) -> RendererPageReservationToken {
self.inner.renderer_owner.allocate_page_reservation_token()
}
- pub async fn create_streaming_raw_page_from_external_body(
- &self,
- requested_url: Url,
- final_url: Url,
- navigation_initiator_url: Option<Url>,
- navigation_redirected: bool,
- navigation_redirect_count: usize,
- navigation_redirect_chain: Vec<crate::protocol_types::NavigationRedirect>,
- response_status: u16,
- response_headers: Vec<(String, String)>,
- loader: &ResourceRequestClient,
- web_storage: crate::RendererWebStorageHandles,
- raw_body: ExternalRawDocumentBodyStream,
- indexed_db_manager: Option<crate::context_bootstrap::WeakIndexedDbManager>,
- storage_bucket_store: Option<crate::context_bootstrap::SharedStorageBucketStore>,
- document_start_scripts: Vec<DocumentStartScript>,
- runtime_bindings: Vec<crate::protocol_types::RuntimeBindingRegistration>,
- extra_http_headers: Vec<(String, String)>,
- script_execution_disabled: bool,
- cpu_throttling_rate: f64,
- emulated_media: crate::protocol_types::EmulatedMediaOverrides,
- viewport_surface: Option<crate::protocol_types::ViewportSurface>,
- network_offline: bool,
- blocked_url_patterns: Vec<String>,
- fetch_subresource_interception_enabled: bool,
- fetch_subresource_interception_resource_type: Option<crate::SubresourceResourceType>,
- wpt_extensions_enabled: bool,
- stage: PageVmInitStage,
- top_level_navigation_dispatch: crate::RendererTopLevelNavigationDispatch,
- navigation_reply_policy: crate::RendererNavigationReplyPolicy,
- ) -> Result<(
- RendererPageHandle,
- Arc<RendererPageState>,
- RendererPageCreationDiagnostics,
- RendererPageCreationArtifacts,
- Option<RendererPendingDownloadActivation>,
- )> {
- self.create_streaming_raw_page_from_external_body_with_inspector_session_restores(
- requested_url,
- final_url,
- navigation_initiator_url,
- navigation_redirected,
- navigation_redirect_count,
- navigation_redirect_chain,
- response_status,
- response_headers,
- loader,
- web_storage,
- raw_body,
- indexed_db_manager,
- storage_bucket_store,
- document_start_scripts,
- runtime_bindings,
- extra_http_headers,
- script_execution_disabled,
- false,
- cpu_throttling_rate,
- emulated_media,
- viewport_surface,
- network_offline,
- blocked_url_patterns,
- fetch_subresource_interception_enabled,
- fetch_subresource_interception_resource_type,
- Vec::new(),
- wpt_extensions_enabled,
- stage,
- crate::RendererReplyBoundary::Stage,
- top_level_navigation_dispatch,
- navigation_reply_policy,
- None,
- None,
- None,
- None,
- )
- .await
- }
-
#[allow(clippy::too_many_arguments)]
- pub async fn create_streaming_raw_page_from_external_body_with_inspector_session_restores(
+ pub async fn create_streaming_raw_page_from_external_body(
&self,
requested_url: Url,
final_url: Url,
@@ -864,30 +454,14 @@ impl JsRuntime {
loader: &ResourceRequestClient,
web_storage: crate::RendererWebStorageHandles,
raw_body: ExternalRawDocumentBodyStream,
- indexed_db_manager: Option<crate::context_bootstrap::WeakIndexedDbManager>,
- storage_bucket_store: Option<crate::context_bootstrap::SharedStorageBucketStore>,
- document_start_scripts: Vec<DocumentStartScript>,
- runtime_bindings: Vec<crate::protocol_types::RuntimeBindingRegistration>,
- extra_http_headers: Vec<(String, String)>,
- script_execution_disabled: bool,
- bypass_content_security_policy: bool,
- cpu_throttling_rate: f64,
- emulated_media: crate::protocol_types::EmulatedMediaOverrides,
- viewport_surface: Option<crate::protocol_types::ViewportSurface>,
- network_offline: bool,
- blocked_url_patterns: Vec<String>,
- fetch_subresource_interception_enabled: bool,
- fetch_subresource_interception_resource_type: Option<crate::SubresourceResourceType>,
- runtime_inspector_session_restore_snapshots: Vec<RendererInspectorSessionRestoreSnapshot>,
wpt_extensions_enabled: bool,
stage: PageVmInitStage,
reply_boundary: crate::RendererReplyBoundary,
top_level_navigation_dispatch: crate::RendererTopLevelNavigationDispatch,
navigation_reply_policy: crate::RendererNavigationReplyPolicy,
- root_frame_id: Option<String>,
reserved_service_worker_client: Option<RendererReservedServiceWorkerClient>,
- main_document_commit: Option<crate::RendererMainDocumentCommit>,
lifecycle_decider: Option<crate::RendererLifecycleDecider>,
+ options: RendererDocumentOptions,
) -> Result<(
RendererPageHandle,
Arc<RendererPageState>,
@@ -896,7 +470,7 @@ impl JsRuntime {
Option<RendererPendingDownloadActivation>,
)> {
let prepared = self
- .prepare_streaming_raw_document_from_external_body_with_inspector_session_restores(
+ .prepare_streaming_raw_document_from_external_body(
self.reserve_page_for_creation(),
requested_url,
final_url,
@@ -909,124 +483,24 @@ impl JsRuntime {
loader,
web_storage,
raw_body,
- indexed_db_manager,
- storage_bucket_store,
- document_start_scripts,
- runtime_bindings,
- extra_http_headers,
- script_execution_disabled,
- bypass_content_security_policy,
- cpu_throttling_rate,
- emulated_media,
- viewport_surface,
- network_offline,
- blocked_url_patterns,
- fetch_subresource_interception_enabled,
- fetch_subresource_interception_resource_type,
- runtime_inspector_session_restore_snapshots,
wpt_extensions_enabled,
stage,
reply_boundary,
top_level_navigation_dispatch,
navigation_reply_policy,
- root_frame_id,
reserved_service_worker_client,
- main_document_commit,
lifecycle_decider,
+ options,
)
.await?;
let permit = prepared.issue_commit_permit();
prepared.commit(permit).await
}
- /// Moves a streaming response and all document bootstrap inputs onto the
- /// renderer owner lane using the default focused/visible activity state.
- #[allow(clippy::too_many_arguments)]
- pub async fn prepare_streaming_raw_document_from_external_body_with_inspector_session_restores(
- &self,
- page_reservation: RendererPageReservationToken,
- requested_url: Url,
- final_url: Url,
- navigation_initiator_url: Option<Url>,
- navigation_redirected: bool,
- navigation_redirect_count: usize,
- navigation_redirect_chain: Vec<crate::protocol_types::NavigationRedirect>,
- response_status: u16,
- response_headers: Vec<(String, String)>,
- loader: &ResourceRequestClient,
- web_storage: crate::RendererWebStorageHandles,
- raw_body: ExternalRawDocumentBodyStream,
- indexed_db_manager: Option<crate::context_bootstrap::WeakIndexedDbManager>,
- storage_bucket_store: Option<crate::context_bootstrap::SharedStorageBucketStore>,
- document_start_scripts: Vec<DocumentStartScript>,
- runtime_bindings: Vec<crate::protocol_types::RuntimeBindingRegistration>,
- extra_http_headers: Vec<(String, String)>,
- script_execution_disabled: bool,
- bypass_content_security_policy: bool,
- cpu_throttling_rate: f64,
- emulated_media: crate::protocol_types::EmulatedMediaOverrides,
- viewport_surface: Option<crate::protocol_types::ViewportSurface>,
- network_offline: bool,
- blocked_url_patterns: Vec<String>,
- fetch_subresource_interception_enabled: bool,
- fetch_subresource_interception_resource_type: Option<crate::SubresourceResourceType>,
- runtime_inspector_session_restore_snapshots: Vec<RendererInspectorSessionRestoreSnapshot>,
- wpt_extensions_enabled: bool,
- stage: PageVmInitStage,
- reply_boundary: crate::RendererReplyBoundary,
- top_level_navigation_dispatch: crate::RendererTopLevelNavigationDispatch,
- navigation_reply_policy: crate::RendererNavigationReplyPolicy,
- root_frame_id: Option<String>,
- reserved_service_worker_client: Option<RendererReservedServiceWorkerClient>,
- main_document_commit: Option<crate::RendererMainDocumentCommit>,
- lifecycle_decider: Option<crate::RendererLifecycleDecider>,
- ) -> Result<PreparedRendererDocument> {
- self.prepare_streaming_raw_document_from_external_body_with_inspector_session_restores_and_activity(
- page_reservation,
- requested_url,
- final_url,
- navigation_initiator_url,
- navigation_redirected,
- navigation_redirect_count,
- navigation_redirect_chain,
- response_status,
- response_headers,
- loader,
- web_storage,
- raw_body,
- indexed_db_manager,
- storage_bucket_store,
- document_start_scripts,
- runtime_bindings,
- extra_http_headers,
- script_execution_disabled,
- bypass_content_security_policy,
- cpu_throttling_rate,
- emulated_media,
- viewport_surface,
- Default::default(),
- network_offline,
- blocked_url_patterns,
- fetch_subresource_interception_enabled,
- fetch_subresource_interception_resource_type,
- runtime_inspector_session_restore_snapshots,
- wpt_extensions_enabled,
- stage,
- reply_boundary,
- top_level_navigation_dispatch,
- navigation_reply_policy,
- root_frame_id,
- reserved_service_worker_client,
- main_document_commit,
- lifecycle_decider,
- )
- .await
- }
-
/// Moves a streaming response and all document bootstrap inputs onto the
/// renderer owner lane without starting the parser or author scripts.
#[allow(clippy::too_many_arguments)]
- pub async fn prepare_streaming_raw_document_from_external_body_with_inspector_session_restores_and_activity(
+ pub async fn prepare_streaming_raw_document_from_external_body(
&self,
page_reservation: RendererPageReservationToken,
requested_url: Url,
@@ -1040,31 +514,14 @@ impl JsRuntime {
loader: &ResourceRequestClient,
web_storage: crate::RendererWebStorageHandles,
raw_body: ExternalRawDocumentBodyStream,
- indexed_db_manager: Option<crate::context_bootstrap::WeakIndexedDbManager>,
- storage_bucket_store: Option<crate::context_bootstrap::SharedStorageBucketStore>,
- document_start_scripts: Vec<DocumentStartScript>,
- runtime_bindings: Vec<crate::protocol_types::RuntimeBindingRegistration>,
- extra_http_headers: Vec<(String, String)>,
- script_execution_disabled: bool,
- bypass_content_security_policy: bool,
- cpu_throttling_rate: f64,
- emulated_media: crate::protocol_types::EmulatedMediaOverrides,
- viewport_surface: Option<crate::protocol_types::ViewportSurface>,
- document_activity: moli_page_types::DocumentActivity,
- network_offline: bool,
- blocked_url_patterns: Vec<String>,
- fetch_subresource_interception_enabled: bool,
- fetch_subresource_interception_resource_type: Option<crate::SubresourceResourceType>,
- runtime_inspector_session_restore_snapshots: Vec<RendererInspectorSessionRestoreSnapshot>,
wpt_extensions_enabled: bool,
stage: PageVmInitStage,
reply_boundary: crate::RendererReplyBoundary,
top_level_navigation_dispatch: crate::RendererTopLevelNavigationDispatch,
navigation_reply_policy: crate::RendererNavigationReplyPolicy,
- root_frame_id: Option<String>,
reserved_service_worker_client: Option<RendererReservedServiceWorkerClient>,
- main_document_commit: Option<crate::RendererMainDocumentCommit>,
lifecycle_decider: Option<crate::RendererLifecycleDecider>,
+ options: RendererDocumentOptions,
) -> Result<PreparedRendererDocument> {
let mut request = self
.inner
@@ -1081,26 +538,9 @@ impl JsRuntime {
loader,
web_storage,
raw_body,
- document_start_scripts,
- runtime_bindings,
- runtime_inspector_session_restore_snapshots,
- extra_http_headers,
- script_execution_disabled,
- bypass_content_security_policy,
- cpu_throttling_rate,
- emulated_media,
- viewport_surface,
- document_activity,
- network_offline,
- blocked_url_patterns,
- fetch_subresource_interception_enabled,
- fetch_subresource_interception_resource_type,
stage,
+ options,
);
- request.indexed_db_manager = indexed_db_manager;
- request.storage_bucket_store = storage_bucket_store;
- request.root_frame_id = root_frame_id;
- request.main_document_commit = main_document_commit;
request.wpt_extensions_enabled = wpt_extensions_enabled;
request.reply_boundary = reply_boundary;
request.top_level_navigation_dispatch = top_level_navigation_dispatch;
diff --git a/moli-renderer-v8/src/runtime/page_commands.rs b/moli-renderer-v8/src/runtime/page_commands.rs
index f51a95fbf..de7390626 100644
--- a/moli-renderer-v8/src/runtime/page_commands.rs
+++ b/moli-renderer-v8/src/runtime/page_commands.rs
@@ -1116,13 +1116,6 @@ impl PageVm {
self.set_bypass_content_security_policy(bypass);
Ok(RendererPageReply::Unit)
}
- RendererPageCommand::SetCpuThrottlingRate(rate) => {
- if !rate.is_finite() || rate > 1.0 {
- return Err(anyhow!("CPU throttling is not supported"));
- }
- self.set_cpu_throttling_rate(1.0);
- Ok(RendererPageReply::Unit)
- }
RendererPageCommand::SetEmulatedMedia(overrides) => {
self.set_emulated_media(&overrides);
Ok(RendererPageReply::Unit)
diff --git a/moli-renderer-v8/src/runtime/page_network.rs b/moli-renderer-v8/src/runtime/page_network.rs
index 6cf2b1656..1e0e156b5 100644
--- a/moli-renderer-v8/src/runtime/page_network.rs
+++ b/moli-renderer-v8/src/runtime/page_network.rs
@@ -158,10 +158,6 @@ impl PageVm {
self.vm_mut().set_bypass_content_security_policy(bypass);
}
- pub(crate) fn set_cpu_throttling_rate(&mut self, rate: f64) {
- self.cpu_throttling_rate = rate;
- }
-
pub(crate) fn set_emulated_media(
&mut self,
overrides: &crate::protocol_types::EmulatedMediaOverrides,
diff --git a/moli-renderer-v8/src/runtime/page_surface.rs b/moli-renderer-v8/src/runtime/page_surface.rs
index d9f764a71..6607c68c6 100644
--- a/moli-renderer-v8/src/runtime/page_surface.rs
+++ b/moli-renderer-v8/src/runtime/page_surface.rs
@@ -5311,7 +5311,6 @@ pub enum RendererPageCommand {
SetDocumentActivity(moli_page_types::DocumentActivity),
SetScriptExecutionDisabled(bool),
SetBypassContentSecurityPolicy(bool),
- SetCpuThrottlingRate(f64),
SetEmulatedMedia(crate::protocol_types::EmulatedMediaOverrides),
SetViewportSurface(Option<crate::protocol_types::ViewportSurface>),
SetNetworkOffline(bool),
diff --git a/moli-renderer-v8/src/runtime/page_vm/followed_navigation.rs b/moli-renderer-v8/src/runtime/page_vm/followed_navigation.rs
index 3563237d2..03f70fca4 100644
--- a/moli-renderer-v8/src/runtime/page_vm/followed_navigation.rs
+++ b/moli-renderer-v8/src/runtime/page_vm/followed_navigation.rs
@@ -1192,7 +1192,6 @@ impl PageVm {
document_last_modified: None,
script_execution_disabled: self.script_execution_disabled(),
bypass_content_security_policy: self.bypass_content_security_policy,
- cpu_throttling_rate: self.cpu_throttling_rate,
emulated_media: self.emulated_media.clone(),
idle_override: self.idle_override,
navigator_overrides: self.navigator_overrides.clone(),
diff --git a/moli-renderer-v8/src/runtime/page_vm/mod.rs b/moli-renderer-v8/src/runtime/page_vm/mod.rs
index 6bbe8104b..4de6720f2 100644
--- a/moli-renderer-v8/src/runtime/page_vm/mod.rs
+++ b/moli-renderer-v8/src/runtime/page_vm/mod.rs
@@ -1083,7 +1083,6 @@ pub(crate) struct PageVmEnvConfig {
pub(crate) document_last_modified: Option<f64>,
pub(crate) script_execution_disabled: bool,
pub(crate) bypass_content_security_policy: bool,
- pub(crate) cpu_throttling_rate: f64,
pub(crate) emulated_media: crate::protocol_types::EmulatedMediaOverrides,
pub(crate) idle_override: Option<crate::protocol_types::EmulatedIdleOverride>,
pub(crate) navigator_overrides: moli_page_types::NavigatorOverrides,
@@ -1605,7 +1604,6 @@ pub(crate) struct PageVm {
BTreeMap<DevToolsSessionKey, RendererInspectorProtocolConfiguration>,
pub(super) extra_http_headers: Vec<(String, String)>,
pub(super) bypass_content_security_policy: bool,
- pub(super) cpu_throttling_rate: f64,
pub(super) emulated_media: crate::protocol_types::EmulatedMediaOverrides,
pub(super) idle_override: Option<crate::protocol_types::EmulatedIdleOverride>,
pub(super) navigator_overrides: moli_page_types::NavigatorOverrides,
@@ -4324,7 +4322,6 @@ impl PageVm {
.collect(),
extra_http_headers: env.extra_http_headers.clone(),
bypass_content_security_policy: env.bypass_content_security_policy,
- cpu_throttling_rate: env.cpu_throttling_rate,
emulated_media: env.emulated_media.clone(),
idle_override: env.idle_override,
navigator_overrides: env.navigator_overrides.clone(),
diff --git a/moli-renderer-v8/src/runtime/page_vm/test_support.rs b/moli-renderer-v8/src/runtime/page_vm/test_support.rs
index 4288b7b05..66bc7751d 100644
--- a/moli-renderer-v8/src/runtime/page_vm/test_support.rs
+++ b/moli-renderer-v8/src/runtime/page_vm/test_support.rs
@@ -668,7 +668,6 @@ fn minimal_test_page_vm_env_config() -> PageVmEnvConfig {
document_last_modified: None,
script_execution_disabled: false,
bypass_content_security_policy: false,
- cpu_throttling_rate: 1.0,
emulated_media: crate::protocol_types::EmulatedMediaOverrides::default(),
idle_override: None,
navigator_overrides: Default::default(),
diff --git a/moli-renderer-v8/src/runtime/page_vm/tests/mod.rs b/moli-renderer-v8/src/runtime/page_vm/tests/mod.rs
index c28a83511..d7e8d2819 100644
--- a/moli-renderer-v8/src/runtime/page_vm/tests/mod.rs
+++ b/moli-renderer-v8/src/runtime/page_vm/tests/mod.rs
@@ -1807,7 +1807,6 @@ fn test_page_vm_with_loader_dom_host_hooks_and_response_referrer_policy(
document_last_modified: None,
script_execution_disabled: false,
bypass_content_security_policy: false,
- cpu_throttling_rate: 1.0,
emulated_media: crate::protocol_types::EmulatedMediaOverrides::default(),
idle_override: None,
navigator_overrides: Default::default(),
@@ -3203,7 +3202,6 @@ fn default_runtime_hooks_reject_direct_no_owner_page_vm_construction() {
document_last_modified: None,
script_execution_disabled: false,
bypass_content_security_policy: false,
- cpu_throttling_rate: 1.0,
emulated_media: crate::protocol_types::EmulatedMediaOverrides::default(),
idle_override: None,
navigator_overrides: Default::default(),
diff --git a/moli-renderer-v8/src/runtime/phase_one/mod.rs b/moli-renderer-v8/src/runtime/phase_one/mod.rs
index a162e22ba..1e56dc268 100644
--- a/moli-renderer-v8/src/runtime/phase_one/mod.rs
+++ b/moli-renderer-v8/src/runtime/phase_one/mod.rs
@@ -2544,7 +2544,6 @@ document.body.setAttribute('data-error-state', [
document_last_modified: None,
script_execution_disabled: false,
bypass_content_security_policy: false,
- cpu_throttling_rate: 1.0,
emulated_media: crate::protocol_types::EmulatedMediaOverrides::default(),
idle_override: None,
navigator_overrides: Default::default(),
@@ -6317,7 +6316,6 @@ globalThis.__outerDocumentWriteScriptContinued = true;
document_last_modified: None,
script_execution_disabled: false,
bypass_content_security_policy: false,
- cpu_throttling_rate: 1.0,
emulated_media: crate::protocol_types::EmulatedMediaOverrides::default(),
idle_override: None,
navigator_overrides: Default::default(),
@@ -14722,7 +14720,6 @@ document.body.setAttribute('data-result', [
document_last_modified: None,
script_execution_disabled: false,
bypass_content_security_policy: false,
- cpu_throttling_rate: 1.0,
emulated_media: crate::protocol_types::EmulatedMediaOverrides::default(),
idle_override: None,
navigator_overrides: Default::default(),
@@ -14903,7 +14900,6 @@ document.body.setAttribute('data-result', [
document_last_modified: None,
script_execution_disabled: false,
bypass_content_security_policy: false,
- cpu_throttling_rate: 1.0,
emulated_media: crate::protocol_types::EmulatedMediaOverrides::default(),
idle_override: None,
navigator_overrides: Default::default(),
@@ -15133,7 +15129,6 @@ document.body.setAttribute('data-result', [
document_last_modified: None,
script_execution_disabled: false,
bypass_content_security_policy: false,
- cpu_throttling_rate: 1.0,
emulated_media: crate::protocol_types::EmulatedMediaOverrides::default(),
idle_override: None,
navigator_overrides: Default::default(),
@@ -17132,7 +17127,6 @@ document.body.setAttribute("data-range", [
document_last_modified: None,
script_execution_disabled: false,
bypass_content_security_policy: false,
- cpu_throttling_rate: 1.0,
emulated_media: crate::protocol_types::EmulatedMediaOverrides::default(),
idle_override: None,
navigator_overrides: Default::default(),
@@ -17261,7 +17255,6 @@ document.body.setAttribute("data-range", [
document_last_modified: None,
script_execution_disabled: false,
bypass_content_security_policy: false,
- cpu_throttling_rate: 1.0,
emulated_media: crate::protocol_types::EmulatedMediaOverrides::default(),
idle_override: None,
navigator_overrides: Default::default(),
@@ -17400,7 +17393,6 @@ document.body.setAttribute("data-range", [
document_last_modified: None,
script_execution_disabled: false,
bypass_content_security_policy: false,
- cpu_throttling_rate: 1.0,
emulated_media: crate::protocol_types::EmulatedMediaOverrides::default(),
idle_override: None,
navigator_overrides: Default::default(),
@@ -17574,7 +17566,6 @@ document.body.setAttribute("data-range", [
document_last_modified: None,
script_execution_disabled: false,
bypass_content_security_policy: false,
- cpu_throttling_rate: 1.0,
emulated_media: crate::protocol_types::EmulatedMediaOverrides::default(),
idle_override: None,
navigator_overrides: Default::default(),
@@ -17898,7 +17889,6 @@ document.body.setAttribute("data-range", [
document_last_modified: None,
script_execution_disabled: false,
bypass_content_security_policy: false,
- cpu_throttling_rate: 1.0,
emulated_media: crate::protocol_types::EmulatedMediaOverrides::default(),
idle_override: None,
navigator_overrides: Default::default(),
@@ -18069,7 +18059,6 @@ document.body.setAttribute("data-range", [
document_last_modified: None,
script_execution_disabled: false,
bypass_content_security_policy: false,
- cpu_throttling_rate: 1.0,
emulated_media: crate::protocol_types::EmulatedMediaOverrides::default(),
idle_override: None,
navigator_overrides: Default::default(),
@@ -18158,7 +18147,6 @@ document.body.setAttribute("data-range", [
document_last_modified: None,
script_execution_disabled: false,
bypass_content_security_policy: false,
- cpu_throttling_rate: 1.0,
emulated_media: crate::protocol_types::EmulatedMediaOverrides::default(),
idle_override: None,
navigator_overrides: Default::default(),
diff --git a/moli-renderer-v8/src/runtime/phase_one/streaming.rs b/moli-renderer-v8/src/runtime/phase_one/streaming.rs
index 1cf270255..c51387820 100644
--- a/moli-renderer-v8/src/runtime/phase_one/streaming.rs
+++ b/moli-renderer-v8/src/runtime/phase_one/streaming.rs
@@ -946,7 +946,6 @@ mod tests {
document_last_modified: None,
script_execution_disabled: false,
bypass_content_security_policy: false,
- cpu_throttling_rate: 1.0,
emulated_media: crate::protocol_types::EmulatedMediaOverrides::default(),
idle_override: None,
navigator_overrides: Default::default(),
diff --git a/moli-renderer-v8/src/runtime/tests.rs b/moli-renderer-v8/src/runtime/tests.rs
index e04b2f11b..af8edc461 100644
--- a/moli-renderer-v8/src/runtime/tests.rs
+++ b/moli-renderer-v8/src/runtime/tests.rs
@@ -72,7 +72,7 @@ async fn prepare_test_external_raw_document_with_content_type_and_reply_boundary
reply_boundary: RendererReplyBoundary,
) -> PreparedRendererDocument {
runtime
- .prepare_streaming_raw_document_from_external_body_with_inspector_session_restores(
+ .prepare_streaming_raw_document_from_external_body(
runtime.reserve_page_for_creation(),
url.clone(),
url,
@@ -85,21 +85,6 @@ async fn prepare_test_external_raw_document_with_content_type_and_reply_boundary
loader,
crate::RendererWebStorageHandles::ephemeral(),
raw_body,
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
- Vec::new(),
false,
PageVmInitStage::Load,
reply_boundary,
@@ -107,8 +92,9 @@ async fn prepare_test_external_raw_document_with_content_type_and_reply_boundary
RendererNavigationReplyPolicy::FollowBeforeReply,
None,
None,
- None,
- None,
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
)
.await
.expect("external raw document should prepare")
@@ -1503,7 +1489,6 @@ async fn streaming_unstyled_xml_converts_live_document_before_domcontentloaded()
extra_http_headers: Vec::new(),
script_execution_disabled: false,
bypass_content_security_policy: false,
- cpu_throttling_rate: 1.0,
emulated_media: Default::default(),
idle_override: None,
navigator_overrides: Default::default(),
@@ -1640,7 +1625,6 @@ async fn prepared_streaming_xml_document_waits_for_permit_and_uses_latest_config
extra_http_headers: Vec::new(),
script_execution_disabled: false,
bypass_content_security_policy: false,
- cpu_throttling_rate: 1.0,
emulated_media: Default::default(),
idle_override: None,
navigator_overrides: Default::default(),
@@ -2178,32 +2162,6 @@ document.body.appendChild(frame);
.expect("child descendant-navigation page should close");
}
-#[tokio::test(flavor = "multi_thread")]
-async fn cpu_throttling_rate_rejects_unavailable_rates() {
- let runtime = JsRuntime::initialize();
- let loader = ResourceRequestClient::new(&moli_fetch::FetchConfig::default()).unwrap();
- let url = url::Url::parse("https://example.test/cpu-throttling").unwrap();
- let mut page = create_test_html_page(&runtime, &loader, url, "<!doctype html>").await;
- let error = page
- .run_async_command(RendererPageCommand::SetCpuThrottlingRate(3.0))
- .await
- .err()
- .expect("unavailable throttling must fail");
- assert!(
- error
- .to_string()
- .contains("CPU throttling is not supported")
- );
- for rate in [0.0, 1.0] {
- let (reply, _) = page
- .run_async_command(RendererPageCommand::SetCpuThrottlingRate(rate))
- .await
- .unwrap();
- assert!(matches!(reply, RendererPageReply::Unit));
- }
- page.close_async().await.unwrap();
-}
-
#[tokio::test(flavor = "current_thread")]
async fn external_raw_streaming_page_command_builds_phase_one_page() {
let runtime = JsRuntime::initialize();
@@ -2247,23 +2205,16 @@ async fn external_raw_streaming_page_command_builds_phase_one_page() {
&loader,
crate::RendererWebStorageHandles::ephemeral(),
raw_body,
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
false,
PageVmInitStage::Load,
+ crate::RendererReplyBoundary::Stage,
RendererTopLevelNavigationDispatch::FollowInStandaloneAdapter,
RendererNavigationReplyPolicy::FollowBeforeReply,
+ None,
+ None,
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
)
.await
.expect("external raw streaming page should build");
@@ -2601,7 +2552,6 @@ globalThis.__preparedCommitObserved = JSON.stringify([
extra_http_headers: Vec::new(),
script_execution_disabled: false,
bypass_content_security_policy: false,
- cpu_throttling_rate: 1.0,
emulated_media: Default::default(),
idle_override: None,
navigator_overrides: Default::default(),
@@ -2980,23 +2930,16 @@ async fn external_raw_streaming_empty_document_reaches_dom_content_loaded() {
&loader,
crate::RendererWebStorageHandles::ephemeral(),
raw_body,
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
false,
PageVmInitStage::DomContentLoaded,
+ crate::RendererReplyBoundary::Stage,
RendererTopLevelNavigationDispatch::FollowInStandaloneAdapter,
RendererNavigationReplyPolicy::FollowBeforeReply,
+ None,
+ None,
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
)
.await
.expect("empty external raw streaming page should reach DOMContentLoaded");
@@ -3292,23 +3235,16 @@ async fn external_raw_streaming_delegates_post_load_meta_refresh_to_browser() {
&loader,
crate::RendererWebStorageHandles::ephemeral(),
raw_body,
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
false,
PageVmInitStage::Load,
+ crate::RendererReplyBoundary::Stage,
RendererTopLevelNavigationDispatch::DelegateToBrowser,
RendererNavigationReplyPolicy::ReturnWithPendingNavigation,
+ None,
+ None,
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
)
.await
.expect("meta refresh streaming page should attach first document");
@@ -3379,23 +3315,16 @@ async fn external_raw_streaming_defers_dcl_handler_navigation_to_page_reply() {
&loader,
crate::RendererWebStorageHandles::ephemeral(),
raw_body,
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
false,
PageVmInitStage::DomContentLoaded,
+ crate::RendererReplyBoundary::Stage,
RendererTopLevelNavigationDispatch::DelegateToBrowser,
RendererNavigationReplyPolicy::ReturnWithPendingNavigation,
+ None,
+ None,
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
)
.await
.expect("DCL handler page should reach its reply boundary");
@@ -3464,23 +3393,16 @@ globalThis.__ordinaryAfterDcl = new Promise(resolve => {
&loader,
crate::RendererWebStorageHandles::ephemeral(),
raw_body,
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
false,
PageVmInitStage::DomContentLoaded,
+ crate::RendererReplyBoundary::Stage,
RendererTopLevelNavigationDispatch::FollowInStandaloneAdapter,
RendererNavigationReplyPolicy::FollowBeforeReply,
+ None,
+ None,
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
)
.await
.expect("page should reach its DCL reply boundary");
@@ -3543,7 +3465,7 @@ async fn renderer_owned_navigation_survives_page_creation_observer_detach() {
});
let (mut page, _, _, creation_artifacts, pending_download) = runtime
- .create_streaming_raw_page_from_external_body_with_inspector_session_restores(
+ .create_streaming_raw_page_from_external_body(
source_url.clone(),
source_url,
None,
@@ -3555,21 +3477,6 @@ async fn renderer_owned_navigation_survives_page_creation_observer_detach() {
&loader,
crate::RendererWebStorageHandles::ephemeral(),
raw_body,
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
- Vec::new(),
false,
PageVmInitStage::Load,
RendererReplyBoundary::DocumentCommit,
@@ -3577,8 +3484,9 @@ async fn renderer_owned_navigation_survives_page_creation_observer_detach() {
RendererNavigationReplyPolicy::FollowBeforeReply,
None,
None,
- None,
- None,
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
)
.await
.expect("source should attach at its document commit boundary");
@@ -3782,19 +3690,9 @@ async fn per_page_isolate_policy_uses_distinct_isolates_and_isolates_contexts()
&loader,
crate::RendererWebStorageHandles::ephemeral(),
"<!doctype html><body>first shared</body>".to_owned(),
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
)
.await
.expect("first shared-isolate page should load");
@@ -3820,19 +3718,9 @@ async fn per_page_isolate_policy_uses_distinct_isolates_and_isolates_contexts()
&loader,
crate::RendererWebStorageHandles::ephemeral(),
"<!doctype html><body>second shared</body>".to_owned(),
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
)
.await
.expect("second shared-isolate page should load");
@@ -4292,19 +4180,9 @@ async fn page_document_isolate_completes_real_v8_foreground_task() {
&loader,
crate::RendererWebStorageHandles::ephemeral(),
"<!doctype html><body>shared v8 foreground task</body>".to_owned(),
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
)
.await
.expect("shared-isolate page should load");
@@ -4352,19 +4230,9 @@ async fn per_page_isolate_policy_routes_unhandled_rejections_to_originating_page
&loader,
crate::RendererWebStorageHandles::ephemeral(),
"<!doctype html><body>first rejection listener</body>".to_owned(),
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
)
.await
.expect("first shared-isolate page should load");
@@ -4382,19 +4250,9 @@ async fn per_page_isolate_policy_routes_unhandled_rejections_to_originating_page
&loader,
crate::RendererWebStorageHandles::ephemeral(),
"<!doctype html><body>second rejection listener</body>".to_owned(),
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
)
.await
.expect("second shared-isolate page should load");
@@ -4561,19 +4419,9 @@ async fn per_page_isolate_policy_keeps_window_open_routes_page_owned() {
&loader,
crate::RendererWebStorageHandles::ephemeral(),
"<!doctype html><body>first window opener</body>".to_owned(),
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
)
.await
.expect("first shared-isolate window-open page should load");
@@ -4591,19 +4439,9 @@ async fn per_page_isolate_policy_keeps_window_open_routes_page_owned() {
&loader,
crate::RendererWebStorageHandles::ephemeral(),
"<!doctype html><body>second window opener</body>".to_owned(),
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
)
.await
.expect("second shared-isolate window-open page should load");
@@ -4720,19 +4558,9 @@ async fn per_page_isolate_policy_keeps_dedicated_worker_events_page_owned() {
&loader,
crate::RendererWebStorageHandles::ephemeral(),
"<!doctype html><body>first worker owner</body>".to_owned(),
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
)
.await
.expect("first shared-isolate worker-event page should load");
@@ -4750,19 +4578,9 @@ async fn per_page_isolate_policy_keeps_dedicated_worker_events_page_owned() {
&loader,
crate::RendererWebStorageHandles::ephemeral(),
"<!doctype html><body>second worker owner</body>".to_owned(),
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
)
.await
.expect("second shared-isolate worker-event page should load");
@@ -4997,19 +4815,10 @@ async fn per_page_isolate_policy_keeps_indexed_db_managers_page_owned() {
&loader,
crate::RendererWebStorageHandles::ephemeral(),
"<!doctype html><body>first idb</body>".to_owned(),
- Some(crate::downgrade_indexed_db_manager(&first_manager)),
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
+ crate::RendererDocumentOptions {
+ indexed_db_manager: Some(crate::downgrade_indexed_db_manager(&first_manager)),
+ ..Default::default()
+ },
)
.await
.expect("first shared-isolate indexedDB page should load");
@@ -5027,19 +4836,10 @@ async fn per_page_isolate_policy_keeps_indexed_db_managers_page_owned() {
&loader,
crate::RendererWebStorageHandles::ephemeral(),
"<!doctype html><body>second idb</body>".to_owned(),
- Some(crate::downgrade_indexed_db_manager(&second_manager)),
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
+ crate::RendererDocumentOptions {
+ indexed_db_manager: Some(crate::downgrade_indexed_db_manager(&second_manager)),
+ ..Default::default()
+ },
)
.await
.expect("second shared-isolate indexedDB page should load");
@@ -5100,28 +4900,18 @@ async fn per_page_isolate_policy_keeps_blob_urls_page_owned_after_other_page_clo
&loader,
crate::RendererWebStorageHandles::ephemeral(),
"<!doctype html><body>first blob owner</body>".to_owned(),
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
- )
- .await
- .expect("first shared-isolate page should load");
- assert!(first_download.is_none());
-
- let (mut second_page, _, _, _creation_artifacts, second_download) = runtime
- .create_html_page_from_response(
- second_url.clone(),
- second_url,
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
+ )
+ .await
+ .expect("first shared-isolate page should load");
+ assert!(first_download.is_none());
+
+ let (mut second_page, _, _, _creation_artifacts, second_download) = runtime
+ .create_html_page_from_response(
+ second_url.clone(),
+ second_url,
None,
false,
0,
@@ -5130,19 +4920,9 @@ async fn per_page_isolate_policy_keeps_blob_urls_page_owned_after_other_page_clo
&loader,
crate::RendererWebStorageHandles::ephemeral(),
"<!doctype html><body>second blob owner</body>".to_owned(),
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
)
.await
.expect("second shared-isolate page should load");
@@ -5232,19 +5012,9 @@ async fn per_page_isolate_policy_keeps_domparser_detached_docs_cleanup_neutral()
&loader,
crate::RendererWebStorageHandles::ephemeral(),
"<!doctype html><body>first detached owner</body>".to_owned(),
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
)
.await
.expect("first shared-isolate DOMParser page should load");
@@ -5262,19 +5032,9 @@ async fn per_page_isolate_policy_keeps_domparser_detached_docs_cleanup_neutral()
&loader,
crate::RendererWebStorageHandles::ephemeral(),
"<!doctype html><body>second detached peer</body>".to_owned(),
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
)
.await
.expect("second shared-isolate DOMParser page should load");
@@ -5370,19 +5130,9 @@ async fn per_page_isolate_policy_keeps_isolated_worlds_page_owned() {
&loader,
crate::RendererWebStorageHandles::ephemeral(),
"<!doctype html><body>first isolated world</body>".to_owned(),
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
)
.await
.expect("first shared-isolate page should load");
@@ -5400,19 +5150,9 @@ async fn per_page_isolate_policy_keeps_isolated_worlds_page_owned() {
&loader,
crate::RendererWebStorageHandles::ephemeral(),
"<!doctype html><body>second isolated world</body>".to_owned(),
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
)
.await
.expect("second shared-isolate page should load");
@@ -5601,19 +5341,9 @@ async fn per_page_isolate_policy_keeps_child_default_contexts_page_owned() {
crate::RendererWebStorageHandles::ephemeral(),
r#"<!doctype html><body><iframe srcdoc="<body>first child</body>"></iframe></body>"#
.to_owned(),
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
)
.await
.expect("first shared child-frame page should load");
@@ -5632,19 +5362,9 @@ async fn per_page_isolate_policy_keeps_child_default_contexts_page_owned() {
crate::RendererWebStorageHandles::ephemeral(),
r#"<!doctype html><body><iframe srcdoc="<body>second child</body>"></iframe></body>"#
.to_owned(),
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
)
.await
.expect("second shared child-frame page should load");
@@ -5806,64 +5526,38 @@ async fn per_page_isolate_policy_keeps_child_isolated_worlds_page_owned() {
let (mut first_page, _, _, _creation_artifacts, first_download) = runtime
.create_html_page_from_response(
- first_url.clone(),
- first_url,
- None,
- false,
- 0,
- 200,
- vec![("content-type".to_owned(), "text/html".to_owned())],
- &loader,
- crate::RendererWebStorageHandles::ephemeral(),
- r#"<!doctype html><body><iframe srcdoc="<body>first child isolated</body>"></iframe></body>"#
+first_url.clone(),
+first_url,
+None,
+false,
+0,
+200,
+vec![("content-type".to_owned(), "text/html".to_owned())],
+&loader,
+crate::RendererWebStorageHandles::ephemeral(),
+r#"<!doctype html><body><iframe srcdoc="<body>first child isolated</body>"></iframe></body>"#
.to_owned(),
- None,
-
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
- )
+crate::RendererDocumentOptions { ..Default::default() },
+)
.await
.expect("first shared child-isolated-world page should load");
assert!(first_download.is_none());
let (mut second_page, _, _, _creation_artifacts, second_download) = runtime
.create_html_page_from_response(
- second_url.clone(),
- second_url,
- None,
- false,
- 0,
- 200,
- vec![("content-type".to_owned(), "text/html".to_owned())],
- &loader,
- crate::RendererWebStorageHandles::ephemeral(),
- r#"<!doctype html><body><iframe srcdoc="<body>second child isolated</body>"></iframe></body>"#
+second_url.clone(),
+second_url,
+None,
+false,
+0,
+200,
+vec![("content-type".to_owned(), "text/html".to_owned())],
+&loader,
+crate::RendererWebStorageHandles::ephemeral(),
+r#"<!doctype html><body><iframe srcdoc="<body>second child isolated</body>"></iframe></body>"#
.to_owned(),
- None,
-
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
- )
+crate::RendererDocumentOptions { ..Default::default() },
+)
.await
.expect("second shared child-isolated-world page should load");
assert!(second_download.is_none());
@@ -6060,19 +5754,9 @@ async fn per_page_isolate_policy_reuses_navigation_isolate_and_replaces_contexts
&loader,
crate::RendererWebStorageHandles::ephemeral(),
"<!doctype html><body>old shared navigation document</body>".to_owned(),
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
)
.await
.expect("first shared-isolate navigation page should load");
@@ -6090,19 +5774,9 @@ async fn per_page_isolate_policy_reuses_navigation_isolate_and_replaces_contexts
&loader,
crate::RendererWebStorageHandles::ephemeral(),
"<!doctype html><body>peer shared navigation document</body>".to_owned(),
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
)
.await
.expect("peer shared-isolate page should load");
@@ -6392,19 +6066,9 @@ async fn per_page_isolate_parser_blocking_navigation_restores_replacement_inspec
&loader,
crate::RendererWebStorageHandles::ephemeral(),
"<!doctype html><body>parser-blocking navigation source</body>".to_owned(),
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
)
.await
.expect("parser-blocking navigation source page should load");
@@ -6505,19 +6169,9 @@ async fn per_page_isolate_navigation_churn_disposes_replaced_page_vms() {
&loader,
crate::RendererWebStorageHandles::ephemeral(),
"<!doctype html><body>churn-initial</body>".to_owned(),
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
)
.await
.expect("shared-isolate churn page should load");
@@ -6629,19 +6283,9 @@ async fn per_page_isolate_policy_drops_stale_timer_after_navigation_replacement(
&loader,
crate::RendererWebStorageHandles::ephemeral(),
"<!doctype html><body>stale timer source</body>".to_owned(),
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
)
.await
.expect("stale-timer source page should load");
@@ -6659,19 +6303,9 @@ async fn per_page_isolate_policy_drops_stale_timer_after_navigation_replacement(
&loader,
crate::RendererWebStorageHandles::ephemeral(),
"<!doctype html><body>stale timer peer</body>".to_owned(),
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
)
.await
.expect("stale-timer peer page should load");
@@ -6798,19 +6432,9 @@ async fn per_page_isolate_policy_drops_stale_fetch_after_navigation_replacement(
&loader,
crate::RendererWebStorageHandles::ephemeral(),
"<!doctype html><body>stale fetch source</body>".to_owned(),
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
)
.await
.expect("stale-fetch source page should load");
@@ -6828,19 +6452,9 @@ async fn per_page_isolate_policy_drops_stale_fetch_after_navigation_replacement(
&loader,
crate::RendererWebStorageHandles::ephemeral(),
"<!doctype html><body>stale fetch peer</body>".to_owned(),
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
)
.await
.expect("stale-fetch peer page should load");
@@ -6993,19 +6607,9 @@ export const marker = "late-module";"#,
&loader,
crate::RendererWebStorageHandles::ephemeral(),
"<!doctype html><body>stale module source</body>".to_owned(),
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
)
.await
.expect("stale-module source page should load");
@@ -7023,19 +6627,9 @@ export const marker = "late-module";"#,
&loader,
crate::RendererWebStorageHandles::ephemeral(),
"<!doctype html><body>stale module peer</body>".to_owned(),
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
)
.await
.expect("stale-module peer page should load");
@@ -7180,19 +6774,9 @@ async fn per_page_isolate_policy_drops_stale_worker_message_after_navigation_rep
&loader,
crate::RendererWebStorageHandles::ephemeral(),
"<!doctype html><body>stale worker message source</body>".to_owned(),
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
)
.await
.expect("stale-worker-message source page should load");
@@ -7210,19 +6794,9 @@ async fn per_page_isolate_policy_drops_stale_worker_message_after_navigation_rep
&loader,
crate::RendererWebStorageHandles::ephemeral(),
"<!doctype html><body>stale worker message peer</body>".to_owned(),
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
)
.await
.expect("stale-worker-message peer page should load");
@@ -7419,19 +6993,9 @@ async fn per_page_isolate_policy_routes_dynamic_import_to_originating_page() {
&loader,
crate::RendererWebStorageHandles::ephemeral(),
"<!doctype html><body>first dynamic import owner</body>".to_owned(),
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
)
.await
.expect("first shared-isolate page should load");
@@ -7449,19 +7013,9 @@ async fn per_page_isolate_policy_routes_dynamic_import_to_originating_page() {
&loader,
crate::RendererWebStorageHandles::ephemeral(),
"<!doctype html><body>second dynamic import owner</body>".to_owned(),
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
)
.await
.expect("second shared-isolate page should load");
@@ -7561,19 +7115,9 @@ async fn per_page_isolate_policy_keeps_shared_worker_alive_after_peer_page_close
&loader,
crate::RendererWebStorageHandles::ephemeral(),
"<!doctype html><body>first shared worker client</body>".to_owned(),
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
)
.await
.expect("first shared-isolate SharedWorker page should load");
@@ -7585,25 +7129,15 @@ async fn per_page_isolate_policy_keeps_shared_worker_alive_after_peer_page_close
second_url,
None,
false,
- 0,
- 200,
- vec![("content-type".to_owned(), "text/html".to_owned())],
- &loader,
- crate::RendererWebStorageHandles::ephemeral(),
- "<!doctype html><body>second shared worker client</body>".to_owned(),
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
+ 0,
+ 200,
+ vec![("content-type".to_owned(), "text/html".to_owned())],
+ &loader,
+ crate::RendererWebStorageHandles::ephemeral(),
+ "<!doctype html><body>second shared worker client</body>".to_owned(),
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
)
.await
.expect("second shared-isolate SharedWorker page should load");
@@ -7954,19 +7488,9 @@ async fn per_page_isolate_policy_removes_only_navigated_shared_worker_client() {
&loader,
crate::RendererWebStorageHandles::ephemeral(),
"<!doctype html><body>first shared worker navigation client</body>".to_owned(),
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
)
.await
.expect("first shared-isolate SharedWorker navigation page should load");
@@ -7984,19 +7508,9 @@ async fn per_page_isolate_policy_removes_only_navigated_shared_worker_client() {
&loader,
crate::RendererWebStorageHandles::ephemeral(),
"<!doctype html><body>second shared worker navigation client</body>".to_owned(),
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
)
.await
.expect("second shared-isolate SharedWorker navigation page should load");
@@ -8140,19 +7654,9 @@ async fn per_page_isolate_policy_rejects_cross_page_runtime_object_ids() {
&loader,
crate::RendererWebStorageHandles::ephemeral(),
"<!doctype html><body>first runtime object owner</body>".to_owned(),
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
)
.await
.expect("first shared-isolate runtime-object page should load");
@@ -8170,19 +7674,9 @@ async fn per_page_isolate_policy_rejects_cross_page_runtime_object_ids() {
&loader,
crate::RendererWebStorageHandles::ephemeral(),
"<!doctype html><body>second runtime object owner</body>".to_owned(),
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
)
.await
.expect("second shared-isolate runtime-object page should load");
@@ -8411,19 +7905,9 @@ async fn per_page_isolate_policy_scopes_same_numeric_runtime_evaluate_context_id
&loader,
crate::RendererWebStorageHandles::ephemeral(),
"<!doctype html><body>first runtime context owner</body>".to_owned(),
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
)
.await
.expect("first shared-isolate runtime-context page should load");
@@ -8441,19 +7925,9 @@ async fn per_page_isolate_policy_scopes_same_numeric_runtime_evaluate_context_id
&loader,
crate::RendererWebStorageHandles::ephemeral(),
"<!doctype html><body>second runtime context owner</body>".to_owned(),
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
)
.await
.expect("second shared-isolate runtime-context page should load");
@@ -8602,19 +8076,9 @@ async fn per_page_isolate_policy_scopes_same_numeric_runtime_evaluate_default_co
&loader,
crate::RendererWebStorageHandles::ephemeral(),
"<!doctype html><body>first default runtime context owner</body>".to_owned(),
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
)
.await
.expect("first shared-isolate default runtime-context page should load");
@@ -8632,19 +8096,9 @@ async fn per_page_isolate_policy_scopes_same_numeric_runtime_evaluate_default_co
&loader,
crate::RendererWebStorageHandles::ephemeral(),
"<!doctype html><body>second default runtime context owner</body>".to_owned(),
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
)
.await
.expect("second shared-isolate default runtime-context page should load");
@@ -8765,64 +8219,38 @@ async fn per_page_isolate_policy_scopes_same_numeric_runtime_evaluate_child_cont
let (mut first_page, _, _, _creation_artifacts, first_download) = runtime
.create_html_page_from_response(
- first_url.clone(),
- first_url,
- None,
- false,
- 0,
- 200,
- vec![("content-type".to_owned(), "text/html".to_owned())],
- &loader,
- crate::RendererWebStorageHandles::ephemeral(),
- r#"<!doctype html><body><iframe srcdoc="<body>first runtime child</body>"></iframe></body>"#
+first_url.clone(),
+first_url,
+None,
+false,
+0,
+200,
+vec![("content-type".to_owned(), "text/html".to_owned())],
+&loader,
+crate::RendererWebStorageHandles::ephemeral(),
+r#"<!doctype html><body><iframe srcdoc="<body>first runtime child</body>"></iframe></body>"#
.to_owned(),
- None,
-
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
- )
+crate::RendererDocumentOptions { ..Default::default() },
+)
.await
.expect("first shared-isolate child runtime-context page should load");
assert!(first_download.is_none());
let (mut second_page, _, _, _creation_artifacts, second_download) = runtime
.create_html_page_from_response(
- second_url.clone(),
- second_url,
- None,
- false,
- 0,
- 200,
- vec![("content-type".to_owned(), "text/html".to_owned())],
- &loader,
- crate::RendererWebStorageHandles::ephemeral(),
- r#"<!doctype html><body><iframe srcdoc="<body>second runtime child</body>"></iframe></body>"#
+second_url.clone(),
+second_url,
+None,
+false,
+0,
+200,
+vec![("content-type".to_owned(), "text/html".to_owned())],
+&loader,
+crate::RendererWebStorageHandles::ephemeral(),
+r#"<!doctype html><body><iframe srcdoc="<body>second runtime child</body>"></iframe></body>"#
.to_owned(),
- None,
-
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
- )
+crate::RendererDocumentOptions { ..Default::default() },
+)
.await
.expect("second shared-isolate child runtime-context page should load");
assert!(second_download.is_none());
@@ -9040,19 +8468,9 @@ async fn per_page_isolate_policy_keeps_release_object_group_page_local() {
&loader,
crate::RendererWebStorageHandles::ephemeral(),
"<!doctype html><body>first release group owner</body>".to_owned(),
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
)
.await
.expect("first shared-isolate release-group page should load");
@@ -9070,19 +8488,9 @@ async fn per_page_isolate_policy_keeps_release_object_group_page_local() {
&loader,
crate::RendererWebStorageHandles::ephemeral(),
"<!doctype html><body>second release group owner</body>".to_owned(),
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
)
.await
.expect("second shared-isolate release-group page should load");
@@ -9218,19 +8626,9 @@ async fn per_page_isolate_policy_replays_runtime_contexts_per_page() {
&loader,
crate::RendererWebStorageHandles::ephemeral(),
"<!doctype html><body>first runtime replay owner</body>".to_owned(),
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
)
.await
.expect("first shared-isolate runtime-replay page should load");
@@ -9248,19 +8646,9 @@ async fn per_page_isolate_policy_replays_runtime_contexts_per_page() {
&loader,
crate::RendererWebStorageHandles::ephemeral(),
"<!doctype html><body>second runtime replay owner</body>".to_owned(),
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
)
.await
.expect("second shared-isolate runtime-replay page should load");
@@ -9457,19 +8845,9 @@ async fn runtime_enable_events_for_new_inspector_session_replays_existing_isolat
&loader,
crate::RendererWebStorageHandles::ephemeral(),
"<!doctype html><body>new inspector session</body>".to_owned(),
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
)
.await
.expect("new-session runtime replay test page should load");
@@ -9502,7 +8880,7 @@ async fn runtime_enable_events_include_renderer_root_frame_id_for_default_contex
let root_frame_id = "TID-runtime-enable-root-frame";
let (mut page, _, _, _creation_artifacts, pending_download) = runtime
- .create_html_page_from_response_with_inspector_session_restores(
+ .create_html_page_from_response(
page_url.clone(),
page_url,
None,
@@ -9513,23 +8891,10 @@ async fn runtime_enable_events_include_renderer_root_frame_id_for_default_contex
&loader,
crate::RendererWebStorageHandles::ephemeral(),
"<!doctype html><body>root frame id</body>".to_owned(),
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
- Vec::new(),
- Some(root_frame_id.to_owned()),
- None,
+ crate::RendererDocumentOptions {
+ root_frame_id: Some(root_frame_id.to_owned()),
+ ..Default::default()
+ },
)
.await
.expect("root-frame test page should load");
@@ -9590,19 +8955,9 @@ async fn per_page_isolate_policy_scopes_runtime_bindings_to_page_worlds() {
&loader,
crate::RendererWebStorageHandles::ephemeral(),
"<!doctype html><body>first runtime binding owner</body>".to_owned(),
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
)
.await
.expect("first shared-isolate runtime-binding page should load");
@@ -9613,26 +8968,16 @@ async fn per_page_isolate_policy_scopes_runtime_bindings_to_page_worlds() {
second_url.clone(),
second_url,
None,
- false,
- 0,
- 200,
- vec![("content-type".to_owned(), "text/html".to_owned())],
- &loader,
- crate::RendererWebStorageHandles::ephemeral(),
- "<!doctype html><body>second runtime binding owner</body>".to_owned(),
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
+ false,
+ 0,
+ 200,
+ vec![("content-type".to_owned(), "text/html".to_owned())],
+ &loader,
+ crate::RendererWebStorageHandles::ephemeral(),
+ "<!doctype html><body>second runtime binding owner</body>".to_owned(),
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
)
.await
.expect("second shared-isolate runtime-binding page should load");
@@ -10257,19 +9602,9 @@ async fn per_page_isolate_policy_scopes_same_numeric_runtime_binding_context_id_
&loader,
crate::RendererWebStorageHandles::ephemeral(),
"<!doctype html><body>first binding context owner</body>".to_owned(),
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
)
.await
.expect("first shared-isolate binding-context page should load");
@@ -10287,19 +9622,9 @@ async fn per_page_isolate_policy_scopes_same_numeric_runtime_binding_context_id_
&loader,
crate::RendererWebStorageHandles::ephemeral(),
"<!doctype html><body>second binding context owner</body>".to_owned(),
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
)
.await
.expect("second shared-isolate binding-context page should load");
@@ -10471,19 +9796,9 @@ async fn per_page_isolate_policy_keeps_remove_binding_page_local() {
&loader,
crate::RendererWebStorageHandles::ephemeral(),
"<!doctype html><body>first remove-binding owner</body>".to_owned(),
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
)
.await
.expect("first shared-isolate remove-binding page should load");
@@ -10501,19 +9816,9 @@ async fn per_page_isolate_policy_keeps_remove_binding_page_local() {
&loader,
crate::RendererWebStorageHandles::ephemeral(),
"<!doctype html><body>second remove-binding owner</body>".to_owned(),
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
)
.await
.expect("second shared-isolate remove-binding page should load");
@@ -10644,19 +9949,9 @@ async fn per_page_isolate_policy_scopes_document_start_scripts_to_page_worlds()
&loader,
crate::RendererWebStorageHandles::ephemeral(),
"<!doctype html><body>first document-start owner</body>".to_owned(),
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
)
.await
.expect("first shared-isolate document-start page should load");
@@ -10674,19 +9969,9 @@ async fn per_page_isolate_policy_scopes_document_start_scripts_to_page_worlds()
&loader,
crate::RendererWebStorageHandles::ephemeral(),
"<!doctype html><body>second document-start owner</body>".to_owned(),
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
)
.await
.expect("second shared-isolate document-start page should load");
@@ -10788,19 +10073,9 @@ async fn per_page_isolate_policy_keeps_stored_document_start_scripts_page_local(
&loader,
crate::RendererWebStorageHandles::ephemeral(),
"<!doctype html><body>first stored preload owner</body>".to_owned(),
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
)
.await
.expect("first shared-isolate stored-preload page should load");
@@ -10818,19 +10093,9 @@ async fn per_page_isolate_policy_keeps_stored_document_start_scripts_page_local(
&loader,
crate::RendererWebStorageHandles::ephemeral(),
"<!doctype html><body>second stored preload owner</body>".to_owned(),
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
)
.await
.expect("second shared-isolate stored-preload page should load");
@@ -10963,19 +10228,9 @@ async fn stored_document_start_script_remove_uses_registry_key_namespace() {
&loader,
crate::RendererWebStorageHandles::ephemeral(),
"<!doctype html><body>stored preload key namespace</body>".to_owned(),
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
)
.await
.expect("registry-key stored-preload page should load");
@@ -11083,19 +10338,9 @@ async fn owner_loop_applies_subresource_fetch_completion_without_wait_command()
&loader,
crate::RendererWebStorageHandles::ephemeral(),
"<!doctype html><body>owner wake</body>".to_owned(),
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
)
.await
.expect("page should load");
@@ -15277,19 +14522,9 @@ async fn owner_loop_ticks_page_timer_from_active_timer_index() {
&loader,
crate::RendererWebStorageHandles::ephemeral(),
"<!doctype html><body>timer index</body>".to_owned(),
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
)
.await
.expect("page should load");
@@ -15516,19 +14751,9 @@ async fn owner_runtime_expression_await_uses_page_wake_or_timer_deadline() {
&loader,
crate::RendererWebStorageHandles::ephemeral(),
"<!doctype html><body>runtime expression await</body>".to_owned(),
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
)
.await
.expect("page should load");
@@ -16175,23 +15400,16 @@ async fn domcontentloaded_page_creation_reply_resumes_owner_to_load_without_exte
&loader,
crate::RendererWebStorageHandles::ephemeral(),
raw_body,
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
false,
PageVmInitStage::DomContentLoaded,
+ crate::RendererReplyBoundary::Stage,
RendererTopLevelNavigationDispatch::FollowInStandaloneAdapter,
RendererNavigationReplyPolicy::FollowBeforeReply,
+ None,
+ None,
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
)
.await
.expect("page should reply at DOMContentLoaded");
@@ -16249,7 +15467,7 @@ async fn document_commit_background_dcl_completion_resumes_owner_to_load() {
});
let (mut page, _, _, creation_artifacts, pending_download) = runtime
- .create_streaming_raw_page_from_external_body_with_inspector_session_restores(
+ .create_streaming_raw_page_from_external_body(
page_url.clone(),
page_url,
None,
@@ -16261,30 +15479,17 @@ async fn document_commit_background_dcl_completion_resumes_owner_to_load() {
&loader,
crate::RendererWebStorageHandles::ephemeral(),
raw_body,
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
- Vec::new(),
false,
PageVmInitStage::DomContentLoaded,
RendererReplyBoundary::DocumentCommit,
RendererTopLevelNavigationDispatch::DelegateToBrowser,
RendererNavigationReplyPolicy::ReturnWithPendingNavigation,
- Some("TID-1".to_owned()),
- None,
None,
None,
+ crate::RendererDocumentOptions {
+ root_frame_id: Some("TID-1".to_owned()),
+ ..Default::default()
+ },
)
.await
.expect("page should attach at document commit");
@@ -16574,23 +15779,16 @@ async fn owner_loop_completes_post_dcl_async_script_without_wait_command() {
&loader,
crate::RendererWebStorageHandles::ephemeral(),
raw_body,
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
false,
PageVmInitStage::DomContentLoaded,
+ crate::RendererReplyBoundary::Stage,
RendererTopLevelNavigationDispatch::FollowInStandaloneAdapter,
RendererNavigationReplyPolicy::FollowBeforeReply,
+ None,
+ None,
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
)
.await
.expect("page should reach DOMContentLoaded");
@@ -16961,23 +16159,16 @@ document.addEventListener("DOMContentLoaded", () => {
&loader,
crate::RendererWebStorageHandles::ephemeral(),
raw_body,
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
false,
PageVmInitStage::Load,
+ crate::RendererReplyBoundary::Stage,
RendererTopLevelNavigationDispatch::FollowInStandaloneAdapter,
RendererNavigationReplyPolicy::FollowBeforeReply,
+ None,
+ None,
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
);
tokio::pin!(creation);
@@ -17086,23 +16277,16 @@ blocked page
&loader,
crate::RendererWebStorageHandles::ephemeral(),
raw_body,
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
false,
PageVmInitStage::Load,
+ crate::RendererReplyBoundary::Stage,
RendererTopLevelNavigationDispatch::FollowInStandaloneAdapter,
RendererNavigationReplyPolicy::FollowBeforeReply,
+ None,
+ None,
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
);
tokio::pin!(blocked_creation);
tokio::select! {
@@ -17527,7 +16711,7 @@ fn start_test_html_page_with_optional_indexed_db_manager_and_navigation_dispatch
top_level_navigation_dispatch: RendererTopLevelNavigationDispatch,
) -> super::PendingHtmlPage {
runtime
- .start_create_html_page_from_response_with_inspector_session_restores(
+ .start_create_html_page_from_response(
runtime.reserve_page_for_creation(),
url.clone(),
url,
@@ -17539,25 +16723,12 @@ fn start_test_html_page_with_optional_indexed_db_manager_and_navigation_dispatch
loader,
crate::RendererWebStorageHandles::ephemeral(),
html.to_owned(),
- indexed_db_manager,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
- Vec::new(),
- None,
None,
top_level_navigation_dispatch,
- None,
+ crate::RendererDocumentOptions {
+ indexed_db_manager,
+ ..Default::default()
+ },
)
.expect("test HTML page should start")
}
@@ -17601,7 +16772,7 @@ async fn create_test_html_page_at_document_commit_with_navigation_dispatch(
.expect("document-commit HTML body should complete");
});
let (mut page, _, _, creation_artifacts, pending_download) = runtime
- .create_streaming_raw_page_from_external_body_with_inspector_session_restores(
+ .create_streaming_raw_page_from_external_body(
url.clone(),
url,
None,
@@ -17613,21 +16784,6 @@ async fn create_test_html_page_at_document_commit_with_navigation_dispatch(
loader,
crate::RendererWebStorageHandles::ephemeral(),
raw_body,
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
- Vec::new(),
false,
PageVmInitStage::Load,
RendererReplyBoundary::DocumentCommit,
@@ -17635,8 +16791,9 @@ async fn create_test_html_page_at_document_commit_with_navigation_dispatch(
navigation_reply_policy,
None,
None,
- None,
- None,
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
)
.await
.expect("test HTML page should attach at document commit");
diff --git a/moli-renderer-v8/src/runtime/tests/open_streaming.rs b/moli-renderer-v8/src/runtime/tests/open_streaming.rs
index ad7cb581d..b282b0041 100644
--- a/moli-renderer-v8/src/runtime/tests/open_streaming.rs
+++ b/moli-renderer-v8/src/runtime/tests/open_streaming.rs
@@ -177,7 +177,7 @@ impl OpenStreamingPage {
let (mut page, _, _, creation_artifacts, pending_download) = tokio::time::timeout(
Duration::from_secs(2),
- runtime.create_streaming_raw_page_from_external_body_with_inspector_session_restores(
+ runtime.create_streaming_raw_page_from_external_body(
page_url.clone(),
page_url,
None,
@@ -189,21 +189,6 @@ impl OpenStreamingPage {
&loader,
crate::RendererWebStorageHandles::ephemeral(),
raw_body,
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
- Vec::new(),
false,
PageVmInitStage::Load,
RendererReplyBoundary::DocumentCommit,
@@ -211,8 +196,9 @@ impl OpenStreamingPage {
RendererNavigationReplyPolicy::FollowBeforeReply,
None,
None,
- None,
- None,
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
),
)
.await
diff --git a/moli-renderer-v8/src/runtime/tests/redirect_chain.rs b/moli-renderer-v8/src/runtime/tests/redirect_chain.rs
index 692e6c45b..a23e995b5 100644
--- a/moli-renderer-v8/src/runtime/tests/redirect_chain.rs
+++ b/moli-renderer-v8/src/runtime/tests/redirect_chain.rs
@@ -55,7 +55,7 @@ async fn assert_streaming_redirect_chain(reply_boundary: RendererReplyBoundary)
// DocumentCommit forces a pending phase-one installation, even when
// the body is already buffered. No network timing or sleep is needed.
let (mut page, initial, _, artifacts, download) = runtime
- .create_streaming_raw_page_from_external_body_with_inspector_session_restores(
+ .create_streaming_raw_page_from_external_body(
requested_url.clone(),
final_url.clone(),
None,
@@ -67,21 +67,6 @@ async fn assert_streaming_redirect_chain(reply_boundary: RendererReplyBoundary)
&loader,
crate::RendererWebStorageHandles::ephemeral(),
ExternalRawDocumentBodyStream::from_bytes(body.as_bytes().to_vec()),
- None,
- None,
- Vec::new(),
- Vec::new(),
- Vec::new(),
- false,
- false,
- 1.0,
- Default::default(),
- None,
- false,
- Vec::new(),
- false,
- None,
- Vec::new(),
false,
PageVmInitStage::Load,
reply_boundary,
@@ -89,8 +74,9 @@ async fn assert_streaming_redirect_chain(reply_boundary: RendererReplyBoundary)
RendererNavigationReplyPolicy::FollowBeforeReply,
None,
None,
- None,
- None,
+ crate::RendererDocumentOptions {
+ ..Default::default()
+ },
)
.await
.expect("redirected document should attach");