mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Upgrade rustc to 1.83 (#34793)
* Upgrade rustc to 1.83 Signed-off-by: Nico Burns <nico@nicoburns.com> * Fix crown (change copied from linked clippy function) Signed-off-by: Nico Burns <nico@nicoburns.com> * Fix named lifetime lint Signed-off-by: Nico Burns <nico@nicoburns.com> * Bump shell.nix Signed-off-by: Nico Burns <nico@nicoburns.com> * Fix non-local impl warnings Signed-off-by: Nico Burns <nico@nicoburns.com> * Format with 1.83 formatting changes Signed-off-by: Nico Burns <nico@nicoburns.com> * Fix manual non-local impl Signed-off-by: Nico Burns <nico@nicoburns.com> * More fixes for crown Signed-off-by: Nico Burns <nico@nicoburns.com> * Fix tidy Signed-off-by: Nico Burns <nico@nicoburns.com> * Fix needless_return lints Signed-off-by: Nico Burns <nico@nicoburns.com> * Fix doc comment lint Signed-off-by: Nico Burns <nico@nicoburns.com> * Fix missing wait lint Signed-off-by: Nico Burns <nico@nicoburns.com> * Allow needless_lifetimes lint Signed-off-by: Nico Burns <nico@nicoburns.com> * more doc comments Signed-off-by: Nico Burns <nico@nicoburns.com> * More needless_returns Signed-off-by: Nico Burns <nico@nicoburns.com> * is_empty lint Signed-off-by: Nico Burns <nico@nicoburns.com> * Fix needless_lifetime lints Signed-off-by: Nico Burns <nico@nicoburns.com> * fix div_ceil lint Signed-off-by: Nico Burns <nico@nicoburns.com> * Allow non-minimal bool Signed-off-by: Nico Burns <nico@nicoburns.com> * Non-local impl in constellation Signed-off-by: Nico Burns <nico@nicoburns.com> * Missing wait in constellation Signed-off-by: Nico Burns <nico@nicoburns.com> * fmt Signed-off-by: Nico Burns <nico@nicoburns.com> * remove useless lints table Signed-off-by: Nico Burns <nico@nicoburns.com> * Fixup comments Signed-off-by: Nico Burns <nico@nicoburns.com> * Allow non-local definition in sandboxing code to simplify feature flagging Signed-off-by: Nico Burns <nico@nicoburns.com> * Remove wait calls and allow zombie_processes lint Signed-off-by: Nico Burns <nico@nicoburns.com> --------- Signed-off-by: Nico Burns <nico@nicoburns.com>
This commit is contained in:
parent
d581acab3b
commit
deb819f233
35 changed files with 155 additions and 139 deletions
|
@ -98,6 +98,71 @@ struct XHRContext {
|
|||
url: ServoUrl,
|
||||
}
|
||||
|
||||
impl FetchResponseListener for XHRContext {
|
||||
fn process_request_body(&mut self, _: RequestId) {
|
||||
// todo
|
||||
}
|
||||
|
||||
fn process_request_eof(&mut self, _: RequestId) {
|
||||
// todo
|
||||
}
|
||||
|
||||
fn process_response(&mut self, _: RequestId, metadata: Result<FetchMetadata, NetworkError>) {
|
||||
let xhr = self.xhr.root();
|
||||
let rv = xhr.process_headers_available(self.gen_id, metadata, CanGc::note());
|
||||
if rv.is_err() {
|
||||
*self.sync_status.borrow_mut() = Some(rv);
|
||||
}
|
||||
}
|
||||
|
||||
fn process_response_chunk(&mut self, _: RequestId, chunk: Vec<u8>) {
|
||||
self.xhr
|
||||
.root()
|
||||
.process_data_available(self.gen_id, chunk, CanGc::note());
|
||||
}
|
||||
|
||||
fn process_response_eof(
|
||||
&mut self,
|
||||
_: RequestId,
|
||||
response: Result<ResourceFetchTiming, NetworkError>,
|
||||
) {
|
||||
let rv = self.xhr.root().process_response_complete(
|
||||
self.gen_id,
|
||||
response.map(|_| ()),
|
||||
CanGc::note(),
|
||||
);
|
||||
*self.sync_status.borrow_mut() = Some(rv);
|
||||
}
|
||||
|
||||
fn resource_timing_mut(&mut self) -> &mut ResourceFetchTiming {
|
||||
&mut self.resource_timing
|
||||
}
|
||||
|
||||
fn resource_timing(&self) -> &ResourceFetchTiming {
|
||||
&self.resource_timing
|
||||
}
|
||||
|
||||
fn submit_resource_timing(&mut self) {
|
||||
network_listener::submit_timing(self, CanGc::note())
|
||||
}
|
||||
}
|
||||
|
||||
impl ResourceTimingListener for XHRContext {
|
||||
fn resource_timing_information(&self) -> (InitiatorType, ServoUrl) {
|
||||
(InitiatorType::XMLHttpRequest, self.url.clone())
|
||||
}
|
||||
|
||||
fn resource_timing_global(&self) -> DomRoot<GlobalScope> {
|
||||
self.xhr.root().global()
|
||||
}
|
||||
}
|
||||
|
||||
impl PreInvoke for XHRContext {
|
||||
fn should_invoke(&self) -> bool {
|
||||
self.xhr.root().generation_id.get() == self.gen_id
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
pub enum XHRProgress {
|
||||
/// Notify that headers have been received
|
||||
|
@ -234,75 +299,6 @@ impl XMLHttpRequest {
|
|||
init: RequestBuilder,
|
||||
cancellation_chan: ipc::IpcReceiver<()>,
|
||||
) {
|
||||
impl FetchResponseListener for XHRContext {
|
||||
fn process_request_body(&mut self, _: RequestId) {
|
||||
// todo
|
||||
}
|
||||
|
||||
fn process_request_eof(&mut self, _: RequestId) {
|
||||
// todo
|
||||
}
|
||||
|
||||
fn process_response(
|
||||
&mut self,
|
||||
_: RequestId,
|
||||
metadata: Result<FetchMetadata, NetworkError>,
|
||||
) {
|
||||
let xhr = self.xhr.root();
|
||||
let rv = xhr.process_headers_available(self.gen_id, metadata, CanGc::note());
|
||||
if rv.is_err() {
|
||||
*self.sync_status.borrow_mut() = Some(rv);
|
||||
}
|
||||
}
|
||||
|
||||
fn process_response_chunk(&mut self, _: RequestId, chunk: Vec<u8>) {
|
||||
self.xhr
|
||||
.root()
|
||||
.process_data_available(self.gen_id, chunk, CanGc::note());
|
||||
}
|
||||
|
||||
fn process_response_eof(
|
||||
&mut self,
|
||||
_: RequestId,
|
||||
response: Result<ResourceFetchTiming, NetworkError>,
|
||||
) {
|
||||
let rv = self.xhr.root().process_response_complete(
|
||||
self.gen_id,
|
||||
response.map(|_| ()),
|
||||
CanGc::note(),
|
||||
);
|
||||
*self.sync_status.borrow_mut() = Some(rv);
|
||||
}
|
||||
|
||||
fn resource_timing_mut(&mut self) -> &mut ResourceFetchTiming {
|
||||
&mut self.resource_timing
|
||||
}
|
||||
|
||||
fn resource_timing(&self) -> &ResourceFetchTiming {
|
||||
&self.resource_timing
|
||||
}
|
||||
|
||||
fn submit_resource_timing(&mut self) {
|
||||
network_listener::submit_timing(self, CanGc::note())
|
||||
}
|
||||
}
|
||||
|
||||
impl ResourceTimingListener for XHRContext {
|
||||
fn resource_timing_information(&self) -> (InitiatorType, ServoUrl) {
|
||||
(InitiatorType::XMLHttpRequest, self.url.clone())
|
||||
}
|
||||
|
||||
fn resource_timing_global(&self) -> DomRoot<GlobalScope> {
|
||||
self.xhr.root().global()
|
||||
}
|
||||
}
|
||||
|
||||
impl PreInvoke for XHRContext {
|
||||
fn should_invoke(&self) -> bool {
|
||||
self.xhr.root().generation_id.get() == self.gen_id
|
||||
}
|
||||
}
|
||||
|
||||
global.fetch(init, context, task_source, Some(cancellation_chan));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue