servo: Merge #5568 - Remove int_uint from net (from jdm:net_uint); r=jdm

Source-Repo: https://github.com/servo/servo
Source-Revision: cad27a9d25390cda965c591f180a46061a2c19e9
This commit is contained in:
Josh Matthews 2015-04-08 01:47:56 -05:00
Родитель 54245a9426
Коммит c7a04f330e
8 изменённых файлов: 19 добавлений и 20 удалений

Просмотреть файл

@ -46,14 +46,14 @@ impl HeaderOrMethod {
pub struct CORSCacheEntry {
pub origin: Url,
pub url: Url,
pub max_age: uint,
pub max_age: u32,
pub credentials: bool,
pub header_or_method: HeaderOrMethod,
created: Timespec
}
impl CORSCacheEntry {
fn new (origin:Url, url: Url, max_age: uint, credentials: bool, header_or_method: HeaderOrMethod) -> CORSCacheEntry {
fn new (origin:Url, url: Url, max_age: u32, credentials: bool, header_or_method: HeaderOrMethod) -> CORSCacheEntry {
CORSCacheEntry {
origin: origin,
url: url,
@ -86,7 +86,7 @@ pub trait CORSCache {
/// Updates max age if an entry for a [matching header](http://fetch.spec.whatwg.org/#concept-cache-match-header) is found.
///
/// If not, it will insert an equivalent entry
fn match_header_and_update(&mut self, request: CacheRequestDetails, header_name: &str, new_max_age: uint) -> bool;
fn match_header_and_update(&mut self, request: CacheRequestDetails, header_name: &str, new_max_age: u32) -> bool;
/// Returns true if an entry with a [matching method](http://fetch.spec.whatwg.org/#concept-cache-match-method) is found
fn match_method(&mut self, request: CacheRequestDetails, method: Method) -> bool;
@ -94,7 +94,7 @@ pub trait CORSCache {
/// Updates max age if an entry for [a matching method](http://fetch.spec.whatwg.org/#concept-cache-match-method) is found.
///
/// If not, it will insert an equivalent entry
fn match_method_and_update(&mut self, request: CacheRequestDetails, method: Method, new_max_age: uint) -> bool;
fn match_method_and_update(&mut self, request: CacheRequestDetails, method: Method, new_max_age: u32) -> bool;
/// Insert an entry
fn insert(&mut self, entry: CORSCacheEntry);
}
@ -152,7 +152,7 @@ impl CORSCache for BasicCORSCache {
self.find_entry_by_header(&request, header_name).is_some()
}
fn match_header_and_update(&mut self, request: CacheRequestDetails, header_name: &str, new_max_age: uint) -> bool {
fn match_header_and_update(&mut self, request: CacheRequestDetails, header_name: &str, new_max_age: u32) -> bool {
match self.find_entry_by_header(&request, header_name).map(|e| e.max_age = new_max_age) {
Some(_) => true,
None => {
@ -167,7 +167,7 @@ impl CORSCache for BasicCORSCache {
self.find_entry_by_method(&request, method).is_some()
}
fn match_method_and_update(&mut self, request: CacheRequestDetails, method: Method, new_max_age: uint) -> bool {
fn match_method_and_update(&mut self, request: CacheRequestDetails, method: Method, new_max_age: u32) -> bool {
match self.find_entry_by_method(&request, method.clone()).map(|e| e.max_age = new_max_age) {
Some(_) => true,
None => {
@ -190,9 +190,9 @@ pub enum CORSCacheTaskMsg {
Clear(CacheRequestDetails, Sender<()>),
Cleanup(Sender<()>),
MatchHeader(CacheRequestDetails, String, Sender<bool>),
MatchHeaderUpdate(CacheRequestDetails, String, uint, Sender<bool>),
MatchHeaderUpdate(CacheRequestDetails, String, u32, Sender<bool>),
MatchMethod(CacheRequestDetails, Method, Sender<bool>),
MatchMethodUpdate(CacheRequestDetails, Method, uint, Sender<bool>),
MatchMethodUpdate(CacheRequestDetails, Method, u32, Sender<bool>),
Insert(CORSCacheEntry, Sender<()>),
ExitMsg
}
@ -222,7 +222,7 @@ impl CORSCache for CORSCacheSender {
rx.recv().unwrap_or(false)
}
fn match_header_and_update(&mut self, request: CacheRequestDetails, header_name: &str, new_max_age: uint) -> bool {
fn match_header_and_update(&mut self, request: CacheRequestDetails, header_name: &str, new_max_age: u32) -> bool {
let (tx, rx) = channel();
self.send(CORSCacheTaskMsg::MatchHeaderUpdate(request, header_name.to_string(), new_max_age, tx));
rx.recv().unwrap_or(false)
@ -234,7 +234,7 @@ impl CORSCache for CORSCacheSender {
rx.recv().unwrap_or(false)
}
fn match_method_and_update(&mut self, request: CacheRequestDetails, method: Method, new_max_age: uint) -> bool {
fn match_method_and_update(&mut self, request: CacheRequestDetails, method: Method, new_max_age: u32) -> bool {
let (tx, rx) = channel();
self.send(CORSCacheTaskMsg::MatchMethodUpdate(request, method, new_max_age, tx));
rx.recv().unwrap_or(false)

Просмотреть файл

@ -84,7 +84,7 @@ pub struct Request {
pub credentials_mode: CredentialsMode,
pub use_url_credentials: bool,
pub manual_redirect: bool,
pub redirect_count: uint,
pub redirect_count: u32,
pub response_tainting: ResponseTainting,
pub cache: Option<Box<CORSCache+'static>>
}

Просмотреть файл

@ -15,7 +15,7 @@ use std::sync::Arc;
use std::sync::mpsc::Sender;
use util::task::spawn_named;
static READ_SIZE: uint = 8192;
static READ_SIZE: usize = 8192;
enum ReadStatus {
Partial(Vec<u8>),

Просмотреть файл

@ -70,8 +70,8 @@ fn load(mut load_data: LoadData, classifier: Arc<MIMEClassifier>, cookies_chan:
// FIXME: At the time of writing this FIXME, servo didn't have any central
// location for configuration. If you're reading this and such a
// repository DOES exist, please update this constant to use it.
let max_redirects = 50u;
let mut iters = 0u;
let max_redirects = 50;
let mut iters = 0;
let start_chan = load_data.consumer;
let mut url = load_data.url.clone();
let mut redirected_to = HashSet::new();

Просмотреть файл

@ -6,7 +6,6 @@
#![feature(box_syntax)]
#![feature(collections)]
#![feature(core)]
#![feature(int_uint)]
#![feature(io)]
#![cfg_attr(test, feature(net))]
#![feature(path)]

Просмотреть файл

@ -86,17 +86,17 @@ impl StorageManager {
}
}
fn length(&self, sender: Sender<u32>, url: Url, storage_type: StorageType) {
fn length(&self, sender: Sender<usize>, url: Url, storage_type: StorageType) {
let origin = self.get_origin_as_string(url);
let data = self.select_data(storage_type);
sender.send(data.get(&origin).map_or(0u, |entry| entry.len()) as u32).unwrap();
sender.send(data.get(&origin).map_or(0, |entry| entry.len())).unwrap();
}
fn key(&self, sender: Sender<Option<DOMString>>, url: Url, storage_type: StorageType, index: u32) {
let origin = self.get_origin_as_string(url);
let data = self.select_data(storage_type);
sender.send(data.get(&origin)
.and_then(|entry| entry.keys().nth(index as uint))
.and_then(|entry| entry.keys().nth(index as usize))
.map(|key| key.clone())).unwrap();
}

Просмотреть файл

@ -16,7 +16,7 @@ pub enum StorageType {
/// Request operations on the storage data associated with a particular url
pub enum StorageTaskMsg {
/// gets the number of key/value pairs present in the associated storage data
Length(Sender<u32>, Url, StorageType),
Length(Sender<usize>, Url, StorageType),
/// gets the name of the key at the specified index in the associated storage data
Key(Sender<Option<DOMString>>, Url, StorageType, u32),

Просмотреть файл

@ -63,7 +63,7 @@ impl<'a> StorageMethods for JSRef<'a, Storage> {
let (sender, receiver) = channel();
self.get_storage_task().send(StorageTaskMsg::Length(sender, self.get_url(), self.storage_type)).unwrap();
receiver.recv().unwrap()
receiver.recv().unwrap() as u32
}
fn Key(self, index: u32) -> Option<DOMString> {