(
&self,
state: WebKitDiscoveryState,
http_origin: Option<&str>,
)
| 164 | } |
| 165 | |
| 166 | fn discovery_from_state( |
| 167 | &self, |
| 168 | state: WebKitDiscoveryState, |
| 169 | http_origin: Option<&str>, |
| 170 | ) -> WebKitTargetDiscovery { |
| 171 | let origin = http_origin.unwrap_or(""); |
| 172 | let mut targets = state |
| 173 | .pages |
| 174 | .into_values() |
| 175 | .filter(|page| !is_incomplete_or_transient_page(page)) |
| 176 | .map(|page| { |
| 177 | let app = state.applications.get(&page.app_id); |
| 178 | webkit_target(&self.udid, origin, page, app) |
| 179 | }) |
| 180 | .collect::<Vec<_>>(); |
| 181 | targets.retain(is_inspectable_webkit_target); |
| 182 | targets.sort_by(|lhs, rhs| { |
| 183 | lhs.app_name |
| 184 | .cmp(&rhs.app_name) |
| 185 | .then(lhs.title.cmp(&rhs.title)) |
| 186 | .then(lhs.url.cmp(&rhs.url)) |
| 187 | .then(lhs.page_id.cmp(&rhs.page_id)) |
| 188 | }); |
| 189 | |
| 190 | WebKitTargetDiscovery { |
| 191 | udid: self.udid.clone(), |
| 192 | socket_path: state.socket_path, |
| 193 | targets, |
| 194 | warnings: state.warnings, |
| 195 | } |
| 196 | } |
| 197 | |
| 198 | async fn run(self: Arc<Self>) { |
| 199 | loop { |
no test coverage detected