Rework “visible” to “throttled” in embedder-to-constellation + jniapi (#31815)

This commit is contained in:
Delan Azabani 2024-03-22 02:48:17 +08:00 committed by GitHub
parent 49c6f9e463
commit 0b863de846
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 16 additions and 16 deletions

View file

@ -601,10 +601,10 @@ impl ServoGlue {
self.process_event(EmbedderEvent::MediaSessionAction(action))
}
pub fn change_visibility(&mut self, visible: bool) -> Result<(), &'static str> {
info!("change_visibility");
pub fn set_throttled(&mut self, throttled: bool) -> Result<(), &'static str> {
info!("set_throttled");
if let Ok(id) = self.get_browser_id() {
let event = EmbedderEvent::WebViewVisibilityChanged(id, visible);
let event = EmbedderEvent::SetWebViewThrottled(id, throttled);
self.process_event(event)
} else {
// Ignore visibility change if no browser has been created yet.

View file

@ -218,7 +218,7 @@ mod to_servo {
Self::ClearCache => target!("ClearCache"),
Self::ToggleSamplingProfiler(_, _) => target!("ToggleSamplingProfiler"),
Self::MediaSessionAction(_) => target!("MediaSessionAction"),
Self::WebViewVisibilityChanged(_, _) => target!("WebViewVisibilityChanged"),
Self::SetWebViewThrottled(_, _) => target!("SetWebViewThrottled"),
Self::IMEDismissed => target!("IMEDismissed"),
Self::InvalidateNativeSurface => target!("InvalidateNativeSurface"),
Self::ReplaceNativeSurface(_, _) => target!("ReplaceNativeSurface"),