()
| 1196 | } |
| 1197 | |
| 1198 | fn new_remote_inspector_id() -> String { |
| 1199 | let counter = WEBKIT_ID_COUNTER.fetch_add(1, Ordering::Relaxed); |
| 1200 | let now = SystemTime::now() |
| 1201 | .duration_since(UNIX_EPOCH) |
| 1202 | .unwrap_or(Duration::ZERO) |
| 1203 | .as_nanos(); |
| 1204 | let pid = std::process::id() as u128; |
| 1205 | let value = now ^ (pid << 48) ^ counter as u128; |
| 1206 | let mut bytes = value.to_be_bytes(); |
| 1207 | bytes[6] = (bytes[6] & 0x0f) | 0x40; |
| 1208 | bytes[8] = (bytes[8] & 0x3f) | 0x80; |
| 1209 | let hex = hex::encode(bytes); |
| 1210 | format!( |
| 1211 | "{}-{}-{}-{}-{}", |
| 1212 | &hex[0..8], |
| 1213 | &hex[8..12], |
| 1214 | &hex[12..16], |
| 1215 | &hex[16..20], |
| 1216 | &hex[20..32] |
| 1217 | ) |
| 1218 | } |
| 1219 | |
| 1220 | fn string_value(args: &Dictionary, key: &str) -> Option<String> { |
| 1221 | args.get(key) |
no outgoing calls
no test coverage detected