Commit graph

230 commits

Author SHA1 Message Date
bors-servo
df57af1fc4 Auto merge of #5527 - jagtalon:jag/multiple-urls, r=mbrubeck
Switched from opts.urls from being of type Vec to type String and changing the name to `url` as well. Changed the other files that are using opts.urls accordingly.
2015-04-07 22:08:33 -05:00
Simon Sapin
6d5406efc1 Move util crate unit tests into a new unit_tests crate 2015-04-07 16:37:11 -04:00
Jag Talon
74cd4cd56a opts.rs: don't accept multiple URLs. Fixes #5520.
Switched from opts.urls from being of type Vec to type String and changing the name to `url` as well. Changed the other files that are using opts.urls accordingly.

servo/lib.rs + gonk/src/lib.rs: no need for a block scope.

cef: fix compiler errors.

- remove the use of `mut` since it's not needed.
- use `to_owned` instead of `to_string` because it's more efficient.
2015-04-07 15:46:51 -04:00
bors-servo
c7e210f24c Auto merge of #5005 - jdm:mime-sniffing, r=jdm
This rebases and integrates #4209, removing the sniffer task (turns out it wasn't a great idea), and adds a `--sniff-mime-types` command line flag to enable sniffing for file:// and http:// resources. Tested against a random picture file on my harddrive. The actual MIME sniffing implementation can be extracted into a separate library separately.
2015-04-07 12:48:06 -05:00
Josh Matthews
a3201bc1ac Enable optional mime sniffing, and integrate it with the file loader. 2015-04-06 20:19:30 -04:00
Josh Matthews
5728799479 Get the barest bones of webdriver integration ready for keeners. 2015-04-06 18:22:32 -04:00
bors-servo
afbc51a746 auto merge of #5430 : Manishearth/servo/userscript_path, r=kmcallister
r? @kmcallister
2015-04-01 13:15:46 -06:00
Patrick Walton
66dd8c8a6c layout: Implement CSS transitions per CSS-TRANSITIONS § 2.
Transition events are not yet supported, and the only animatable
properties are `top`, `right`, `bottom`, and `left`. However, all other
features of transitions are supported. There are no automated tests at
present because I'm not sure how best to test it, but three manual tests
are included.
2015-03-31 08:46:11 -07:00
bors-servo
674e52afa1 auto merge of #5416 : Ms2ger/servo/int, r=jdm 2015-03-28 13:58:02 -06:00
Ms2ger
573f721714 Move to new io in util. 2015-03-28 20:02:23 +01:00
Ms2ger
43ed033eff Use isize/usize in range. 2015-03-28 15:36:36 +01:00
Ms2ger
f50530577c Use usize in test_lru_cache. 2015-03-28 15:36:36 +01:00
Manish Goregaokar
4d2ca2d8e2 Allow passing a path to --userscripts 2015-03-28 14:59:11 +05:30
Nicholas Nethercote
ce36e574f4 Rename lots of profiling-related things.
------------------------------------------------------------------------
BEFORE                              AFTER
------------------------------------------------------------------------
util::memory                        util::mem
- heap_size_of                      - heap_size_of (unchanged)
- SizeOf                            - HeapSizeOf
  - size_of_excluding_self            - heap_size_of_children

prof::mem                           prof::mem
- MemoryProfilerChan                - ProfilerChan
- MemoryReport                      - Report
- MemoryReportsChan                 - ReportsChan
- MemoryReporter                    - Reporter
- MemoryProfilerMsg                 - ProfilerMsg
  - {R,UnR}egisterMemoryReporter      - {R,UnR}egisterReporter
- MemoryProfiler                    - Prof
- ReportsForest                     - ReportsForest (unchanged)
- ReportsTree                       - ReportsTree   (unchanged)
- SystemMemoryReporter              - SystemReporter

