• Home
  • Raw
  • Download

Lines Matching full:origin

15 pub fn url_origin(url: &Url) -> Origin {  in url_origin()  argument
22 Err(_) => Origin::new_opaque(), in url_origin()
25 "ftp" | "http" | "https" | "ws" | "wss" => Origin::Tuple( in url_origin()
31 "file" => Origin::new_opaque(), in url_origin()
32 _ => Origin::new_opaque(), in url_origin()
36 /// The origin of an URL
38 /// Two URLs with the same origin are considered
42 /// The origin is determined based on the scheme as follows:
44 /// - If the scheme is "blob" the origin is the origin of the
46 /// it is an opaque origin.
48 /// then the origin is a tuple of the scheme, host, and port.
49 /// - If the scheme is anything else, the origin is opaque, meaning
50 /// the URL does not have the same origin as any other URL.
52 /// For more information see <https://url.spec.whatwg.org/#origin>
54 pub enum Origin { enum
62 impl Origin { implementation
63 /// Creates a new opaque origin that is only equal to itself.
64 pub fn new_opaque() -> Origin { in new_opaque()
66 Origin::Opaque(OpaqueOrigin(COUNTER.fetch_add(1, Ordering::SeqCst))) in new_opaque()
69 /// Return whether this origin is a (scheme, host, port) tuple
70 /// (as opposed to an opaque origin).
72 matches!(*self, Origin::Tuple(..)) in is_tuple()
75 /// <https://html.spec.whatwg.org/multipage/#ascii-serialisation-of-an-origin>
78 Origin::Opaque(_) => "null".to_owned(), in ascii_serialization()
79 Origin::Tuple(ref scheme, ref host, port) => { in ascii_serialization()
89 /// <https://html.spec.whatwg.org/multipage/#unicode-serialisation-of-an-origin>
92 Origin::Opaque(_) => "null".to_owned(), in unicode_serialization()
93 Origin::Tuple(ref scheme, ref host, port) => { in unicode_serialization()