Commit graph

449 commits

Author SHA1 Message Date
Ms2ger
323daffbf0 Qualify resource_task enums. 2015-01-04 15:47:46 +01:00
Ms2ger
b16f9cea09 Qualify hyper enums. 2015-01-04 15:26:40 +01:00
Ms2ger
b51e83819d Fix obsolete format traits.
They are to be removed from the language in the next rust upgrade.
2015-01-02 19:04:18 +01:00
Ms2ger
6077ed0ce8 Rename GlobalRoot::root_ref() to GlobalRoot::r() for consistency. 2015-01-01 20:38:04 +01:00
Ms2ger
925058ef26 Remove unsound Root::deref() calls in XMLHttpRequest. 2015-01-01 20:36:44 +01:00
Ms2ger
1dad710063 Replace Root::deref() calls by Root::r() calls where possible.
This changes those calls that were already sound.
2015-01-01 20:36:43 +01:00
yodalee
bb087c238b use str to_jsval() now
xmlhttprequest.rs, CodegenRust.py
replace into_string().to_jsval() to to_jsval()

conversions.rs
DOMString to_jsval() use as_slice().tojsval() now
2015-01-01 02:17:33 +08:00
Josh Matthews
9a7cd31134 Force all messages to worker tasks to send a TrustedWorkerAddress along with the ScriptMsg. This ensures that the main-thread Worker object is rooted for as long as there are events in flight or being processed. 2014-12-29 13:53:49 -05:00
Josh Matthews
2f059c15e7 Allow refcounting arbitrary DOM objects in concert with the GC to enable safe, asynchronous/cross-task references to pinned objects. 2014-12-29 13:53:48 -05:00
bors-servo
56d1b16d1b auto merge of #4173 : Manishearth/servo/a-more-dom-struct, r=kmcallister
Now `#[dom_struct]` also generates Reflectable impls, and there's another lint to ensure that a DOM struct only contains one bare DOM field (as the first field) or a Reflector.

A lot of this was generated by sed -- each autogenerated change has its own commit for easy review; these will be squashed later.
2014-12-27 22:12:45 -07:00
Manish Goregaokar
e9d1740e19 script: to_string() -> into_string() 2014-12-27 14:48:36 +01:00
Manish Goregaokar
7d65673561 Remove extra spaces
Command: `find . -maxdepth 1 -type f -print0 | xargs -0 sed -z -i "s/}\\n\\n\\n/}\\n\\n/"`
2014-12-27 02:53:35 +05:30
Manish Goregaokar
552db382d6 Remove manual impls of Reflectors (autogen)
Obtained via:

 `find . -maxdepth 1 -type f -print0 | xargs -0 sed -z -i "s/\\nimpl Reflectable for[^{]*{[^}]*}[^}]*}\\n//"`
 `find . -maxdepth 1 -type f -print0 |xargs -0  grep -lZ dom_struct | xargs -0 grep -LZ  "reflector()\\|Reflector::new" |xargs -0 sed -z -i "s/use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object};/use dom::bindings::utils::reflect_dom_object;/"`

followed by semi-automated removal of leftover imports
2014-12-27 02:52:33 +05:30
thiagopnts
271aa277e9 Replace XHR events for generic ones in ScriptTask
fixup! Replace XHR events for generic ones in ScriptTask

fixup! Replace XHR events for generic ones in ScriptTask
2014-12-23 23:53:38 -02:00
Tetsuharu OHZEKI
a7bb436177 script: Remove glob imports added in #4405 2014-12-19 04:52:48 +09:00
Ms2ger
466faac2a5 Update rustc to revision 3dcd2157403163789aaf21a9ab3c4d30a7c6494d. 2014-12-17 15:19:45 -05:00
thiagopnts
79487252ca Add auxiliary method to EventTargetHelpers for events without target
fixup! Add auxiliary method to EventTargetHelpers for events without target
2014-12-16 10:01:38 -02:00
Joseph Crail
c254d195ad Fix spelling mistakes in comments. 2014-12-11 23:56:29 -05:00
Med0paW
dacd21ac52 Issue 4253 - Setting timeout on a sync XHR should throw InvalidAccessErr 2014-12-05 18:29:39 -08:00
Sean McArthur
4ee8c3a60b convert script crate to use hyper 2014-12-04 10:06:41 -08:00
Michael Booth
2cbf5a3671 Updated reflect_dom_object to be passed by value 2014-11-30 19:47:52 +00:00
Kshitij Parajuli
f5e9ae17cf Shared Sniffer Task
- Added TargetedLoadResponse and ResponseSenders
- LoadData constructor contains the next consumer which means
  SnifferManager doesn't need the next consumer to start
- New SnifferTask is created at new resource_task creation
- Update Unit Tests
2014-11-28 12:35:49 -05:00
Jesse Tuchsen
b664ee88e7 Fixes #3962
Bad HTTP responses now have a 0 status code instead of 200 OK.
2014-11-27 11:55:31 -08:00
Jack Moffitt
d1b433a3b3 Rust upgrade to rustc hash b03a2755193cd756583bcf5831cf4545d75ecb8a 2014-11-13 11:17:43 +10:00
Mukilan Thiyagarajan
dc02352564 XHR - Trigger readystatechange when transitioning from HEADERS_RECEIVED to DONE
Fixes #3877
2014-11-06 23:57:48 +05:30
Manish Goregaokar
52983ed97c Silence lint for self.global in XHR 2014-11-06 06:37:44 +05:30
Mukilan Thiyagarajan
7435db26ac Fix race condition in XHR and handle other abort/open scenarios
This fixes issue #3630
A short summary of the changes:
* Use generation id to cancel inflight requests
* Handles nested calls to abort, open, send inside handlers
* Adds XHRReleaseMsg to delay freeing XHR object till all
  inflight events are processed