prof::time                          prof::time
- TimeProfilerChan                  - ProfilerChan
- TimerMetadata                     - TimerMetadata (unchanged)
- Formatable                        - Formattable [spelling!]
- TimeProfilerMsg                   - ProfilerMsg
- TimeProfilerCategory              - ProfilerCategory
- TimeProfilerBuckets               - ProfilerBuckets
- TimeProfiler                      - Profiler
- TimerMetadataFrameType            - TimerMetadataFrameType (unchanged)
- TimerMetadataReflowType           - TimerMetadataReflowType (unchanged)
- ProfilerMetadata                  - ProfilerMetadata (unchanged)

In a few places both prof::time and prof::mem are used, and so
module-qualification is needed to avoid overlap, e.g. time::Profiler and
mem::Profiler. Likewise with std::mem and prof::mem. This is not a big
deal.
2015-03-25 16:00:23 -07:00
Ms2ger
56af6a6568 Fix warnings related to std::fs::PathExt on Android. 2015-03-25 16:54:34 +01:00
Diego Marcos
e3f5a76baa Implementing canvas drawImage API for HTML Canvas elements as image source 2015-03-24 12:23:15 -07:00
Nicholas Nethercote
52447ccd9b Move profiler code from util into a new crate profile.
- Most of util::memory has been moved into profile::mem, though the
  `SizeOf` trait and related things remain in util::memory. The
  `SystemMemoryReporter` code is now in a submodule
  profile::mem::system_reporter.

- util::time has been moved entirely into profile::time.
2015-03-24 02:09:31 -07:00
bors-servo
7f60feef77 auto merge of #5326 : Adenilson/servo/squashingWarnings03, r=jdm 2015-03-23 19:27:46 -06:00
Nicholas Nethercote
fe3e93225b Print trees in the memory profiler's output.
Memory reports are much nicer to read when grouped into trees, which requires giving each report a path instead of a name.

Sample output:
```
Begin memory reports
|
|    2.51 MiB -- pages
|       2.51 MiB -- url(file:///home/njn/moz/servo/../servo-static-suite/wikipedia/Guardians%20of%20the%20Galaxy%20(film)%20-%20Wikipedia,%20the%20free%20encyclopedia.html)
|          2.51 MiB -- display-list
|
|  238.89 MiB -- resident-according-to-smaps
|     188.31 MiB -- anonymous (rw-p)
|      27.29 MiB -- /home/njn/moz/servo/components/servo/target/debug/servo (r-xp)
|       7.82 MiB -- other
|       6.65 MiB -- [heap] (rw-p)
|       3.55 MiB -- /usr/lib/x86_64-linux-gnu/dri/i965_dri.so (r-xp)
|       1.42 MiB -- /lib/x86_64-linux-gnu/libc-2.19.so (r-xp)
|       1.13 MiB -- /home/njn/moz/servo/components/servo/target/debug/servo (r--p)
|       0.74 MiB -- /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0 (r-xp)
|       0.73 MiB -- /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.20 (r-xp)
|       0.65 MiB -- /lib/x86_64-linux-gnu/libm-2.19.so (r-xp)
|       0.60 MiB -- /lib/x86_64-linux-gnu/libglib-2.0.so.0.4200.1 (r-xp)
|
|   71.08 MiB -- jemalloc-heap-active
|   59.11 MiB -- jemalloc-heap-allocated
|  180.00 MiB -- jemalloc-heap-mapped
|  232.87 MiB -- resident
|   54.43 MiB -- system-heap-allocated
| 3130.11 MiB -- vsize
|
End memory reports
```
2015-03-23 15:17:04 -07:00
Adenilson Cavalcanti
1f6a93144f Squashing the remaining warnings in utils module. 2015-03-23 11:38:44 -07:00
bors-servo
b1a35f549b auto merge of #5324 : Ms2ger/servo/missing_copy_implementations, r=jdm
This is now the default.
2015-03-23 08:45:50 -06:00
Ms2ger
2755ed6c58 Remove allow(missing_copy_implementations) attributes.
This is now the default.
2015-03-23 10:49:44 +01:00
bors-servo
4c2ec083e8 auto merge of #5314 : Ms2ger/servo/warnings, r=jdm 2015-03-23 03:24:50 -06:00
Corey Farwell
5a780cb221 Stop abusing format! macro when construct a String
In these cases for `format!`, we're just constructing a String of the
single argument with no special format.
2015-03-22 18:54:56 -04:00
Ms2ger
f416a6a66e Update some feature gates. 2015-03-22 17:09:57 +01:00
Manish Goregaokar
596e03e546 Basic userscript support 2015-03-22 15:13:11 +05:30
Ms2ger
ba87666cdb Update some code that's feature-gated under core. 2015-03-21 18:44:39 +01:00
Ms2ger
32d1e31c90 Replace most usage of std::old_io::File. 2015-03-20 23:47:29 +01:00
Patrick Walton
fda3791487 util: Turn on ndebug in release mode, and fix task-state to not crash
when `ndebug` is on.
2015-03-20 10:09:52 -07:00
Jack Moffitt
331c7030d9 Fix overflowed arithmetic.
This uses wrapping_add, which was always the intended operation.

