Commit graph

175 commits

Author SHA1 Message Date
Edward Cho
d0469dfaf3 move mime classifier unit tests into unit test crate 2015-04-13 15:40:30 -05:00
bors-servo
9754c4c255 Auto merge of #5576 - jagtalon:jag/slashdot-storage, r=jdm
Use `and_then` and remove `unwrap` instead of using a `map` as described in https://github.com/servo/servo/issues/5548#issuecomment-90254644.

Fixes #5548
2015-04-11 18:13:16 -05:00
Aneesh Agrawal
5b593a3d32 Switch Arc<Box<Image>> to Arc<Image> for perf boost.
Image used to be a trait, but no longer is, so boxing it is no longer
necessary.
2015-04-10 18:59:02 -04:00
bors-servo
9677eb292d Auto merge of #5631 - Ms2ger:virtual-file, r=jdm 2015-04-10 08:14:16 -05:00
Aneesh Agrawal
a1d7456307 Remove compositor dependency on net crate.
Move the ImageCacheTaskClient trait and impl to net_traits. Fixes #5551.
2015-04-10 06:11:31 -04:00
Ms2ger
6881776d81 Avoid virtual calls when loading files. 2015-04-10 11:54:44 +02:00
Mátyás Mustoha
c842e499b3 Fix int-related warnings in net/mime_classifier. 2015-04-08 12:14:36 +02:00
bors-servo
cad27a9d25 Auto merge of #5568 - jdm:net_uint, r=jdm 2015-04-08 01:47:56 -05:00
Simon Sapin
e27c967f81 Move net::resource_task unit tests into the unit_tests crate. 2015-04-08 01:07:51 +02:00
Simon Sapin
d88770e09f Move net::{data_loader,image_cache_task} unit tests into the unit_tests crate. 2015-04-08 01:07:50 +02:00
Simon Sapin
691222696e Move net::cookie unit tests into the unit_tests crate. 2015-04-07 16:37:12 -04:00
Josh Matthews
1757afef27 Remove int_uint from net. 2015-04-07 16:13:37 -04:00
Josh Matthews
9674feebba Cleanup tabs. 2015-04-07 13:25:17 -04:00
Josh Matthews
4a78da1158 Fix unit tests. 2015-04-07 13:25:16 -04:00
Josh Matthews
23ae940abf Enable MIME sniffing for HTTP loads. 2015-04-07 13:25:15 -04:00
Josh Matthews
a3201bc1ac Enable optional mime sniffing, and integrate it with the file loader. 2015-04-06 20:19:30 -04:00
Jag Talon
f9817da0c4 net/storage_task.rs: Fix remove_item
Use `and_then` and remove `unwrap` instead of using a `map` as described in https://github.com/servo/servo/issues/5548#issuecomment-90254644.
2015-04-06 19:47:20 -04:00
Josh Matthews
2d730f2ae9 Remove the sniffer task. 2015-04-06 19:31:53 -04:00
Nathan Climer
44930b0fb0 Implement MIME sniffing. 2015-04-06 19:01:59 -04:00
Gilles Leblanc
ba36a108c1 Split out shared networking code into net_traits crate
Fixes #4476
2015-04-03 13:38:10 -04:00
Matt McCoy
818f1c5748 Closes #2587 Adding HTTP compression capability 2015-04-01 21:18:47 -04:00
snf
1cc5bd4287 broadcasting storage changes events 2015-03-31 21:51:41 +01:00
Adenilson Cavalcanti
cdebb3ca54 Load a placeholder when a url to an image is broken.
I decided to use the old Netscape broken image link icon (later we may
replace the image asset for something more trendier). The ref test will
expect that a failed load should display the rippy image.

ImageCacheTask users can define if a placeholder image should be loaded
at start up or not. This enables both the new behavior (e.g. always
return an image even for broken urls) as also the previous one.
2015-03-30 10:02:54 -07:00
Corey Farwell
679dd679a7 Improve and fix default_path cookie algorithm
* Previously, the function returned an owned String, which is not
  necessary, so now it returns a slice
* Steps have now been documented/labeled
* The last step of the algorithm was incorrect; it would only slice the
  path if the "/" was the last character, which is not what the spec
  says. The spec says to slice up until (but not including) the last
  "/". Also added a regression test for this.