* Change the ErroredMsg enum to be more symmetric with the returned
  Error enum
2014-11-03 22:06:17 +05:30
Clark Gaebel
6df1cc8e4c Run all task spawning through util, to allow for easy hooking.
During debugging, I found it useful to hook all task creation in a
central location, and util::task was the perfect place for it.

r? @pcwalton (or maybe someone else, I'm kinda sending you a bunch of
reviews today because I don't know who better to give them to)
2014-10-28 09:53:45 -07:00
Tetsuharu OHZEKI
0a84c5d479 Macroize event handler getters and setters. 2014-10-23 13:03:58 +09:00
Tetsuharu OHZEKI
71b4143d32 Use DOMRefCell for XMLHttpRequest. 2014-10-22 10:01:01 +09:00
Manish Goregaokar
3f2cbb275b Use #[dom_struct] everywhere 2014-10-16 10:20:18 +05:30
bors-servo
f350879574 auto merge of #3666 : ttaubert/servo/issue/3644-privatize-dom, r=Manishearth
This PR removes public fields from all (hope I didn't miss any) DOM structs. Should |Page| be privatized as well? This PR additionally introduces a #[privatize] lint to ensure nobody accidentally re-introduces a public field.

All changesets compile separately if applied in the same order. Hope that helps reviewing but I can of course squash them before merging.
2014-10-13 22:00:37 -06:00
Tim Taubert
df60f8b2c5 Privatize EventTarget and EventListenerEntry 2014-10-13 13:25:43 +02:00
Tim Taubert
acd98a73a4 Simple privatizations 2014-10-13 11:13:12 +02:00
Tim Taubert
5080c0d86e Make Event::new take enumerated values instead of booleans (fixes #3643) 2014-10-11 16:57:00 +02:00
Tim Taubert
35f8270c64 Remove unnecessary deref()s (fixes #3586) 2014-10-09 15:01:54 +02:00
Manish Goregaokar
5c8a45d74e Remove Traceable/Untraceable from xmlhttprequest.rs 2014-10-05 22:32:10 +05:30
Josh Matthews
54fcab61d6 Implement MutNullableJS for mutable, nullable member pointers to DOM objects. 2014-10-01 17:06:23 +02:00
Simon Sapin
b3245fa407 Upgrade to rustc d2b30f7d3 2014-09-23 2014-09-29 17:41:45 +01:00
Ms2ger
e72b5613ee Don't move the data when extracting the bytes in XMLHttpRequest::Send.
The data is used later to set the Content-Type header. Current rustc
(4d2af3861) does not detect this use-after-move, but treats the later use as
if the data was None. It will, however, detect the bug in d2b30f7d3, which we
are upgrading to.
2014-09-29 17:52:44 +02:00
ProgramFOX
71a05a9c39 Made some DOM fields private.
Relevant to #2242.
2014-09-26 20:35:01 +02:00
Manish Goregaokar
cc44a3b064 Use JSTraceable everywhere 2014-09-24 05:44:49 +05:30
Keegan McAllister
a640a7c5c3 Upgrade to rustc 0.12.0-pre (4d2af3861 2014-09-17 15:51:11 +0000) 2014-09-20 13:00:06 -07:00
Cameron Zwarich
d768ee77ad Convert various helper traits from &JSRef to JSRef
I converted them all with a few exceptions:

- Methods that were used by trait objects, since trait objects don't
  work with `self` methods.
- Methods that take an &'b JSRef<'a, T> and return an &'b. In reality,
  many (all?) could return an &'a instead, but this isn't allowed by the
  Deref trait.
- Methods that internally rely on the same issue with Deref.
- I left out the traits involved in layout entirely, even though not all
  of their methods suffer from one of the above problems.

There will probably be solutions to all of these problems in the future.
2014-09-20 11:54:11 -07:00
Cameron Zwarich
2c8d51a37c More progress in the &JSRef -> JSRef conversion
Change all of the <Class>Methods traits to take `self` instead of
`&self`.
2014-09-20 11:54:10 -07:00
Cameron Zwarich
4fa8725111 First steps of &JSRef -> JSRef conversion
Replace &JSRef with JSRef in the bulk of the generated code. This will
remove a level of indirection throughout all DOM code.

This patch doesn't change methods implemented on JSRef<T> to take `self`
rather than `&self`, and it leaves a few other uses of &JSRef, but those
changes can be made incrementally.
2014-09-19 13:39:17 -07:00
Manish Goregaokar
bded5c3703 Add unrooted_must_root lint for usages of JS<T> in let/for bindings 2014-09-16 22:54:24 +05:30
Manish Goregaokar
12dc54d238 Add unrooted_must_root lint for enums and structs containing JS<T>, as well as functions with JS<T> in their parameter list
For safe wrappers over JS<T> (eg Temporary<T>) use #[allow(unrooted_must_root)].
For all other types containing a #[must_root] value, annotate the type with #[must_root] to ensure that it is never used unrooted
2014-09-16 22:11:27 +05:30
Jack Moffitt
c6ab60dbfc Cargoify servo 2014-09-08 20:21:42 -06:00
Renamed from src/components/script/dom/xmlhttprequest.rs (Browse further)