Fixes #5275.
2015-03-19 09:31:40 -06:00
bors-servo
34950418ea auto merge of #5269 : Manishearth/servo/old_impl, r=jdm
Brings us to zero old impls. \o/

Feel free to add this to a larger warning fix PR
2015-03-18 22:33:47 -06:00
bors-servo
0b1c2a1798 auto merge of #5267 : Adenilson/servo/squashWarnings02, r=jdm 2015-03-18 20:54:48 -06:00
Manish Goregaokar
0d7afc37e3 rm unnecessary old_impl_check 2015-03-19 07:16:03 +05:30
Adenilson Cavalcanti
375dbeff1e Squashing a few warnings. 2015-03-18 16:26:16 -07:00
Matt Brubeck
6ef9cb4e18 Remove workaround for rust-lang/rust#22244 2015-03-18 14:44:34 -07:00
Matt Brubeck
1ead92b474 Rename dlist to linked_list. 2015-03-18 14:44:34 -07:00
Simon Sapin
6a58cbd118 Fix more warnings everywhere. 2015-03-18 22:11:20 +01:00
Simon Sapin
1e858ecbc6 Fix some warnings in util. 2015-03-18 21:35:06 +01:00
Ms2ger
5f15eb5fbf Upgrade rustc to d3c49d2140fc65e8bb7d7cf25bfe74dda6ce5ecf/rustc-1.0.0-dev. 2015-03-18 13:18:31 -04:00
bors-servo
29b158e985 auto merge of #5252 : nnethercote/servo/system-reporter, r=jdm
Currently the system memory measurements ("resident", "vsize", etc.) are
not reported through the generic memory reporting mechanism, simply
because they pre-date that mechanism. This changeset removes that
special-casing.

One consequence of this is that previously if a platform didn't
implement one of the basic measurements, a '???' entry would be printed.
Now nothing will be printed. This is no great loss and matches what
Firefox does.

Another consequence is that the order in which the measurements are
printed is changed. I plan to fix this soon so that reports are sorted
in a more sensible fashion.
2015-03-17 14:31:10 -06:00
Nicholas Nethercote
f306febd13 Put system memory measurements in a memory reporter.
Currently the system memory measurements ("resident", "vsize", etc.) are
not reported through the generic memory reporting mechanism, simply
because they pre-date that mechanism. This changeset removes that
special-casing.

One consequence of this is that previously if a platform didn't
implement one of the basic measurements, a '???' entry would be printed.
Now nothing will be printed. This is no great loss and matches what
Firefox does.

