Propagating the load errors from network loader

This commit is contained in:
Ravi Shankar 2016-01-01 00:01:24 +05:30 committed by Josh Matthews
parent 8d988f20c1
commit 5e6f32a59b
15 changed files with 208 additions and 152 deletions

View file

@ -10,7 +10,7 @@ use net_traits::image_cache_thread::ImageResponder;
use net_traits::image_cache_thread::{ImageCacheChan, ImageCacheCommand, ImageCacheThread, ImageState};
use net_traits::image_cache_thread::{ImageCacheResult, ImageOrMetadataAvailable, ImageResponse, UsePlaceholder};
use net_traits::{AsyncResponseTarget, ControlMsg, LoadConsumer, LoadData, ResourceThread};
use net_traits::{ResponseAction, LoadContext};
use net_traits::{ResponseAction, LoadContext, NetworkError};
use std::borrow::ToOwned;
use std::collections::HashMap;
use std::collections::hash_map::Entry::{Occupied, Vacant};
@ -44,7 +44,7 @@ struct PendingLoad {
metadata: Option<ImageMetadata>,
// Once loading is complete, the result of the operation.
result: Option<Result<(), String>>,
result: Option<Result<(), NetworkError>>,
listeners: Vec<ImageListener>,
// The url being loaded. Do not forget that this may be several Mb