servo/components
bors-servo cbc857bb78 Auto merge of #13569 - Manishearth:simpliffi, r=emilio
Start simplifying FFI ownership sugar

This is step one of a series of changes planned to make the ownership sugar easier to use. This was blocked on #13038

*very* unsure about second commit. Don't like the thought of accepting types with destructors over FFI. Probably will revert it. Leaving it in for now in case you have some insight.

Eventually at least for the borrowed stuff I want to use T directly (because the crates are merged now), instead of the fake void types. Perhaps for the others too. I might include those changes in this PR -- was originally planning to but I realized that these steps could be split out.

Tentative plan for `Owned` (assuming it's not removed) is to have `Owned<T> <-> Box<T>` (same `T`, no "FFI type") conversions. We will only use ownership wrapper types for things with destructors, and try to keep the conversion simple. I'm envisioning a couple methods for arc/strong and a few more for box/owned. We may need to introduce new wrapper types for gecko-side managed objects (`RefPtr<T>`, `UniquePtr<T>`) but that should be all the wrapper types we have in the ownership sugar.

This PR relies on the guarantee that `Option<&T>` and `Option<Box<T>>` are pointer-sized via the `NonZero` optimization. I am now less unconvinced that this is a good idea 😉.

r? @emilio

cc @mystor

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13569)
<!-- Reviewable:end -->
2016-10-05 00:59:56 -05:00
..
canvas Add OSMesa headless mode, run WPT against Webrender, update tests. 2016-09-28 11:57:33 +10:00
canvas_traits Update cssparser 2016-09-07 14:13:56 +08:00
compositing Reorder use statements 2016-09-09 04:55:19 +02:00
constellation Inline push_pending_frame into its callers. 2016-09-20 14:01:56 +02:00
debugger Implement a WebSocket server for debugging. 2016-09-12 11:02:09 +02:00
devtools Reorder use statements 2016-09-09 04:55:19 +02:00
devtools_traits Derive the HeapSizeOf on TimelineMarkerType 2016-09-30 16:07:25 -06:00
gfx Minimal Win32 font platform implementation. 2016-10-05 07:46:02 +10:00
gfx_traits Update euclid to 0.10.1 2016-08-21 03:03:45 +02:00
layout layout: Place inline absolute hypothetical boxes properly during block 2016-10-04 18:40:40 -07:00
layout_thread Rename PrivateStyleData to PersistentStyleData and use AtomicRefCell instead of RefCell as a container. 2016-10-02 19:19:52 -07:00
layout_traits Reorder use statements 2016-09-09 04:55:19 +02:00
msg Excise SubpageId and use only PipelineIds 2016-09-13 15:37:38 -04:00
net Remove same-origin-data-url flag from fetch implementation 2016-10-01 00:27:03 -07:00
net_traits Remove some documentation that is no longer correct. 2016-10-04 17:30:56 +02:00
plugins Revert "Make DOMRefCell use style’s copy of RefCell" 2016-10-04 18:35:01 +02:00
profile Reorder use statements 2016-09-09 04:55:19 +02:00
profile_traits profile: Integrate the time profiler with the macOS signpost 2016-10-01 00:12:49 -07:00
range Update serde to 0.8 (fixes #12659) 2016-08-12 18:37:27 +02:00
script Auto merge of #13575 - servo:fetch-link, r=jdm 2016-10-04 18:12:18 -05:00
script_layout_interface Make style build without impl<T: HeapSizeOf> HeapSizeOf for Arc<T>. 2016-10-04 13:45:57 +02:00
script_traits Remove ScopeThings::pipeline_id 2016-10-04 14:05:28 +02:00
servo Minimal Win32 font platform implementation. 2016-10-05 07:46:02 +10:00
style Auto merge of #13569 - Manishearth:simpliffi, r=emilio 2016-10-05 00:59:56 -05:00
style_traits Reorder use statements 2016-09-09 04:55:19 +02:00
util Auto merge of #13472 - asajeffrey:util-remutex-dont-log-while-mutating-lock, r=jdm 2016-10-04 16:01:40 -05:00
webdriver_server Use fn pipeline_id consistently, not fn pipeline 2016-09-13 15:17:40 -04:00