aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/timers.rs
Commit message (Collapse)AuthorAgeFilesLines
* Auto merge of #11872 - eddyb:back-to-roots, r=Ms2gerbors-servo2016-07-041-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace return_address usage for rooting with stack guards and convenience macros. The existing `Rooted` and `RootedVec` users were migrated the the following two macros: ```rust let x = Rooted::new(cx, value); // Was changed to: rooted!(in(cx) let x = value); // Which expands to: let mut __root = Rooted::new_unrooted(value); let x = RootedGuard::new(cx, &mut __root); ``` ```rust let mut v = RootedVec::new(); v.extend(iterator); // Was changed to: rooted_vec!(let v <- iterator); // Which expands to: let mut __root = RootableVec::new(); let v = RootedVec::new(&mut __root, iterator); ``` The `rooted!` macro depends on servo/rust-mozjs#272. These APIs based on two types, a container to be rooted and a rooting guard, allow implementing both `Rooted`-style rooting and `Traceable`-based rooting in stable Rust, without abusing `return_address`. Such macros may have been tried before, but in 1.9 their hygiene is broken, they work only since 1.10. Sadly, `Rooted` is a FFI type and completely exposed, so I cannot prevent anyone from creating their own, although all fields but the value get overwritten by `RootedGuard::new` anyway. `RootableVec` OTOH is *guaranteed* to be empty when not rooted, which makes it harmless AFAICT. By fixing rust-lang/rust#34227, this PR enables Servo to build with `-Zorbit`. --- - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix rust-lang/rust#34227 - [x] These changes do not require tests because they are not functional changes <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11872) <!-- Reviewable:end -->
| * Switch to using the new rooted!/RootedGuard API for rooting.Eduard Burtescu2016-07-041-2/+2
| |
* | Refactor `util::prefs` operations to be methods on static struct.Corey Farwell2016-07-021-2/+2
|/
* Auto merge of #10225 - jmr0:visibility_api, r=jdmbors-servo2016-06-161-4/+34
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement non-visible pipeline and iframe visibility methods This addresses #9566 and a good part of #9751, specifically: * Pipeline has a notion of visibility * IFrame setVisible/getVisible interface with IFrame's pipeline visibility * IFrame mozbrowservisibilitychange responds to changes in visibility * Pipeline visibility is used to limit animations (requestAnimationFrame does not tick animations when hidden) and to increase timer intervals (currently set to a minimum of 1 second while hidden) Absent for now are any changes to the Document API and general implementation of the Page Visibility API, since the more interesting parts require knowledge of whether the user agent is minimized, OS screen locked, etc. cc @paulrouget @jdm <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10225) <!-- Reviewable:end -->
| * Implement non-visible pipeline and iframe visibility methodsjmr02016-06-151-4/+34
| |
* | Remove an invalid assertion in fire_timer.Ms2ger2016-06-101-1/+4
|/ | | | | | | It's not clear to me if this is something we should expect to happen, but it does indeed happen, so we should disable the assertion while we investigate. Fixes #9984.
* Remove empty lines following braces.Josh Matthews2016-05-271-2/+0
|
* Move DOMString back to scriptAnthony Ramine2016-05-241-1/+1
| | | | This entirely removes the 'non-geckolib' feature of the util crate.
* Removed unused importsPer Lundberg2016-05-151-2/+0
| | | | This fixes #11185.
* Use num-traits in script.Ms2ger2016-04-201-1/+1
|
* Clean up of script timer code.benshu2016-02-201-222/+315
| | | | | | | | | | | The code was split into the following two abstractions. - OneshotTimers can be used to schedule arbitrary oneshot timers, such as XHR-Timeouts. - JsTimers (`setTimeout` and `setInterval`) which use OneshotTimers to schedule individual callbacks. With this change the implementation (of JsTimers in particular) is in much closer alignment with the specification.
* Auto merge of #9471 - peterkort:patch-1, r=jdmbors-servo2016-02-061-0/+1
|\ | | | | | | | | | | | | | | fix #8461 <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9471) <!-- Reviewable:end -->
| * resume fn should set suspended_since back to Nonepeterkort2016-01-311-0/+1
| |
* | Say farewell to in-tree HeapSizeOfAnthony Ramine2016-02-041-1/+1
|/
* Add global default method for Reflectable traitChad Kimes2016-01-111-2/+1
|
* task -> threadrohan.prinja2016-01-101-1/+1
|
* fix intermittent Option::unwrap in timersAleksandr Likhanov2015-12-041-8/+14
| | | | not allow to fire timers installed during another timer call
* Correct undisciplined rebase. (Closes #8583.)benshu2015-11-181-2/+0
|
* script: Make timer events e10s-safe.Patrick Walton2015-11-121-6/+6
| | | | Closes #8235.
* Clean up the conversion routinesAnthony Ramine2015-11-111-3/+2
| | | | | | | | Functions returning `Root<T>` are prefixed by "root_" and the ones returning `*const T` by "native_". Functions taking `*mut JSObject` are now suffixed by "_from_object" and the ones taking `&T` by "_from_reflector".
* XHR timeouts use same abstraction as scripts timers. (fixes #3396)benshu2015-11-111-12/+55
|
* Auto merge of #8175 - benschulz:set-timeout-panic, r=jdmbors-servo2015-11-091-4/+10
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed panic in ActiveTimers.set_timeout_or_interval. `ActiveTimers.set_timeout_or_interval` asserts that the pipeline is not currently frozen. Apparently that is too strict. When pending network requests complete after a pipeline is frozen, scripts may be executed and a timer scheduled. With these changes scheduling a timer while the pipeline is frozen behaves as if the timer was scheduled at the time the pipeline was frozen. To reproduce the panic 1. `./mach run -r http://google.com`, 2. immediately click on any link and 3. wait for the panic. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8175) <!-- Reviewable:end -->
| * Fixed panic in ActiveTimers.set_timeout_or_interval.benshu2015-10-241-4/+10
| |
* | merge from masterrohan.prinja2015-11-031-1/+1
|\ \
| * | Fix some rust-clippy violationsCorey Farwell2015-10-301-1/+1
| |/
* / more refactoringrohan.prinja2015-10-301-1/+1
|/
* Timers are scheduled by a dedicated per-constellation thread.benshu2015-10-211-201/+277
|
* Support the updated spidermonkey bindingsMichael Wu2015-10-141-1/+4
|
* sorted the extern crate, mod & use declarationsRavi Shankar2015-09-241-4/+3
|
* Fix reported test-tidy errors for unmerged import blocksBrandon Fairchild2015-09-191-8/+5
| | | | This merges import blocks that were reported by tidy as unmerged.
* Make test-tidy check that braces have spaces before or after themwilmoz2015-08-311-2/+2
|
* sort all usesJohann Tuffe2015-08-201-6/+6
|
* Cleanup textinput, timersManish Goregaokar2015-08-181-2/+2
|
* Replace uses of `for foo in bar.iter()`,João Oliveira2015-08-181-3/+3
| | | | | and `for foo in bar.iter_mut(), and for foo in bar.into_iter() (continuation of #7197)
* Fix existing syntactics nits.Josh Matthews2015-08-161-1/+1
|
* Splitting ScriptMsg into various enums; r=jdmRavi Shankar2015-08-151-5/+3
|
* Start reporting memory usage for Window and all nodes in all DOM trees for ↵Josh Matthews2015-08-031-5/+14
| | | | frame treese in script tasks.
* Refactor #[jstraceable] to #[derive(JSTraceable)]David Winslow2015-07-011-12/+7
| | | | fixes #6524
* Upgrade to SM 39Michael Wu2015-06-191-18/+38
|
* Upgrade to rustc 551a74dddd84cf01440ee84148ebd18bc68bd7c8.Simon Sapin2015-05-051-9/+4
|
* Implement Clone for Copy types.Ms2ger2015-04-281-1/+1
|
* Remove as_slice() calls from script.Ms2ger2015-04-261-1/+1
|
* Replace unsafe_blocks by unsafe_code.Manish Goregaokar2015-03-211-1/+1
|
* Upgrade rustc to d3c49d2140fc65e8bb7d7cf25bfe74dda6ce5ecf/rustc-1.0.0-dev.Ms2ger2015-03-181-3/+3
|
* Derive Debug rather than the deprecated Show for TimerControlMsg.Ms2ger2015-02-241-1/+1
|
* auto merge of #4960 : ↵bors-servo2015-02-231-9/+51
|\ | | | | | | | | | | pkondzior/servo/add-script-timers-suspend-resume-functionality, r=jdm Adds free/thaw methods to script_task that let you send suspend/resume messages to web content timers. Fixes #4907
| * Add thaw/freeze messages that can suspend/resume webcontent timers #4907Pawel Kondzior2015-02-241-9/+51
| |
* | Fixing Intermittent failure in pages with timersPrabhjyot Singh Sodhi2015-02-221-1/+4
|/ | | | Fixes #4923
* Upgrade to rustc ba2f13ef0 2015-02-04Simon Sapin2015-02-111-1/+1
|
* add `unwrap` to `send/recv` callsAlexandru Cojocaru2015-02-031-1/+1
|