Another consequence is that the order in which the measurements are
printed is changed. I plan to fix this soon so that reports are sorted
in a more sensible fashion.
2015-03-17 12:24:33 -07:00
Patrick Walton
d10627a2b3 layout: Implement 2D CSS transforms per CSS-TRANSFORMS § 5, 6, 7, and 8. 2015-03-17 11:30:55 -07:00
Nicholas Nethercote
fa9ca206ef Remove the fake memory profiler thread.
Currently if you don't specify the '-m' option, a fake do-nothing memory
profiler thread gets created instead of the real one. It ignores all
events except for `Exit`. And the timer thread doesn't get created so no
`Print` events are sent.

This changeset instead always creates the real thread. If you specify
'-m' the *timer* thread is still absent and it won't print anything.
However, the memory profiler thread will respond to register/unregister
events, which is good, because if there's a bug in those (e.g.
double-registration of a particular name) it'll show up in invocations
that lack '-m'.
2015-03-16 18:12:28 -07:00
Nicholas Nethercote
ece2711185 Add memory reporting infrastructure and use it to measure the display list.
This changeset implements the beginnings of fine-grained measurement of
Servo's data structures.

- It adds a new `SizeOf` trait, which is used to measure the memory used
  by heap data structures, and implements it for some std types: Box,
  String, Option, Arc, Vec, and DList.

- It adds a new `MemoryReporter` trait which is used to report memory
  measurements from other threads to the memory profiler. Reporters are
  registered and unregistered with the memory profiler, and the memory
  profiler makes measurement requests of reporters when necessary.

- It plumbs a MemoryProfilerChan through to the layout task so it can
  register a memory reporter.

- It implements the `SizeOf` trait for `DisplayList` and associated
  types, and adds a memory reporter that uses it.

The display list hits 14.77 MiB when viewing
tests/html/perf-rainbow.html, and 2.51 MiB when viewing the Guardians of
the Galaxy Wikipedia page from servo-static-suite. Example output:

  0.29: display-list::http://www.reddit.com/
  0.00: display-list::http://static.adzerk.net/reddit/ads.html?sr=-reddit.com,loggedout&bust2#http://www.reddit.com
  0.00: display-list::http://www.reddit.com/static/createadframe.html

There are a number of FIXME comments indicating sub-optimal things. This
is a big enough change for now that doing them as follow-ups seems best.
2015-03-16 18:12:26 -07:00
Manish Goregaokar
9119bb2041 Add --no-ssl flag for bypassing SSL checking 2015-03-14 19:17:07 +05:30
Patrick Walton
f9cdd05d58 layout: Implement ordered lists, CSS counters, and quotes per CSS 2.1
§ 12.3-12.5.

Only simple alphabetic and numeric counter styles are supported. (This
is most of them though.)

Although this PR adds a sequential pass to layout, I verified that on
pages that contain a reasonable number of ordered lists (Reddit
`/r/rust`), the time spent in generated content resolution is dwarfed by
the time spent in the parallelizable parts of layout. So I don't expect
this to negatively affect our parallelism expect perhaps in pathological
cases.
2015-03-09 17:13:45 -07:00
Adenilson Cavalcanti
618f56410d Implements reflow events debugging.
Start servo with -Z relayout-event and you should have
reflow events printed to the terminal.
2015-03-06 12:27:18 -08:00
Adenilson Cavalcanti
463f03826f Cleanup compilation warning in OSX (should still work on Linux). 2015-03-03 16:01:25 -08:00
Simon Sapin
4c1d778ced Revert "layout: Implement ordered lists, CSS counters, and quotes per CSS 2.1"
This reverts commit 30fd28d107.
2015-03-03 21:16:24 +01:00
Patrick Walton
30fd28d107 layout: Implement ordered lists, CSS counters, and quotes per CSS 2.1
§ 12.3-12.5.

Only simple alphabetic and numeric counter styles are supported. (This
is most of them though.)

Although this PR adds a sequential pass to layout, I verified that on
pages that contain a reasonable number of ordered lists (Reddit
`/r/rust`), the time spent in generated content resolution is dwarfed by
the time spent in the parallelizable parts of layout. So I don't expect
this to negatively affect our parallelism expect perhaps in pathological
cases.
2015-03-03 17:31:19 +01:00