зеркало из https://github.com/mozilla/gecko-dev.git
servo: Merge #8446 - Rust upgrade to rustc 1.6.0-nightly (5b4986fa5 2015-11-08) (from servo:rustup_20151110); r=SimonSapin+Ms2ger+jdm+Manishearth
<s>DO NOT r+ or try+ this</s> <s>It causes an OOM (https://github.com/rust-lang/rust/issues/29740) and can crash the OS. Probably will set our CI on fire. </s> Source-Repo: https://github.com/servo/servo Source-Revision: f13c72d68e1e7f49e241938bfd6e8a588c68e86b
This commit is contained in:
Родитель
f5c0383b1b
Коммит
693578b06a
|
@ -64,17 +64,13 @@ git = "https://github.com/servo/ipc-channel"
|
|||
git = "https://github.com/ecoal95/rust-offscreen-rendering-context"
|
||||
features = ["texture_surface"]
|
||||
|
||||
[dependencies.url]
|
||||
version = "0.2"
|
||||
features = [ "serde_serialization" ]
|
||||
|
||||
[dependencies.gaol]
|
||||
git = "https://github.com/pcwalton/gaol"
|
||||
|
||||
[dependencies]
|
||||
app_units = {version = "0.1", features = ["plugins"]}
|
||||
image = "0.4.0"
|
||||
libc = "0.1"
|
||||
image = "0.5.0"
|
||||
libc = "0.2"
|
||||
log = "0.3"
|
||||
num = "0.1.24"
|
||||
time = "0.1.17"
|
||||
|
@ -82,6 +78,7 @@ gleam = "0.1"
|
|||
euclid = {version = "0.3", features = ["plugins"]}
|
||||
serde = "0.6"
|
||||
serde_macros = "0.6"
|
||||
url = "0.5"
|
||||
|
||||
[target.x86_64-apple-darwin.dependencies]
|
||||
core-graphics = "0.1"
|
||||
|
|
|
@ -7,10 +7,6 @@ authors = ["The Servo Project Developers"]
|
|||
name = "devtools"
|
||||
path = "lib.rs"
|
||||
|
||||
[dependencies.hyper]
|
||||
version = "0.6"
|
||||
features = [ "serde-serialization" ]
|
||||
|
||||
[dependencies.devtools_traits]
|
||||
path = "../devtools_traits"
|
||||
|
||||
|
@ -26,14 +22,11 @@ path = "../plugins"
|
|||
[dependencies.ipc-channel]
|
||||
git = "https://github.com/servo/ipc-channel"
|
||||
|
||||
[dependencies.url]
|
||||
version = "0.2"
|
||||
features = [ "serde_serialization" ]
|
||||
|
||||
[dependencies]
|
||||
hyper = { version = "0.7", features = [ "serde-serialization" ] }
|
||||
log = "0.3"
|
||||
time = "0.1"
|
||||
rustc-serialize = "0.3"
|
||||
serde = "0.6"
|
||||
serde_macros = "0.6"
|
||||
|
||||
url = "0.5"
|
||||
|
|
|
@ -7,20 +7,12 @@ authors = ["The Servo Project Developers"]
|
|||
name = "devtools_traits"
|
||||
path = "lib.rs"
|
||||
|
||||
[dependencies.hyper]
|
||||
version = "0.6"
|
||||
features = [ "serde-serialization" ]
|
||||
|
||||
[dependencies.msg]
|
||||
path = "../msg"
|
||||
|
||||
[dependencies.util]
|
||||
path = "../util"
|
||||
|
||||
[dependencies.url]
|
||||
version = "0.2"
|
||||
features = [ "serde_serialization" ]
|
||||
|
||||
[dependencies.ipc-channel]
|
||||
git = "https://github.com/servo/ipc-channel"
|
||||
|
||||
|
@ -28,9 +20,11 @@ git = "https://github.com/servo/ipc-channel"
|
|||
path = "../plugins"
|
||||
|
||||
[dependencies]
|
||||
hyper = { version = "0.7", features = [ "serde-serialization" ] }
|
||||
time = "0.1"
|
||||
rustc-serialize = "0.3"
|
||||
bitflags = "0.3"
|
||||
serde = "0.6"
|
||||
serde_macros = "0.6"
|
||||
url = "0.5"
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ euclid = {version = "0.3", features = ["plugins"]}
|
|||
fnv = "1.0"
|
||||
harfbuzz-sys = "0.1"
|
||||
lazy_static = "0.1"
|
||||
libc = "0.1"
|
||||
libc = "0.2"
|
||||
log = "0.3"
|
||||
rand = "0.3"
|
||||
rustc-serialize = "0.3"
|
||||
|
@ -25,6 +25,7 @@ smallvec = "0.1"
|
|||
string_cache = "0.2"
|
||||
time = "0.1.12"
|
||||
unicode-script = { version = "0.1", features = ["harfbuzz"] }
|
||||
url = "0.5"
|
||||
|
||||
[dependencies.plugins]
|
||||
path = "../plugins"
|
||||
|
@ -67,10 +68,6 @@ path = "../script_traits"
|
|||
[dependencies.ipc-channel]
|
||||
git = "https://github.com/servo/ipc-channel"
|
||||
|
||||
[dependencies.url]
|
||||
version = "0.2"
|
||||
features = [ "serde_serialization" ]
|
||||
|
||||
[target.x86_64-apple-darwin.dependencies]
|
||||
core-foundation = "0.1"
|
||||
core-graphics = "0.1"
|
||||
|
|
|
@ -27,7 +27,6 @@ use euclid::size::Size2D;
|
|||
use filters;
|
||||
use font_context::FontContext;
|
||||
use gfx_traits::color;
|
||||
use libc::types::common::c99::uint32_t;
|
||||
use msg::compositor_msg::LayerKind;
|
||||
use net_traits::image::base::{Image, PixelFormat};
|
||||
use std::default::Default;
|
||||
|
@ -1803,7 +1802,7 @@ impl ScaledFontExtensionMethods for ScaledFont {
|
|||
let glyph_advance = glyph.advance();
|
||||
let glyph_offset = glyph.offset().unwrap_or(Point2D::zero());
|
||||
let azglyph = struct__AzGlyph {
|
||||
mIndex: glyph.id() as uint32_t,
|
||||
mIndex: glyph.id() as u32,
|
||||
mPosition: struct__AzPoint {
|
||||
x: (origin.x + glyph_offset.x).to_f32_px(),
|
||||
y: (origin.y + glyph_offset.y).to_f32_px(),
|
||||
|
@ -1819,7 +1818,7 @@ impl ScaledFontExtensionMethods for ScaledFont {
|
|||
|
||||
let mut glyphbuf = struct__AzGlyphBuffer {
|
||||
mGlyphs: azglyphs.as_mut_ptr(),
|
||||
mNumGlyphs: azglyph_buf_len as uint32_t
|
||||
mNumGlyphs: azglyph_buf_len as u32
|
||||
};
|
||||
|
||||
unsafe {
|
||||
|
|
|
@ -59,10 +59,6 @@ git = "https://github.com/tomaka/clock_ticks"
|
|||
[dependencies.ipc-channel]
|
||||
git = "https://github.com/servo/ipc-channel"
|
||||
|
||||
[dependencies.url]
|
||||
version = "0.2"
|
||||
features = [ "serde_serialization" ]
|
||||
|
||||
[dependencies]
|
||||
app_units = {version = "0.1", features = ["plugins"]}
|
||||
cssparser = { version = "0.4", features = [ "serde-serialization" ] }
|
||||
|
@ -71,7 +67,7 @@ encoding = "0.2"
|
|||
fnv = "1.0"
|
||||
bitflags = "0.3"
|
||||
rustc-serialize = "0.3"
|
||||
libc = "0.1"
|
||||
libc = "0.2"
|
||||
selectors = "0.2"
|
||||
smallvec = "0.1"
|
||||
string_cache = "0.2"
|
||||
|
@ -81,3 +77,4 @@ serde_macros = "0.6"
|
|||
serde_json = "0.5"
|
||||
unicode-bidi = "0.2"
|
||||
unicode-script = { version = "0.1", features = ["harfbuzz"] }
|
||||
url = "0.5"
|
||||
|
|
|
@ -28,12 +28,8 @@ path = "../util"
|
|||
[dependencies.ipc-channel]
|
||||
git = "https://github.com/servo/ipc-channel"
|
||||
|
||||
[dependencies.url]
|
||||
version = "0.2"
|
||||
features = [ "serde_serialization" ]
|
||||
|
||||
[dependencies]
|
||||
euclid = {version = "0.3", features = ["plugins"]}
|
||||
serde = "0.6"
|
||||
serde_macros = "0.6"
|
||||
|
||||
url = "0.5"
|
||||
|
|
|
@ -24,14 +24,6 @@ features = ["plugins"]
|
|||
git = "https://github.com/servo/rust-layers"
|
||||
features = ["plugins"]
|
||||
|
||||
[dependencies.hyper]
|
||||
version = "0.6"
|
||||
features = [ "serde-serialization" ]
|
||||
|
||||
[dependencies.url]
|
||||
version = "0.2.36"
|
||||
features = [ "serde_serialization" ]
|
||||
|
||||
[dependencies.ipc-channel]
|
||||
git = "https://github.com/servo/ipc-channel"
|
||||
|
||||
|
@ -45,10 +37,12 @@ path = "../plugins"
|
|||
[dependencies]
|
||||
app_units = {version = "0.1", features = ["plugins"]}
|
||||
bitflags = "0.3"
|
||||
hyper = { version = "0.7", features = [ "serde-serialization" ] }
|
||||
rustc-serialize = "0.3.4"
|
||||
euclid = {version = "0.3", features = ["plugins"]}
|
||||
serde = "0.6"
|
||||
serde_macros = "0.6"
|
||||
url = "0.5"
|
||||
|
||||
[target.x86_64-apple-darwin.dependencies]
|
||||
core-foundation = "0.1"
|
||||
|
|
|
@ -22,27 +22,21 @@ git = "https://github.com/ende76/brotli-rs"
|
|||
[dependencies.plugins]
|
||||
path = "../plugins"
|
||||
|
||||
[dependencies.hyper]
|
||||
version = "0.6"
|
||||
features = [ "serde-serialization" ]
|
||||
|
||||
[dependencies.msg]
|
||||
path = "../msg"
|
||||
|
||||
[dependencies.ipc-channel]
|
||||
git = "https://github.com/servo/ipc-channel"
|
||||
|
||||
[dependencies.url]
|
||||
version = "0.2"
|
||||
features = [ "serde_serialization" ]
|
||||
|
||||
[dependencies]
|
||||
hyper = { version = "0.7", features = [ "serde-serialization" ] }
|
||||
log = "0.3"
|
||||
time = "0.1.17"
|
||||
openssl="0.6.1"
|
||||
openssl = "0.7.0"
|
||||
rustc-serialize = "0.3"
|
||||
cookie = "0.1"
|
||||
cookie = "0.2"
|
||||
mime_guess = "1.1.1"
|
||||
flate2 = "0.2.0"
|
||||
uuid = "0.1.16"
|
||||
euclid = {version = "0.3", features = ["plugins"]}
|
||||
url = "0.5"
|
||||
|
|
|
@ -10,7 +10,6 @@ use mime_classifier::MIMEClassifier;
|
|||
use net_traits::ProgressMsg::Done;
|
||||
use net_traits::{LoadConsumer, LoadData, Metadata};
|
||||
use resource_task::{CancellationListener, send_error, start_sending_sniffed_opt};
|
||||
use std::fs::PathExt;
|
||||
use std::sync::Arc;
|
||||
use url::Url;
|
||||
use util::resource_files::resources_dir_path;
|
||||
|
|
|
@ -115,7 +115,7 @@ impl Cookie {
|
|||
pub fn path_match(request_path: &str, cookie_path: &str) -> bool {
|
||||
request_path == cookie_path ||
|
||||
( request_path.starts_with(cookie_path) &&
|
||||
( request_path.ends_with("/") || request_path.as_bytes()[cookie_path.len() - 1] == b'/' )
|
||||
( request_path.ends_with("/") || request_path[cookie_path.len()..].starts_with("/"))
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
@ -16,23 +16,17 @@ path = "../msg"
|
|||
[dependencies.stb_image]
|
||||
git = "https://github.com/servo/rust-stb-image"
|
||||
|
||||
[dependencies.hyper]
|
||||
version = "0.6"
|
||||
features = [ "serde-serialization" ]
|
||||
|
||||
[dependencies.ipc-channel]
|
||||
git = "https://github.com/servo/ipc-channel"
|
||||
|
||||
[dependencies.url]
|
||||
version = "0.2"
|
||||
features = [ "serde_serialization" ]
|
||||
|
||||
[dependencies.plugins]
|
||||
path = "../plugins"
|
||||
|
||||
[dependencies]
|
||||
log = "0.3"
|
||||
euclid = {version = "0.3", features = ["plugins"]}
|
||||
image = "0.4.0"
|
||||
hyper = { version = "0.7", features = [ "serde-serialization" ] }
|
||||
image = "0.5.0"
|
||||
serde = "0.6"
|
||||
serde_macros = "0.6"
|
||||
url = "0.5"
|
||||
|
|
|
@ -16,8 +16,8 @@ git = "https://github.com/Manishearth/rust-clippy"
|
|||
branch = "servo"
|
||||
optional = true
|
||||
|
||||
[dependencies.url]
|
||||
version = "0.2.36"
|
||||
[dependencies]
|
||||
url = "0.5"
|
||||
|
||||
[features]
|
||||
default = []
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
//! - `#[dom_struct]` : Implies `#[privatize]`,`#[derive(JSTraceable)]`, and `#[must_root]`.
|
||||
//! Use this for structs that correspond to a DOM type
|
||||
|
||||
#![feature(plugin_registrar, quote, plugin, box_syntax, rustc_private)]
|
||||
#![feature(plugin_registrar, quote, plugin, box_syntax, rustc_private, slice_patterns)]
|
||||
|
||||
#[macro_use]
|
||||
extern crate syntax;
|
||||
|
|
|
@ -24,13 +24,13 @@ impl LintPass for InheritancePass {
|
|||
}
|
||||
|
||||
impl LateLintPass for InheritancePass {
|
||||
fn check_struct_def(&mut self, cx: &LateContext, def: &hir::StructDef, _n: ast::Name,
|
||||
fn check_struct_def(&mut self, cx: &LateContext, def: &hir::VariantData, _n: ast::Name,
|
||||
_gen: &hir::Generics, id: ast::NodeId) {
|
||||
// Lints are run post expansion, so it's fine to use
|
||||
// #[_dom_struct_marker] here without also checking for #[dom_struct]
|
||||
if cx.tcx.has_attr(cx.tcx.map.local_def_id(id), "_dom_struct_marker") {
|
||||
// Find the reflector, if any
|
||||
let reflector_span = def.fields.iter().enumerate()
|
||||
let reflector_span = def.fields().iter().enumerate()
|
||||
.find(|&(ctr, f)| {
|
||||
if match_lang_ty(cx, &*f.node.ty, "reflector") {
|
||||
if ctr > 0 {
|
||||
|
@ -44,7 +44,7 @@ impl LateLintPass for InheritancePass {
|
|||
})
|
||||
.map(|(_, f)| f.span);
|
||||
// Find all #[dom_struct] fields
|
||||
let dom_spans: Vec<_> = def.fields.iter().enumerate().filter_map(|(ctr, f)| {
|
||||
let dom_spans: Vec<_> = def.fields().iter().enumerate().filter_map(|(ctr, f)| {
|
||||
if let hir::TyPath(..) = f.node.ty.node {
|
||||
if let Some(&def::PathResolution { base_def: def::DefTy(def_id, _), .. }) =
|
||||
cx.tcx.def_map.borrow().get(&f.node.ty.id) {
|
||||
|
|
|
@ -25,12 +25,12 @@ impl LintPass for PrivatizePass {
|
|||
impl LateLintPass for PrivatizePass {
|
||||
fn check_struct_def(&mut self,
|
||||
cx: &LateContext,
|
||||
def: &hir::StructDef,
|
||||
def: &hir::VariantData,
|
||||
_n: ast::Name,
|
||||
_gen: &hir::Generics,
|
||||
id: ast::NodeId) {
|
||||
if cx.tcx.has_attr(cx.tcx.map.local_def_id(id), "privatize") {
|
||||
for field in &def.fields {
|
||||
for field in def.fields() {
|
||||
match field.node {
|
||||
hir::StructField_ { kind: hir::NamedField(name, visibility), .. } if visibility == hir::Public => {
|
||||
cx.span_lint(PRIVATIZE, field.span,
|
||||
|
|
|
@ -80,7 +80,7 @@ impl LateLintPass for UnrootedPass {
|
|||
/// All structs containing #[must_root] types must be #[must_root] themselves
|
||||
fn check_struct_def(&mut self,
|
||||
cx: &LateContext,
|
||||
def: &hir::StructDef,
|
||||
def: &hir::VariantData,
|
||||
_n: ast::Name,
|
||||
_gen: &hir::Generics,
|
||||
id: ast::NodeId) {
|
||||
|
@ -89,7 +89,7 @@ impl LateLintPass for UnrootedPass {
|
|||
_ => cx.tcx.map.expect_item(cx.tcx.map.get_parent(id)),
|
||||
};
|
||||
if item.attrs.iter().all(|a| !a.check_name("must_root")) {
|
||||
for ref field in &def.fields {
|
||||
for ref field in def.fields() {
|
||||
if is_unrooted_ty(cx, cx.tcx.node_id_to_type(field.node.id), false) {
|
||||
cx.span_lint(UNROOTED_MUST_ROOT, field.span,
|
||||
"Type must be rooted, use #[must_root] on the struct definition to propagate")
|
||||
|
@ -101,13 +101,13 @@ impl LateLintPass for UnrootedPass {
|
|||
/// All enums containing #[must_root] types must be #[must_root] themselves
|
||||
fn check_variant(&mut self, cx: &LateContext, var: &hir::Variant, _gen: &hir::Generics) {
|
||||
let ref map = cx.tcx.map;
|
||||
if map.expect_item(map.get_parent(var.node.id)).attrs.iter().all(|a| !a.check_name("must_root")) {
|
||||
match var.node.kind {
|
||||
hir::TupleVariantKind(ref vec) => {
|
||||
if map.expect_item(map.get_parent(var.node.data.id())).attrs.iter().all(|a| !a.check_name("must_root")) {
|
||||
match var.node.data {
|
||||
hir::VariantData::Tuple(ref vec, _) => {
|
||||
for ty in vec {
|
||||
cx.tcx.ast_ty_to_ty_cache.borrow().get(&ty.id).map(|t| {
|
||||
cx.tcx.ast_ty_to_ty_cache.borrow().get(&ty.node.id).map(|t| {
|
||||
if is_unrooted_ty(cx, t, false) {
|
||||
cx.span_lint(UNROOTED_MUST_ROOT, ty.ty.span,
|
||||
cx.span_lint(UNROOTED_MUST_ROOT, ty.node.ty.span,
|
||||
"Type must be rooted, use #[must_root] on \
|
||||
the enum definition to propagate")
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ pub fn expand_reflector(cx: &mut ExtCtxt, span: Span, _: &MetaItem, annotatable:
|
|||
if let ast::ItemStruct(ref def, _) = item.node {
|
||||
let struct_name = item.ident;
|
||||
// This path has to be hardcoded, unfortunately, since we can't resolve paths at expansion time
|
||||
match def.fields.iter().find(
|
||||
match def.fields().iter().find(
|
||||
|f| match_ty_unwrap(&*f.node.ty, &["dom", "bindings", "reflector", "Reflector"]).is_some()) {
|
||||
// If it has a field that is a Reflector, use that
|
||||
Some(f) => {
|
||||
|
@ -34,7 +34,7 @@ pub fn expand_reflector(cx: &mut ExtCtxt, span: Span, _: &MetaItem, annotatable:
|
|||
},
|
||||
// Or just call it on the first field (supertype).
|
||||
None => {
|
||||
let field_name = def.fields[0].node.ident();
|
||||
let field_name = def.fields()[0].node.ident();
|
||||
let impl_item = quote_item!(cx,
|
||||
impl ::dom::bindings::reflector::Reflectable for $struct_name {
|
||||
fn reflector<'a>(&'a self) -> &'a ::dom::bindings::reflector::Reflector {
|
||||
|
|
|
@ -16,7 +16,7 @@ use url::{Url, Host, RelativeSchemeData, SchemeData};
|
|||
pub fn expand_url(cx: &mut ExtCtxt, sp: Span, tts: &[TokenTree])
|
||||
-> Box<MacResult + 'static> {
|
||||
let mut parser = parse::new_parser_from_tts(cx.parse_sess(), cx.cfg(), tts.to_vec());
|
||||
let query_expr = cx.expander().fold_expr(parser.parse_expr());
|
||||
let query_expr = cx.expander().fold_expr(parser.parse_expr_nopanic().unwrap());
|
||||
|
||||
// Ensure a str literal was passed to the macro
|
||||
let query = match parse_str_lit(&query_expr) {
|
||||
|
@ -114,17 +114,22 @@ impl<'a> ExtCtxtHelpers for ExtCtxt<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
fn expr_host(&self, sp: Span, host: Host) -> syntax::ptr::P<Expr> {
|
||||
fn expr_host(&self, _sp: Span, host: Host) -> syntax::ptr::P<Expr> {
|
||||
match host {
|
||||
Host::Domain(domain) => quote_expr!(self, ::url::Host::Domain(String::from($domain))),
|
||||
Host::Ipv6(address) => {
|
||||
let pieces_expr = self.expr_slice_u16(sp, &address.pieces);
|
||||
let [a, b, c, d, e, f, g, h] = address.segments();
|
||||
quote_expr!(self,
|
||||
::url::Host::Ipv6(
|
||||
::url::Ipv6Address {
|
||||
pieces: $pieces_expr.to_owned()
|
||||
}
|
||||
))
|
||||
::url::Host::Ipv6(::std::net::Ipv6Addr::new(
|
||||
$a, $b, $c, $d, $e, $f, $g, $h
|
||||
)))
|
||||
},
|
||||
Host::Ipv4(address) => {
|
||||
let [a, b, c, d] = address.octets();
|
||||
quote_expr!(self,
|
||||
::url::Host::Ipv4(::std::net::Ipv4Addr::new(
|
||||
$a, $b, $c, $d
|
||||
)))
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ git = "https://github.com/servo/ipc-channel"
|
|||
|
||||
[dependencies]
|
||||
log = "0.3"
|
||||
libc = "0.1"
|
||||
libc = "0.2"
|
||||
regex = "0.1.14"
|
||||
time = "0.1.12"
|
||||
|
||||
|
|
|
@ -48,10 +48,6 @@ path = "../canvas_traits"
|
|||
[dependencies.js]
|
||||
git = "https://github.com/servo/rust-mozjs"
|
||||
|
||||
[dependencies.url]
|
||||
version = "0.2.36"
|
||||
features = ["query_encoding", "serde_serialization"]
|
||||
|
||||
[dependencies.offscreen_gl_context]
|
||||
git = "https://github.com/ecoal95/rust-offscreen-rendering-context"
|
||||
|
||||
|
@ -62,10 +58,6 @@ branch = "servo"
|
|||
[dependencies.ipc-channel]
|
||||
git = "https://github.com/servo/ipc-channel"
|
||||
|
||||
[dependencies.hyper]
|
||||
version = "0.6"
|
||||
features = [ "serde-serialization" ]
|
||||
|
||||
[dependencies.xml5ever]
|
||||
git = "https://github.com/Ygg01/xml5ever"
|
||||
features = ["unstable"]
|
||||
|
@ -76,13 +68,14 @@ cssparser = { version = "0.4", features = [ "serde-serialization" ] }
|
|||
log = "0.3"
|
||||
encoding = "0.2"
|
||||
fnv = "1.0"
|
||||
hyper = { version = "0.7", features = [ "serde-serialization" ] }
|
||||
time = "0.1.12"
|
||||
bitflags = "0.3"
|
||||
rustc-serialize = "0.3"
|
||||
libc = "0.1"
|
||||
libc = "0.2"
|
||||
unicase = "1.0"
|
||||
num = "0.1.24"
|
||||
websocket = "0.12.0"
|
||||
websocket = "0.14.0"
|
||||
uuid = "0.1.16"
|
||||
smallvec = "0.1"
|
||||
html5ever = { version = "0.2.1", features = ["unstable"] }
|
||||
|
@ -93,4 +86,5 @@ tendril = "0.1.1"
|
|||
rand = "0.3"
|
||||
serde = "0.6"
|
||||
caseless = "0.1.0"
|
||||
image = "0.4.0"
|
||||
image = "0.5.0"
|
||||
url = "0.5"
|
||||
|
|
|
@ -1659,7 +1659,7 @@ impl DocumentMethods for Document {
|
|||
|
||||
if let Some(&Host::Ipv6(ipv6)) = origin.host() {
|
||||
// Omit square brackets for IPv6 addresses.
|
||||
return DOMString::from(ipv6.serialize());
|
||||
return DOMString::from(ipv6.to_string());
|
||||
}
|
||||
|
||||
DOMString::from(origin.serialize_host().unwrap_or_else(|| "".to_owned()))
|
||||
|
|
|
@ -39,7 +39,7 @@ use websocket::client::receiver::Receiver;
|
|||
use websocket::client::request::Url;
|
||||
use websocket::client::sender::Sender;
|
||||
use websocket::header::Origin;
|
||||
use websocket::message::CloseData;
|
||||
use websocket::message::Type;
|
||||
use websocket::result::WebSocketResult;
|
||||
use websocket::stream::WebSocketStream;
|
||||
use websocket::ws::receiver::Receiver as WSReceiver;
|
||||
|
@ -264,23 +264,27 @@ impl WebSocket {
|
|||
sender.send(CommonScriptMsg::RunnableMsg(WebSocketEvent, open_task)).unwrap();
|
||||
|
||||
for message in receiver.incoming_messages() {
|
||||
let message = match message {
|
||||
Ok(Message::Text(text)) => MessageData::Text(text),
|
||||
Ok(Message::Binary(data)) => MessageData::Binary(data),
|
||||
Ok(Message::Ping(data)) => {
|
||||
ws_sender.lock().unwrap().send_message(Message::Pong(data)).unwrap();
|
||||
let message: Message = match message {
|
||||
Ok(m) => m,
|
||||
Err(_) => break,
|
||||
};
|
||||
let message = match message.opcode {
|
||||
Type::Text => MessageData::Text(String::from_utf8_lossy(&message.payload).into_owned()),
|
||||
Type::Binary => MessageData::Binary(message.payload.into_owned()),
|
||||
Type::Ping => {
|
||||
let pong = Message::pong(message.payload);
|
||||
ws_sender.lock().unwrap().send_message(&pong).unwrap();
|
||||
continue;
|
||||
},
|
||||
Ok(Message::Pong(_)) => continue,
|
||||
Ok(Message::Close(data)) => {
|
||||
ws_sender.lock().unwrap().send_message(Message::Close(data)).unwrap();
|
||||
Type::Pong => continue,
|
||||
Type::Close => {
|
||||
ws_sender.lock().unwrap().send_message(&message).unwrap();
|
||||
let task = box CloseTask {
|
||||
addr: address,
|
||||
};
|
||||
sender.send(CommonScriptMsg::RunnableMsg(WebSocketEvent, task)).unwrap();
|
||||
break;
|
||||
},
|
||||
Err(_) => break,
|
||||
};
|
||||
let message_task = box MessageReceivedTask {
|
||||
address: address.clone(),
|
||||
|
@ -385,7 +389,7 @@ impl WebSocketMethods for WebSocket {
|
|||
if send_data {
|
||||
let mut other_sender = self.sender.borrow_mut();
|
||||
let my_sender = other_sender.as_mut().unwrap();
|
||||
let _ = my_sender.lock().unwrap().send_message(Message::Text(data.0));
|
||||
let _ = my_sender.lock().unwrap().send_message(&Message::text(data.0));
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
@ -404,7 +408,7 @@ impl WebSocketMethods for WebSocket {
|
|||
if send_data {
|
||||
let mut other_sender = self.sender.borrow_mut();
|
||||
let my_sender = other_sender.as_mut().unwrap();
|
||||
let _ = my_sender.lock().unwrap().send_message(Message::Binary(data.clone_bytes()));
|
||||
let _ = my_sender.lock().unwrap().send_message(&Message::binary(data.clone_bytes()));
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
@ -420,7 +424,7 @@ impl WebSocketMethods for WebSocket {
|
|||
if let Some(sender) = sender.as_mut() {
|
||||
let code: u16 = this.code.get();
|
||||
let reason = this.reason.borrow().clone();
|
||||
let _ = sender.lock().unwrap().send_message(Message::Close(Some(CloseData::new(code, reason))));
|
||||
let _ = sender.lock().unwrap().send_message(&Message::close_because(code, reason));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -28,14 +28,11 @@ path = "../devtools_traits"
|
|||
[dependencies.ipc-channel]
|
||||
git = "https://github.com/servo/ipc-channel"
|
||||
|
||||
[dependencies.url]
|
||||
version = "0.2"
|
||||
features = [ "serde_serialization" ]
|
||||
|
||||
[dependencies]
|
||||
app_units = {version = "0.1", features = ["plugins"]}
|
||||
libc = "0.1"
|
||||
libc = "0.2"
|
||||
euclid = {version = "0.3", features = ["plugins"]}
|
||||
serde = "0.6"
|
||||
serde_macros = "0.6"
|
||||
time = "0.1.12"
|
||||
url = "0.5"
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -18,7 +18,7 @@ doc = false
|
|||
bench = false
|
||||
|
||||
[dev-dependencies]
|
||||
image = "0.4.0"
|
||||
image = "0.5.0"
|
||||
|
||||
[dev-dependencies.gfx_tests]
|
||||
path = "../../tests/unit/gfx"
|
||||
|
@ -124,10 +124,6 @@ optional = true
|
|||
version = "0.3"
|
||||
features = ["release_max_level_info"]
|
||||
|
||||
[dependencies.url]
|
||||
version = "0.2"
|
||||
features = [ "serde_serialization" ]
|
||||
|
||||
[dependencies.euclid]
|
||||
version = "0.3"
|
||||
features = ["plugins"]
|
||||
|
@ -152,4 +148,6 @@ git = "https://github.com/ecoal95/rust-offscreen-rendering-context"
|
|||
env_logger = "0.3"
|
||||
time = "0.1.12"
|
||||
bitflags = "0.3"
|
||||
libc = "0.1"
|
||||
libc = "0.2"
|
||||
url = {version = "0.5", features = ["serde_serialization", "query_encoding"]}
|
||||
|
||||
|
|
|
@ -229,7 +229,7 @@ mod android {
|
|||
use std::borrow::ToOwned;
|
||||
|
||||
pub fn setup_logging() {
|
||||
use self::libc::consts::os::posix88::{STDERR_FILENO, STDOUT_FILENO};
|
||||
use self::libc::{STDERR_FILENO, STDOUT_FILENO};
|
||||
//use std::env;
|
||||
|
||||
//env::set_var("RUST_LOG", "servo,gfx,msg,util,layers,js,std,rt,extra");
|
||||
|
@ -239,14 +239,14 @@ mod android {
|
|||
unsafe { super::app_dummy(); }
|
||||
}
|
||||
|
||||
struct FilePtr(*mut self::libc::types::common::c95::FILE);
|
||||
struct FilePtr(*mut self::libc::FILE);
|
||||
|
||||
unsafe impl Send for FilePtr {}
|
||||
|
||||
fn redirect_output(file_no: c_int) {
|
||||
use self::libc::funcs::c95::stdio::fgets;
|
||||
use self::libc::funcs::posix88::stdio::fdopen;
|
||||
use self::libc::funcs::posix88::unistd::{pipe, dup2};
|
||||
use self::libc::fdopen;
|
||||
use self::libc::fgets;
|
||||
use self::libc::{pipe, dup2};
|
||||
use servo::util::task::spawn_named;
|
||||
use std::ffi::CStr;
|
||||
use std::ffi::CString;
|
||||
|
|
|
@ -18,10 +18,6 @@ path = "../util"
|
|||
[dependencies.style_traits]
|
||||
path = "../style_traits"
|
||||
|
||||
[dependencies.url]
|
||||
version = "0.2"
|
||||
features = [ "serde_serialization" ]
|
||||
|
||||
[dependencies]
|
||||
app_units = {version = "0.1", features = ["plugins"]}
|
||||
cssparser = { version = "0.4", features = [ "serde-serialization" ] }
|
||||
|
@ -39,3 +35,5 @@ string_cache = "0.2"
|
|||
euclid = {version = "0.3", features = ["plugins"]}
|
||||
serde = "0.6"
|
||||
serde_macros = "0.6"
|
||||
url = "0.5"
|
||||
|
||||
|
|
|
@ -13,10 +13,6 @@ path = "../util"
|
|||
[dependencies.plugins]
|
||||
path = "../plugins"
|
||||
|
||||
[dependencies.url]
|
||||
version = "0.2"
|
||||
features = [ "serde_serialization" ]
|
||||
|
||||
[dependencies]
|
||||
cssparser = { version = "0.4", features = [ "serde-serialization" ] }
|
||||
euclid = {version = "0.3", features = ["plugins"]}
|
||||
|
@ -27,3 +23,5 @@ rustc-serialize = "0.3"
|
|||
selectors = "0.2"
|
||||
serde = "0.6"
|
||||
serde_macros = "0.6"
|
||||
url = "0.5"
|
||||
|
||||
|
|
|
@ -32,17 +32,13 @@ features = ["plugins"]
|
|||
[dependencies.ipc-channel]
|
||||
git = "https://github.com/servo/ipc-channel"
|
||||
|
||||
[dependencies.url]
|
||||
version = "0.2"
|
||||
features = [ "serde_serialization" ]
|
||||
|
||||
[dependencies]
|
||||
app_units = {version = "0.1", features = ["plugins"]}
|
||||
cssparser = { version = "0.4", features = [ "serde-serialization" ] }
|
||||
log = "0.3"
|
||||
bitflags = "0.3"
|
||||
html5ever = { version = "0.2.1", features = ["unstable"] }
|
||||
libc = "0.1"
|
||||
libc = "0.2"
|
||||
rand = "0.3"
|
||||
rustc-serialize = "0.3"
|
||||
smallvec = "0.1"
|
||||
|
@ -55,5 +51,6 @@ serde_macros = "0.6"
|
|||
string_cache = "0.2"
|
||||
lazy_static = "0.1"
|
||||
getopts = "0.2.11"
|
||||
hyper = "0.6"
|
||||
hyper = "0.7"
|
||||
url = "0.5"
|
||||
uuid = "0.1.17"
|
||||
|
|
|
@ -12,10 +12,8 @@
|
|||
#![feature(heap_api)]
|
||||
#![feature(oom)]
|
||||
#![feature(optin_builtin_traits)]
|
||||
#![cfg_attr(not(target_os = "android"), feature(path_ext))]
|
||||
#![feature(plugin)]
|
||||
#![feature(reflect_marker)]
|
||||
#![feature(slice_splits)]
|
||||
#![feature(step_by)]
|
||||
#![feature(step_trait)]
|
||||
#![feature(zero_one)]
|
||||
|
|
|
@ -157,7 +157,8 @@ impl HeapSizeOf for url::Host {
|
|||
fn heap_size_of_children(&self) -> usize {
|
||||
match *self {
|
||||
url::Host::Domain(ref str) => str.heap_size_of_children(),
|
||||
url::Host::Ipv6(_) => 0
|
||||
url::Host::Ipv6(_) => 0,
|
||||
url::Host::Ipv4(_) => 0,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,7 +26,6 @@ pub fn resources_dir_path() -> PathBuf {
|
|||
#[cfg(not(target_os = "android"))]
|
||||
pub fn resources_dir_path() -> PathBuf {
|
||||
use std::env;
|
||||
use std::fs::PathExt;
|
||||
|
||||
match *CMD_RESOURCE_DIR.lock().unwrap() {
|
||||
Some(ref path) => PathBuf::from(path),
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
//! higher-level API on top of this could allow safe fork-join parallelism.
|
||||
|
||||
use deque::{Abort, BufferPool, Data, Empty, Stealer, Worker};
|
||||
use libc::funcs::posix88::unistd::usleep;
|
||||
use libc::usleep;
|
||||
use rand::{Rng, XorShiftRng, weak_rng};
|
||||
use std::sync::atomic::{AtomicUsize, Ordering};
|
||||
use std::sync::mpsc::{Receiver, Sender, channel};
|
||||
|
|
|
@ -22,14 +22,11 @@ git = "https://github.com/jgraham/webdriver-rust.git"
|
|||
[dependencies.ipc-channel]
|
||||
git = "https://github.com/servo/ipc-channel"
|
||||
|
||||
[dependencies.url]
|
||||
version = "0.2"
|
||||
features = [ "serde_serialization" ]
|
||||
|
||||
[dependencies]
|
||||
image = "0.4.0"
|
||||
image = "0.5.0"
|
||||
log = "0.3"
|
||||
hyper = "0.6"
|
||||
hyper = "0.7"
|
||||
rustc-serialize = "0.3.4"
|
||||
regex = "0.1.33"
|
||||
url = "0.5"
|
||||
uuid = "0.1"
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -11,7 +11,7 @@ crate-type = ["dylib"]
|
|||
[dependencies]
|
||||
log = "*"
|
||||
url = "*"
|
||||
libc = "*"
|
||||
libc = "0.2"
|
||||
euclid = {version = "0.3", features = ["plugins"]}
|
||||
gleam = "0.1"
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ pub fn slice_to_str<F>(s: *const u8, l: usize, f: F) -> c_int where F: FnOnce(&s
|
|||
/// All fields are initialized to zero. It is the caller's responsibility to ensure that the given
|
||||
/// type is a CEF type with `cef_base_t` as its first member.
|
||||
pub unsafe fn create_cef_object<Base,Extra>(size: size_t) -> *mut Base {
|
||||
let object = libc::calloc(1, (mem::size_of::<Base>() + mem::size_of::<Extra>()) as u64) as
|
||||
let object = libc::calloc(1, (mem::size_of::<Base>() + mem::size_of::<Extra>())) as
|
||||
*mut cef_base_t;
|
||||
(*object).size = size;
|
||||
(*object).add_ref = Some(servo_add_ref as extern "C" fn(*mut cef_base_t) -> c_int);
|
||||
|
|
|
@ -4,8 +4,7 @@
|
|||
|
||||
|
||||
use eutil::slice_to_str;
|
||||
use libc::types::os::arch::c95::wchar_t;
|
||||
use libc::{self, size_t, c_int, c_ushort, c_void};
|
||||
use libc::{self, size_t, c_int, c_ushort, c_void, wchar_t};
|
||||
use std::char;
|
||||
use std::cmp::Ordering;
|
||||
use std::mem;
|
||||
|
@ -79,7 +78,7 @@ pub extern "C" fn cef_string_utf8_clear(cs: *mut cef_string_utf8_t) {
|
|||
#[no_mangle]
|
||||
pub extern "C" fn cef_string_userfree_utf8_alloc() -> *mut cef_string_utf8_t {
|
||||
unsafe {
|
||||
libc::calloc(1, mem::size_of::<cef_string_utf8_t>() as u64) as *mut cef_string_utf8_t
|
||||
libc::calloc(1, mem::size_of::<cef_string_utf8_t>()) as *mut cef_string_utf8_t
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -159,7 +158,7 @@ pub extern "C" fn cef_string_utf16_clear(cs: *mut cef_string_utf16_t) {
|
|||
#[no_mangle]
|
||||
pub extern "C" fn cef_string_userfree_utf16_alloc() -> *mut cef_string_utf16_t {
|
||||
unsafe {
|
||||
libc::calloc(1, mem::size_of::<cef_string_utf16_t>() as u64) as *mut cef_string_utf16_t
|
||||
libc::calloc(1, mem::size_of::<cef_string_utf16_t>()) as *mut cef_string_utf16_t
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -169,7 +168,7 @@ pub extern "C" fn cef_string_utf16_set(src: *const c_ushort, src_len: size_t, ou
|
|||
unsafe {
|
||||
if copy != 0 {
|
||||
if !src.is_null() && src_len > 0 {
|
||||
(*output).str = libc::calloc(1, (src_len + 1) * mem::size_of::<c_ushort>() as u64) as
|
||||
(*output).str = libc::calloc(1, (src_len + 1) * mem::size_of::<c_ushort>()) as
|
||||
*mut u16;
|
||||
if (*output).str.is_null() {
|
||||
return 0;
|
||||
|
@ -217,7 +216,7 @@ pub extern "C" fn cef_string_wide_clear(cs: *mut cef_string_wide_t) {
|
|||
#[no_mangle]
|
||||
pub extern "C" fn cef_string_userfree_wide_alloc() -> *mut cef_string_wide_t {
|
||||
unsafe {
|
||||
libc::calloc(1, mem::size_of::<cef_string_wide_t>() as u64) as *mut cef_string_wide_t
|
||||
libc::calloc(1, mem::size_of::<cef_string_wide_t>()) as *mut cef_string_wide_t
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -227,7 +226,7 @@ pub extern "C" fn cef_string_wide_set(src: *const wchar_t, src_len: size_t, outp
|
|||
unsafe {
|
||||
if copy != 0 {
|
||||
if !src.is_null() && src_len > 0 {
|
||||
(*output).str = libc::calloc(1, (src_len + 1) * mem::size_of::<wchar_t>() as u64) as
|
||||
(*output).str = libc::calloc(1, (src_len + 1) * mem::size_of::<wchar_t>()) as
|
||||
*mut wchar_t;
|
||||
if (*output).str.is_null() {
|
||||
return 0;
|
||||
|
|
|
@ -39,7 +39,7 @@ pub extern "C" fn cef_string_list_value(lt: *mut cef_string_list_t, index: c_int
|
|||
if index as usize > (*lt).len() - 1 { return 0; }
|
||||
let ref string = (*lt)[index as usize];
|
||||
let utf16_chars: Vec<u16> = Utf16Encoder::new(string.chars()).collect();
|
||||
cef_string_utf16_set(utf16_chars.as_ptr(), utf16_chars.len() as u64, value, 1)
|
||||
cef_string_utf16_set(utf16_chars.as_ptr(), utf16_chars.len(), value, 1)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ pub extern "C" fn cef_string_map_key(sm: *mut cef_string_map_t, index: c_int, va
|
|||
match (*sm).keys().nth(index as usize) {
|
||||
Some(k) => {
|
||||
cef_string_utf16_set(k.as_bytes().as_ptr() as *const u16,
|
||||
k.len() as u64,
|
||||
k.len(),
|
||||
value,
|
||||
1)
|
||||
},
|
||||
|
|
|
@ -85,7 +85,7 @@ pub extern "C" fn cef_string_multimap_key(smm: *mut cef_string_multimap_t, index
|
|||
for (key, val) in &(*smm) {
|
||||
if rem < (*val).len() {
|
||||
return cef_string_utf16_set((*key).as_bytes().as_ptr() as *const u16,
|
||||
(*key).len() as u64,
|
||||
(*key).len(),
|
||||
value,
|
||||
1);
|
||||
} else {
|
||||
|
|
|
@ -2,12 +2,11 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use libc::{c_uint, c_ushort, c_int, c_double, size_t};
|
||||
use libc::{c_uint, c_ushort, c_int, c_double, size_t, wchar_t};
|
||||
#[cfg(target_os="linux")]
|
||||
use libc::c_ulong;
|
||||
#[cfg(target_os="macos")]
|
||||
use libc::c_void;
|
||||
use libc::types::os::arch::c95::wchar_t;
|
||||
|
||||
use net_traits::net_error_list::NetError;
|
||||
|
||||
|
|
|
@ -121,6 +121,7 @@ cef_pointer_wrapper!(i32);
|
|||
cef_pointer_wrapper!(i64);
|
||||
cef_pointer_wrapper!(u32);
|
||||
cef_pointer_wrapper!(u64);
|
||||
cef_pointer_wrapper!(usize);
|
||||
|
||||
cef_noop_wrapper!(());
|
||||
cef_noop_wrapper!(*const cef_geolocation_handler_t);
|
||||
|
@ -187,6 +188,7 @@ cef_noop_wrapper!(f64);
|
|||
cef_noop_wrapper!(i64);
|
||||
cef_noop_wrapper!(u32);
|
||||
cef_noop_wrapper!(u64);
|
||||
cef_noop_wrapper!(usize);
|
||||
cef_noop_wrapper!(cef_string_list_t);
|
||||
|
||||
cef_unimplemented_wrapper!(*const *mut cef_v8value_t, *const CefV8Value);
|
||||
|
@ -198,7 +200,7 @@ cef_unimplemented_wrapper!(cef_string_t, String);
|
|||
impl<'a> CefWrap<*const cef_string_t> for &'a [u16] {
|
||||
fn to_c(buffer: &'a [u16]) -> *const cef_string_t {
|
||||
unsafe {
|
||||
let ptr = libc::malloc(((buffer.len() + 1) * 2) as u64) as *mut c_ushort;
|
||||
let ptr = libc::malloc(((buffer.len() + 1) * 2)) as *mut c_ushort;
|
||||
ptr::copy(buffer.as_ptr(), ptr, buffer.len());
|
||||
*ptr.offset(buffer.len() as isize) = 0;
|
||||
|
||||
|
@ -206,7 +208,7 @@ impl<'a> CefWrap<*const cef_string_t> for &'a [u16] {
|
|||
// stack space to create the object in. What a botch.
|
||||
Box::into_raw(box cef_string_utf16 {
|
||||
str: ptr,
|
||||
length: buffer.len() as u64,
|
||||
length: buffer.len(),
|
||||
dtor: Some(free_boxed_utf16_string as extern "C" fn(*mut c_ushort)),
|
||||
}) as *const _
|
||||
}
|
||||
|
@ -267,7 +269,7 @@ impl<'a> CefWrap<cef_string_userfree_t> for String {
|
|||
boxed_string = libc::malloc(mem::size_of::<cef_string_utf16>() as libc::size_t) as
|
||||
*mut cef_string_utf16;
|
||||
ptr::write(&mut (*boxed_string).str, buffer);
|
||||
ptr::write(&mut (*boxed_string).length, utf16_chars.len() as u64);
|
||||
ptr::write(&mut (*boxed_string).length, utf16_chars.len());
|
||||
ptr::write(&mut (*boxed_string).dtor, Some(free_utf16_buffer as extern "C" fn(*mut c_ushort)));
|
||||
}
|
||||
boxed_string
|
||||
|
|
|
@ -14,8 +14,8 @@ headless = ["glutin/headless"]
|
|||
[dependencies]
|
||||
time = "0.1.12"
|
||||
bitflags = "0.3"
|
||||
libc = "0.1"
|
||||
url = "0.2"
|
||||
libc = "0.2"
|
||||
url = "0.5"
|
||||
gleam = "0.1"
|
||||
euclid = {version = "0.3", features = ["plugins"]}
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@ use glutin;
|
|||
use glutin::{Api, ElementState, Event, GlRequest, MouseButton, VirtualKeyCode, MouseScrollDelta};
|
||||
use layers::geometry::DevicePixel;
|
||||
use layers::platform::surface::NativeDisplay;
|
||||
use libc::c_void;
|
||||
#[cfg(feature = "window")]
|
||||
use msg::constellation_msg::{KeyState, NONE, CONTROL, SHIFT, ALT, SUPER};
|
||||
use msg::constellation_msg::{self, Key};
|
||||
|
@ -149,7 +150,7 @@ impl Window {
|
|||
|
||||
#[cfg(not(target_os = "android"))]
|
||||
fn load_gl_functions(window: &glutin::Window) {
|
||||
gl::load_with(|s| window.get_proc_address(s));
|
||||
gl::load_with(|s| window.get_proc_address(s) as *const c_void);
|
||||
}
|
||||
|
||||
#[cfg(target_os = "android")]
|
||||
|
@ -728,7 +729,7 @@ impl Window {
|
|||
let headless_context = headless_builder.build().unwrap();
|
||||
unsafe { headless_context.make_current().expect("Failed to make context current!") };
|
||||
|
||||
gl::load_with(|s| headless_context.get_proc_address(s));
|
||||
gl::load_with(|s| headless_context.get_proc_address(s) as *const c_void);
|
||||
|
||||
let window = Window {
|
||||
context: headless_context,
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -48,9 +48,9 @@ git = "https://github.com/servo/rust-egl"
|
|||
|
||||
[dependencies]
|
||||
env_logger = "0.3"
|
||||
url = "0.2.16"
|
||||
url = "0.5"
|
||||
time = "0.1.17"
|
||||
errno = "0.1"
|
||||
libc = "0.1"
|
||||
libc = "0.2"
|
||||
euclid = {version = "0.3", features = ["plugins"]}
|
||||
gleam = "0.1"
|
||||
|
|
|
@ -117,7 +117,7 @@ class MachCommands(CommandBase):
|
|||
help='Force download even if a snapshot already exists')
|
||||
def bootstrap_rustc(self, force=False):
|
||||
rust_dir = path.join(
|
||||
self.context.sharedir, "rust", *self.rust_snapshot_path().split("/"))
|
||||
self.context.sharedir, "rust", self.rust_snapshot_path())
|
||||
if not force and path.exists(path.join(rust_dir, "rustc", "bin", "rustc")):
|
||||
print("Snapshot Rust compiler already downloaded.", end=" ")
|
||||
print("Use |bootstrap-rust --force| to download again.")
|
||||
|
@ -127,16 +127,43 @@ class MachCommands(CommandBase):
|
|||
shutil.rmtree(rust_dir)
|
||||
os.makedirs(rust_dir)
|
||||
|
||||
snapshot_url = ("https://servo-rust.s3.amazonaws.com/%s.tar.gz"
|
||||
date = self.rust_snapshot_path().split("/")[0]
|
||||
install_dir = path.join(self.context.sharedir, "rust", date)
|
||||
|
||||
# The Rust compiler is hosted on the nightly server under the date with a name
|
||||
# rustc-nightly-HOST-TRIPLE.tar.gz. We just need to pull down and extract it,
|
||||
# giving a directory name that will be the same as the tarball name (rustc is
|
||||
# in that directory).
|
||||
snapshot_url = ("https://static-rust-lang-org.s3.amazonaws.com/dist/%s.tar.gz"
|
||||
% self.rust_snapshot_path())
|
||||
tgz_file = rust_dir + '.tar.gz'
|
||||
tgz_file = rust_dir + '-rustc.tar.gz'
|
||||
|
||||
download_file("Rust snapshot", snapshot_url, tgz_file)
|
||||
download_file("Rust compiler", snapshot_url, tgz_file)
|
||||
|
||||
print("Extracting Rust compiler...")
|
||||
extract(tgz_file, install_dir)
|
||||
|
||||
# Each Rust stdlib has a name of the form `rust-std-nightly-TRIPLE.tar.gz`, with
|
||||
# a directory of the name `rust-std-TRIPLE` inside and then a `lib` directory.
|
||||
# This `lib` directory needs to be extracted and merged with the `rustc/lib`
|
||||
# directory from the host compiler above.
|
||||
# TODO: make it possible to request an additional cross-target to add to this
|
||||
# list.
|
||||
stdlibs = [host_triple(), "arm-linux-androideabi"]
|
||||
for target in stdlibs:
|
||||
snapshot_url = ("https://static-rust-lang-org.s3.amazonaws.com/dist/%s/rust-std-nightly-%s.tar.gz"
|
||||
% (date, target))
|
||||
tgz_file = install_dir + ('rust-std-nightly-%s.tar.gz' % target)
|
||||
|
||||
download_file("Host rust library for target %s" % target, snapshot_url, tgz_file)
|
||||
print("Extracting Rust stdlib for target %s..." % target)
|
||||
extract(tgz_file, install_dir)
|
||||
shutil.copytree(path.join(install_dir, "rust-std-nightly-%s" % target,
|
||||
"rust-std-%s" % target, "lib", "rustlib", target),
|
||||
path.join(install_dir, "rustc-nightly-%s" % host_triple(),
|
||||
"rustc", "lib", "rustlib", target))
|
||||
shutil.rmtree(path.join(install_dir, "rust-std-nightly-%s" % target))
|
||||
|
||||
print("Extracting Rust snapshot...")
|
||||
snap_dir = path.join(rust_dir,
|
||||
path.basename(tgz_file).replace(".tar.gz", ""))
|
||||
extract(tgz_file, rust_dir, movedir=snap_dir)
|
||||
print("Snapshot Rust ready.")
|
||||
|
||||
@Command('bootstrap-rust-docs',
|
||||
|
@ -149,7 +176,7 @@ class MachCommands(CommandBase):
|
|||
self.ensure_bootstrapped()
|
||||
hash_dir = path.join(self.context.sharedir, "rust",
|
||||
self.rust_snapshot_path().split("/")[0])
|
||||
docs_dir = path.join(hash_dir, self.rust_snapshot_path().split("/")[1], "doc")
|
||||
docs_dir = path.join(hash_dir, "doc")
|
||||
if not force and path.exists(docs_dir):
|
||||
print("Snapshot Rust docs already downloaded.", end=" ")
|
||||
print("Use |bootstrap-rust-docs --force| to download again.")
|
||||
|
@ -158,8 +185,8 @@ class MachCommands(CommandBase):
|
|||
if path.isdir(docs_dir):
|
||||
shutil.rmtree(docs_dir)
|
||||
docs_name = self.rust_snapshot_path().replace("rustc-", "rust-docs-")
|
||||
snapshot_url = ("https://servo-rust.s3.amazonaws.com/%s.tar.gz"
|
||||
% docs_name)
|
||||
snapshot_url = ("https://static-rust-lang-org.s3.amazonaws.com/dist/rust-docs-nightly-%s.tar.gz"
|
||||
% host_triple())
|
||||
tgz_file = path.join(hash_dir, 'doc.tar.gz')
|
||||
|
||||
download_file("Rust docs", snapshot_url, tgz_file)
|
||||
|
|
|
@ -97,7 +97,7 @@ class CommandBase(object):
|
|||
self.config["tools"].setdefault("cargo-root", "")
|
||||
if not self.config["tools"]["system-rust"]:
|
||||
self.config["tools"]["rust-root"] = path.join(
|
||||
context.sharedir, "rust", *self.rust_snapshot_path().split("/"))
|
||||
context.sharedir, "rust", self.rust_snapshot_path())
|
||||
if not self.config["tools"]["system-cargo"]:
|
||||
self.config["tools"]["cargo-root"] = path.join(
|
||||
context.sharedir, "cargo", self.cargo_build_id())
|
||||
|
@ -127,7 +127,8 @@ class CommandBase(object):
|
|||
filename = path.join(self.context.topdir, "rust-snapshot-hash")
|
||||
with open(filename) as f:
|
||||
snapshot_hash = f.read().strip()
|
||||
self._rust_snapshot_path = "%s-%s" % (snapshot_hash, host_triple())
|
||||
self._rust_snapshot_path = ("%s/rustc-nightly-%s" %
|
||||
(snapshot_hash, host_triple()))
|
||||
return self._rust_snapshot_path
|
||||
|
||||
def cargo_build_id(self):
|
||||
|
@ -337,6 +338,8 @@ class CommandBase(object):
|
|||
if not self.config["tools"]["system-rust"] and \
|
||||
not path.exists(path.join(
|
||||
self.config["tools"]["rust-root"], "rustc", "bin", "rustc")):
|
||||
print("looking for rustc at %s" % path.join(
|
||||
self.config["tools"]["rust-root"], "rustc", "bin", "rustc"))
|
||||
Registrar.dispatch("bootstrap-rust", context=self.context)
|
||||
if not self.config["tools"]["system-cargo"] and \
|
||||
not path.exists(path.join(
|
||||
|
|
|
@ -164,7 +164,7 @@ def check_lock(file_name, contents):
|
|||
packages = {}
|
||||
|
||||
# package names to be neglected (as named by cargo)
|
||||
exceptions = []
|
||||
exceptions = ["libc"]
|
||||
|
||||
while idx < len(contents):
|
||||
content = contents[idx].strip()
|
||||
|
|
|
@ -1 +1 @@
|
|||
168a23ebe1729386138fa71643382fdd64fac205/rustc-1.5.0-dev
|
||||
2015-11-13
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
// except according to those terms.
|
||||
|
||||
#![feature(fs_walk)]
|
||||
#![feature(path_ext)]
|
||||
#![feature(slice_patterns)]
|
||||
#![feature(test)]
|
||||
|
||||
|
@ -21,7 +20,7 @@ extern crate util;
|
|||
use image::{DynamicImage, GenericImage, ImageFormat, RgbImage};
|
||||
use std::env;
|
||||
use std::ffi::OsStr;
|
||||
use std::fs::{PathExt, File, walk_dir};
|
||||
use std::fs::{File, walk_dir};
|
||||
use std::io::{self, Read, Result, Write};
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::process;
|
||||
|
|
|
@ -30,8 +30,8 @@ path = "../../../components/devtools_traits"
|
|||
git = "https://github.com/servo/ipc-channel"
|
||||
|
||||
[dependencies]
|
||||
cookie = "0.1"
|
||||
hyper = "0.6"
|
||||
url = "0.2"
|
||||
cookie = "0.2"
|
||||
hyper = "0.7"
|
||||
url = "0.5"
|
||||
time = "0.1"
|
||||
flate2 = "0.2.0"
|
||||
|
|
|
@ -11,5 +11,5 @@ doctest = false
|
|||
[dependencies.plugins]
|
||||
path = "../../../components/plugins"
|
||||
|
||||
[dependencies.url]
|
||||
version = "0.2.36"
|
||||
[dependencies]
|
||||
url = "0.5"
|
||||
|
|
|
@ -22,7 +22,7 @@ path = "../../../components/util"
|
|||
|
||||
[dependencies]
|
||||
app_units = {version = "0.1", features = ["plugins"]}
|
||||
url = "0.2"
|
||||
url = "0.5"
|
||||
cssparser = "0.4"
|
||||
selectors = "0.2"
|
||||
string_cache = "0.2"
|
||||
|
|
|
@ -17,6 +17,6 @@ path = "../../../components/plugins"
|
|||
|
||||
[dependencies]
|
||||
app_units = {version = "0.1", features = ["plugins"]}
|
||||
libc = "0.1"
|
||||
libc = "0.2"
|
||||
euclid = {version = "0.3", features = ["plugins"]}
|
||||
|
||||
|
|
|
@ -66,11 +66,6 @@ fn test_heap_size() {
|
|||
// An ascii string with 16 chars is 16 bytes in UTF-8.
|
||||
assert_eq!(String::from("0123456789abcdef").heap_size_of_children(), 16);
|
||||
|
||||
// … but RawVec::reserve gives twice the requested capacity.
|
||||
let mut x = String::new();
|
||||
x.push_str("0123456789abcdef");
|
||||
assert_eq!(x.heap_size_of_children(), 32);
|
||||
|
||||
// Not on the heap.
|
||||
let x: Option<i32> = None;
|
||||
assert_eq!(x.heap_size_of_children(), 0);
|
||||
|
|
Загрузка…
Ссылка в новой задаче