2015-03-26 23:44:15 -04:00
Ms2ger
578a909864 Stop using old_io in net tests. 2015-03-26 17:43:13 +01:00
Ms2ger
9aa2696641 Stop using old_path in net. 2015-03-26 08:59:33 +01:00
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
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
be68ea0d81 auto merge of #5328 : aweinstock314/servo/master, r=jdm 2015-03-23 20:36:47 -06:00
Avi Weinstock
cf0657a403 Fixed some deprecation errors in components/net. 2015-03-23 18:28:44 -04:00
bors-servo
0c3615ced1 auto merge of #5312 : frewsxcv/servo/cleanup-view-source, r=jdm
Fixes #5304
2015-03-23 15:42:48 -06:00
Ms2ger
2755ed6c58 Remove allow(missing_copy_implementations) attributes.
This is now the default.
2015-03-23 10:49:44 +01:00
Corey Farwell
2da17b3ce5 Cleanup 'view-source:' conditional
Fixes #5304
2015-03-21 22:04:58 -04:00
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
Ms2ger
2cde68f13f Cleanup resource_task's global_init(). 2015-03-20 21:07:16 +01:00
Simon Sapin
2f6951af0b Fix some warnings in net. 2015-03-18 21:56:31 +01:00
Ms2ger
5f15eb5fbf Upgrade rustc to d3c49d2140fc65e8bb7d7cf25bfe74dda6ce5ecf/rustc-1.0.0-dev. 2015-03-18 13:18:31 -04:00
bors-servo
7bd6cb0091 auto merge of #5219 : doublec/servo/view_source_protocol_and_plain_text, r=jdm
Implements view-source protocol by having a view-source handler, and modifying the content type to be text/plain if that is used. 

Implements text/plain handling. This allows view-source content to display as plain text.

Example usage:

    ./mach run http://cd.pn/x.txt
    ./mach run view-source:http://tinyvid.tv/

This fixes issue #4181. Issue #3649 includes "support text/plain" so this possibly fixes some of that issue as well.
2015-03-17 07:18:51 -06:00
Chris Double
618142fac7 Implement displaying of text/plain documents
This is done by detecting the content type as text/plain
and following the requirements from:
https://html.spec.whatwg.org/multipage/browsers.html#read-text
2015-03-17 18:11:33 +13:00
Chris Double
82c52a7a1c Implement view-source protocol. Fixes #4181.
This follows the recommendation from issue #4181. A handler
for 'view-source' delegates to the HTTP loader. In that
loader I check for view-source, adjust the URL to be the
URL to be viewed and modify the Content-Type header to be
text/plain.

This doesn't actually result in the source being
viewed as rendering text/plain is not yet implemented.
2015-03-17 11:06:44 +13:00
bors-servo
b8e87ea020 auto merge of #5217 : zslayton/servo/master, r=jdm
@jdm This initial version has a few outstanding issues that I wanted to invite input on. Specifically:

1. I had some difficulty finding a home for the `StorageType` enum. Structs defined outside of the `script` module don't seem to be able to use the `#[jstraceable]` annotation and the `net` module (where `StorageTask` lives) doesn't have access to `script`. Per Simon Sapin's suggestion, I worked around this temporarily by creating a `TraceableStorageType` stand-in struct that was traceable and which could be translated into a regular `StorageType` when being sent to the `StorageTask`. Unsure of the best way to resolve this hack. Thoughts?

2. Apart from the `Storage` constructor used in `Window::SessionStorage` and the new `Window::LocalStorage`, there's also a method called `Storage::Constructor`. I'm unclear on what (if anything) will actually invoke this, so I'm not sure which variant of `StorageType` to use here. I've temporarily created an `Unknown` variant of `StorageType` as a placeholder.

3. I discovered that the web platform tests directory's localStorage tests. Many of them now pass despite the configured expectation that they fail. However, several do not pass. Is there a good way for me to add debug logging or otherwise get a sense of which assertion failed / what went wrong?

Thanks for your continued help!
2015-03-16 14:48:51 -06:00
Zack Slayton
323baf92db localStorage shim, fixes #5195 2015-03-16 13:33:55 -07:00
bors-servo
389338c28f auto merge of #5212 : Manishearth/servo/ssl-off, r=larsbergstrom
SSL is broken-ish (eg tw.yahoo.com, html.spec.whatwg.org don't work since we don't verify SAN properly), this flag can let devs bypass the protection for testing purposes.
2015-03-14 08:39:48 -06:00
Manish Goregaokar
9119bb2041 Add --no-ssl flag for bypassing SSL checking 2015-03-14 19:17:07 +05:30
hirschenberger
ab4b34d423 Fix #5176 by premultiplying the alpha channel to the color channels
This is GIF specific. It's also done when the image is PNG but PNG is
handled separately with the PNG crate, whereas GIFs are handled by the
stb-image crate and the distinction between alpha and non-alpha-supporting
images was missing.
2015-03-11 14:52:16 +01:00
Gilles Leblanc
70aa253a65 Specify regex and regex_macros version numbers
For compatibility with current Rust version.

Issue #5063
2015-03-05 21:09:41 -05:00
Gilles Leblanc
0faa55d2ce Add more robust hostsfile parsing
Adds hostsfile parsing support for:
* Tabs
* Comments (line and end of line)
* IPv4 address validation
* Basic IPv6 address validation
* End of line whitespaces
* Host name alias (multiple host names per address)

Fixes #5063
2015-03-05 20:33:33 -05:00
Ankit Agrawal
c8de895094 Add profiling to image decoding.
This extracts some independently useful parts of
<https://github.com/servo/servo/pull/4215>.
2015-02-28 18:35:48 +01:00
Edit Balint
325400dce4 Implement Canvas pixel manipulation 2015-02-22 13:41:58 -05:00