gecko-dev/servo/ports/cef/lib.rs

75 строки
1.5 KiB
Rust
Исходник Обычный вид История

/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
#![allow(non_camel_case_types)]
#![feature(box_syntax)]
#![feature(core_intrinsics)]
#![feature(link_args)]
#[macro_use]
extern crate log;
extern crate servo;
extern crate compositing;
extern crate euclid;
extern crate gleam;
extern crate glutin_app;
extern crate script_traits;
servo: Merge #14592 - Remove the util crate (from asajeffrey:util-goodbye); r=mbrubeck <!-- Please describe your changes on the following line: --> This PR removes the `util` crate. * Replaced the `spawn_named` and `clamp` functions by appropriate uses of `std::thread::Builder::spawn`, `std::cmp::min` and `std::cmp::max`. * Moved `opts`, `prefs` and `resource_files` into a new `config` crate. * Moved `remutex` and `geometry` into their own crates. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes do not require tests because they are refactorings <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Source-Repo: https://github.com/servo/servo Source-Revision: 4eb653817f87e5fb47de34356f558eb76ecbca9f --HG-- rename : servo/components/util/Cargo.toml => servo/components/config/Cargo.toml rename : servo/components/util/basedir.rs => servo/components/config/basedir.rs rename : servo/components/util/lib.rs => servo/components/config/lib.rs rename : servo/components/util/opts.rs => servo/components/config/opts.rs rename : servo/components/util/prefs.rs => servo/components/config/prefs.rs rename : servo/components/util/resource_files.rs => servo/components/config/resource_files.rs rename : servo/components/util/geometry.rs => servo/components/geometry/lib.rs rename : servo/components/util/remutex.rs => servo/components/remutex/lib.rs rename : servo/tests/unit/util/lib.rs => servo/tests/unit/servo_config/lib.rs rename : servo/tests/unit/util/opts.rs => servo/tests/unit/servo_config/opts.rs rename : servo/tests/unit/util/prefs.rs => servo/tests/unit/servo_config/prefs.rs rename : servo/tests/unit/util/remutex.rs => servo/tests/unit/servo_remutex/lib.rs
2016-12-15 03:48:42 +03:00
extern crate servo_config;
extern crate servo_geometry;
extern crate servo_url;
extern crate style_traits;
extern crate net_traits;
extern crate msg;
2017-01-23 18:26:00 +03:00
extern crate webrender_traits;
extern crate libc;
servo: Merge #6150 - Upgrade to Spidermonkey 39 (from servo:smupgrade3); r=mbrubeck > Here it is. > > ~~There's two major things that are unfinished here:~~ > - ~~Dealing with the unroot_must_root lint. I'm not sure about the value of this lint with the new rooting API.~~ Done. > - ~~Updating the Cargo.locks to point to the new SM and SM binding.~~ Done. > > I also included my fixes for the rust update, but these will disappear in a rebase. A rust update is necessary to support calling `Drop` on `Heap<T>` correctly when `Heap<T>` is inside a `Rc<T>`. Otherwise `&self` points to the wrong location. > > Incremental GC is disabled here. I'm not sure how to deal with the incremental barriers so that's left for later. > > Generational GC works. SM doesn't work without it. > > The biggest change here is to the rooting API. `Root` was made movable, and `Temporary` and `JSRef` was removed. Movable `Root`s means there's no need for `Temporary`, and `JSRef`s aren't needed generally since it can be assumed that being able to obtain a reference to a dom object means it's already rooted. References have their lifetime bound to the Roots that provided them. DOM objects that haven't passed through `reflect_dom_object` don't need to be rooted, and DOM objects that have passed through `reflect_dom_object` can't be obtained without being rooted through `native_from_reflector_jsmanaged` or `JS::<T>::root()`. > > Support for `Heap<T>` ended up messier than I expected. It's split into two commits, but only because it's a bit difficult to fold them together. Supporting `Heap<T>` properly requires that that `Heap::<T>::set()` be called on something that won't move. I removed the Copy and Clone trait from `Heap<T>` so `Cell` can't hold `Heap<T>` - only `UnsafeCell` can hold it. > > `CallbackObject` is a bit tricky - I moved all callbacks into `Rc<T>` in order to make sure that the pointer inside to a `*mut JSObject` doesn't move. This is necessary for supporting `Heap<T>`. > > `RootedCollectionSet` is very general purpose now. Anything with `JSTraceable` can be rooted by `RootedCollectionSet`/`RootedTraceable`. Right now, `RootedTraceable` is only used to hold down dom objects before they're fully attached to their reflector. I had to make a custom mechanism to dispatch the trace call - couldn't figure out how to get trait objects working for this case. > > This has been tested with the following zeal settings: > > GC after every allocation > JS_GC_ZEAL=2,1 > > GC after every 100 allocations (important for catching use-after-free bugs) > JS_GC_ZEAL=2,100 > > Verify pre barriers > JS_GC_ZEAL=4,1 > > Verify post barriers > JS_GC_ZEAL=11,1 Source-Repo: https://github.com/servo/servo Source-Revision: e7808c526c348fea5e3b48af70b7f1a066652097
2015-06-20 01:46:55 +03:00
#[cfg(target_os="macos")]
#[link_args="-Xlinker -undefined -Xlinker dynamic_lookup"]
extern { }
#[cfg(target_os="macos")]
extern crate cocoa;
#[cfg(target_os="macos")]
#[macro_use]
extern crate objc;
// Must come first.
pub mod macros;
pub mod browser;
pub mod browser_host;
pub mod command_line;
pub mod cookie;
pub mod core;
pub mod drag_data;
pub mod eutil;
pub mod frame;
pub mod interfaces;
pub mod print_settings;
pub mod process_message;
pub mod render_handler;
pub mod request;
pub mod request_context;
pub mod response;
pub mod stream;
pub mod string;
pub mod string_list;
pub mod string_map;
pub mod string_multimap;
pub mod stubs;
pub mod switches;
pub mod task;
pub mod types;
pub mod urlrequest;
pub mod v8;
pub mod values;
pub mod window;
pub mod wrappers;
pub mod xml_reader;
pub mod zip_reader;