Commit Graph

129 Commits

Author SHA1 Message Date
Valentin Gosu
a259c95b9b Bug 1447190 - Remove internal mutability from nsStandardURL r=mayhemer
* Removes mSpecEncoding since the spec is always ASCII encoded
* nsStandardURL::InitGlobalObjects is now called from nsNetStartup
* Removes prefObserver from nsStandardURL
* mDisplayHost is now initialized every time that we change the hostname
* Adds locking to the gAllURLs list

MozReview-Commit-ID: 93mwECxYxWl
* * *
[mq]: overfix

MozReview-Commit-ID: 98nyTYa5ZeR
2018-03-22 02:59:32 +01:00
Valentin Gosu
f69f4adf75 Bug 1433609 - Ensure that deserialized URL is correct r=mayhemer
MozReview-Commit-ID: BMQfPzPhDhc
2018-02-14 14:40:05 +01:00
Valentin Gosu
c746fb04ed Bug 1442239 - Make URI deserialization (nsISerializable.read) happen via nsIURIMutator only r=mayhemer
* Deserialization now only happens via a mutator
* The CID for URI implementations actually returns the nsIURIMutator for each class
* The QueryInterface of mutators implementing nsISerializable will now act as a finalizer if passed the IID of an interface implemented by the URI it holds

MozReview-Commit-ID: H5MUJOEkpia
2018-03-19 20:22:32 +01:00
Andreea Pavel
d73ab14f2d Backed out 2 changesets (bug 1442239) for xpcshell failures at widget/tests/unit/test_taskbar_jumplistitems.js on a CLOSED TREE
Backed out changeset 513cd669aca1 (bug 1442239)
Backed out changeset aef4c73f736f (bug 1442239)
2018-03-19 21:19:26 +02:00
Valentin Gosu
17b4bb266e Bug 1442239 - Make URI deserialization (nsISerializable.read) happen via nsIURIMutator only r=mayhemer
* Deserialization now only happens via a mutator
* The CID for URI implementations actually returns the nsIURIMutator for each class
* The QueryInterface of mutators implementing nsISerializable will now act as a finalizer if passed the IID of an interface implemented by the URI it holds

MozReview-Commit-ID: H5MUJOEkpia
2018-03-08 13:35:10 +01:00
Valentin Gosu
3a4f98a41d Bug 1434163 - Make all nsIURI attributes readonly r=mayhemer
MozReview-Commit-ID: KtjO8VWjPF5
2018-02-27 00:07:48 +01:00
Valentin Gosu
717fe64f73 Bug 1434766 - Make nsIFileURL attributes readonly r=mayhemer
MozReview-Commit-ID: AN5EzyuuKuJ
2018-02-26 05:24:09 +01:00
arthur.iakab
fcf300a2b9 Backed out changeset 56336c4873fe (bug 1434766) for build bustages on a CLOSED TREE 2018-02-27 17:14:15 +02:00
Valentin Gosu
f36d503dc2 Bug 1434766 - Make nsIFileURL attributes readonly r=mayhemer
MozReview-Commit-ID: AN5EzyuuKuJ
2018-02-26 05:24:09 +01:00
Valentin Gosu
75f40b01e3 Bug 1433958 - If setting the host succeeds, SetHostPort should not return an error code r=mayhemer
WebPlatformTests expect that when calling
url.host = "host:" // port missing
url.host = "host:65536" // port too big
url.host = "host:bla" // invalid port
that the hostname will be set, but the port will be left unchanged.
Since DOM APIs are the only consumers for SetHostPort it means we can change this behaviour to match the WPT expectations.
As such, SetHostPort will return NS_OK if setting the host succeded, and will ignore if setting the port failed.

MozReview-Commit-ID: LoMw8hCWlCv
2018-02-26 20:43:47 +01:00
Valentin Gosu
33e8c8506b Bug 1433958 - Don't fail when setting an empty password if the username is already empty r=mayhemer
We normally fail in nsStandardURL::SetPassword if the username is empty.
But if the password we are trying to set is also empty, we should't really fail.

MozReview-Commit-ID: FIDqkPrb1gp
2018-02-26 20:43:46 +01:00
Valentin Gosu
029005aa59 Bug 1432519 - Make nsIURL attributes readonly r=mayhemer
MozReview-Commit-ID: KuPILT7rX6N
2018-01-31 03:06:58 +01:00
Valentin Gosu
816da28cc9 Bug 1432257 - Remove nsIStandardURL setter methods r=mayhemer
* Removes nsIStandardURL.{init,setDefaultPort} as these have been migrated to nsIStandardURLMutator

MozReview-Commit-ID: 7JPZmyEr65h
2018-01-22 20:20:18 +01:00
Valentin Gosu
08ac407145 Bug 1432602 - Add nsIFileURLMutator.setFile() r=mayhemer
MozReview-Commit-ID: EF2vVYoN8bg
2018-01-31 22:40:45 +01:00
Valentin Gosu
b12cf0ab61 Bug 1432320 - (Part 1) Add nsIURLMutator r=mayhemer
MozReview-Commit-ID: 8GYru46kFQE
2018-01-31 02:32:27 +01:00
Masatoshi Kimura
c3d2ca2e93 Bug 685236 - Stop using GetNativePath in netwerk/. r=mayhemer
MozReview-Commit-ID: JdHhXPiS0fv
2017-12-15 20:21:19 +09:00
Valentin Gosu
16de685069 Bug 1432187 - Add nsIStandardURLMutator interface r=mayhemer
MozReview-Commit-ID: 4IbdO2gMwox
2018-01-23 23:13:04 +01:00
Valentin Gosu
03778dac03 Bug 1431204 - Make nsIURI.spec readonly r=mayhemer
MozReview-Commit-ID: 1l1CBUotIPh
2018-01-19 15:26:07 +01:00
Masatoshi Kimura
c849bf1753 Bug 1427023 - Remove nsCRT::strncmp. r=erahm 2018-01-09 23:49:37 +09:00
shindli
3340ae0835 Backed out 2 changesets (bug 1420954) for build failure in /builds/worker/workspace/build/src/obj-firefox/dist/include/nsIURIMutator.h:340:3: r=backout on a CLOSED TREE
Backed out changeset 8ce0a0d49d9e (bug 1420954)
Backed out changeset 480c6e1721e9 (bug 1420954)
2017-12-03 01:10:14 +02:00
Valentin Gosu
b407c6fb4d Bug 1420954 - Add NS_MutateURI helper function to chain nsIURIMutator setters in C++ r=bagder
MozReview-Commit-ID: 79NlOm08ebz
2017-12-02 23:15:55 +01:00
Valentin Gosu
30ecd962e7 Bug 1415205 - Add nsIURIMutator impls for all objects implementing nsIURI r=bagder
This also changes URIUtils.cpp:DeserializeURI() to use the mutator to instantiate new URIs, instead of using their default constructor.

MozReview-Commit-ID: JQOvIquuQAP
2017-11-20 17:11:30 +01:00
Chris Peterson
53e4b50e41 Bug 1416164 - Replace NS_NOTYETIMPLEMENTED with MOZ_ASSERT_UNREACHABLE. r=froydnj
MozReview-Commit-ID: B5TZB3v52wY
2017-10-25 00:37:02 -07:00
Valentin Gosu
efea7b69c7 Bug 1415206 - Remove RustURL from Gecko r=bagder
This class isn't being used right now, and MozURL is a much better alternative if interaction with rust URLs is required.

MozReview-Commit-ID: ADdYRrrTnr6
2017-11-07 17:11:08 +01:00
Nicholas Nethercote
29b25cc007 Bug 1409598 - Change nsIXPCScriptable::className and nsIClassInfo::{contractID,classDescription} from string to AUTF8String. r=froydnj.
This lets us replace moz_xstrdup() of string literals with AssignLiteral(),
among other improvements.
2017-10-18 13:17:26 +11:00
Chris Peterson
99957af4ec Bug 1402666 - Part 1: Replace Replace("") with ReplaceLiteral(""). r=erahm
MozReview-Commit-ID: s2hrTSkBiJ
2017-09-15 19:22:58 -07:00
Valentin Gosu
bc7d16e493 Bug 1380617 - Add nsIURI.displayPrePath r=mcmanus,Gijs
- Use displayPrePath in the pageInfo permissions that shows "Permissions for:"
- The extra displayPrePath method is necessary because it's difficult to compute it manually, as opposed to not having a displaySpecWithoutRef - as it's easy to get that by truncating displaySpec at the first '#' symbol.

MozReview-Commit-ID: 9RM5kQ2OqfC
2017-08-09 17:43:58 +02:00
Masatoshi Kimura
a9e30eaec8 Bug 1322874 - Get rid of nsIURI.originCharset. r=valentin.gosu
nsIURI.originCharset had two use cases:
 1) Dealing with the spec-incompliant feature of escapes in the hash
    (reference) part of the URL.
 2) For UI display of non-UTF-8 URLs.

For hash part handling, we use the document charset instead. For pretty
display of query strings on legacy-encoded pages, we no longer care to them
(see bug 817374 comment 18).

Also, the URL Standard has no concept of "origin charset". This patch
removes nsIURI.originCharset for reducing complexity and spec compliance.

MozReview-Commit-ID: 3tHd0VCWSqF
2017-08-02 20:43:30 +09:00
Masatoshi Kimura
c0943e4f30 Bug 1326520 - Rename nsIURI.path to pathQueryRef. r=valentin.gosu
MozReview-Commit-ID: DqJdTGopR9G
2017-07-29 20:50:21 +09:00
Valentin Gosu
d95286b8e0 Bug 1386195 - mDisplayHost must be initalized even when host does not start with xn-- r=dragana
MozReview-Commit-ID: HnDqw8oyE2r
2017-08-01 14:24:53 +03:00
Valentin Gosu
35a11dc6d4 Bug 1385883 - nsStandardURL - make sure we always check if the host is ascii r=jduell
SetRef and several other methods call InvalidateCache, which in turn sets mCheckedIfHostA to false.
That means that each time before trying to access mDisplayHost we need to make sure it is properly initalized.

MozReview-Commit-ID: Agtsy6Lx7Nb
2017-08-01 01:51:48 +03:00
Catalin Badea
67d3db74ab Bug 1344751 - Make nsStandardURL and nsIDNService available on worker threads. r=valentin 2017-07-13 12:17:19 +01:00
Valentin Gosu
34af3ba11a Bug 945240 - Add a pref to be able to restore previous behaviour where nsIURI.host/.spec returned unicode instead of punycode r=mcmanus
This is to deal with possible bugs or web-compat issues that may arrise.
Also fixes GetDisplayHostPort which would not return the correct brackets for IPv6 addresses

MozReview-Commit-ID: 3OfiBDND5Cs
* * *
[mq]: fix_ipv6_hostport.patch

MozReview-Commit-ID: 3VYCwlt7IGT
2017-07-11 19:10:10 +02:00
Valentin Gosu
efa71e2ddb Bug 945240 - Make nsIURI.host & variants return ASCII strings r=mcmanus
* nsStandardURL::GetHost/GetHostPort/GetSpec contain an punycode encoded hostname.
* Added nsIURI::GetDisplayHost/GetDisplayHostPort/GetDisplaySpec which have unicode hostnames, depending on the hostname, character blacklist and the network.IDN_show_punycode pref
* remove mHostEncoding since it's not needed anymore (the hostname is always ASCII encoded)
* Add mCheckedIfHostA to know when GetDisplayHost can return the regular host, or when we need to use the cached mDisplayHost

MozReview-Commit-ID: 4qV9Ynhr2Jl
* * *
Bug 945240 - Make sure nsIURI.specIgnoringRef/.getSensitiveInfoHiddenSpec/.prePath contain unicode hosts when network.standard-url.punycode-host is set to false r=mcmanus

MozReview-Commit-ID: F6bZuHOWEsj
2017-07-11 19:09:10 +02:00
Sylvestre Ledru
9d4a84d778 Bug 1378712 - Remove all trailing whitespaces r=Ehsan
MozReview-Commit-ID: Kdz2xtTF9EG
2017-07-06 14:00:35 +02:00
Nicholas Nethercote
4ce1e9c11f Bug 1374580 (part 3) - Remove ns{,C}Substring typedefs. r=froydnj.
All the instances are converted as follows.

- nsSubstring  --> nsAString
- nsCSubstring --> nsACString
2017-06-20 19:19:52 +10:00
Nicholas Nethercote
4cbdad69e6 Bug 1374580 (part 2) - Remove nsAFlat{,C}String typedefs. r=froydnj.
All the instances are converted as follows.

- nsAFlatString  --> nsString
- nsAFlatCString --> nsCString
2017-06-20 19:19:05 +10:00
Nicholas Nethercote
8bdcb2343a Bug 1374580 (part 1) - Remove nsASingleFragment{,C}String typedefs. r=froydnj.
All the instances are converted as follows.

- nsASingleFragmentString  --> nsAString
- nsASingleFragmentCString --> nsACString
2017-06-20 19:18:17 +10:00
Henri Sivonen
7af0452b6b Bug 1261841 part 2 - Use encoding_rs instead of uconv. r=emk,mystor.
MozReview-Commit-ID: 15Y5GTX98bv
2017-06-13 13:23:23 +03:00
Milan Sreckovic
165feb045f Bug 1358225: Validate characters with a cached lookup array. About 10-15% improvement on TestStandardURL.Perf gtest. r=valentin.gosu
MozReview-Commit-ID: KMABJ3X6IZ1
2017-05-15 11:53:40 -04:00
Milan Sreckovic
944bf0d6b9 Bug 1304605: Part 2. Optimizing NormalizeIPv4. Seems to be 4-6x faster. r=valentin.gosu
MozReview-Commit-ID: FjkNmbW5I93
2017-04-26 12:02:58 -04:00
Milan Sreckovic
da61522450 Bug 1304605: Part 1. Unit tests, including performance, for NormalizeIPv4. r=valentin.gosu
MozReview-Commit-ID: KAecFlYTUfW
2017-04-26 11:56:16 -04:00
dOn'tReallycAre
f20686dbe9 Bug 1357155 - Convert PRCList usage in nsStandardURL to LinkedList. r=erahm 2017-04-21 01:46:12 +09:00
Valentin Gosu
20b6a7013f Bug 1326175 - Stop preserving empty passwords in URLs r=mcmanus
MozReview-Commit-ID: 7wdZSJmpErF
2017-03-27 23:56:28 +02:00
Valentin Gosu
029e26bc91 Bug 1342438 - Remove url .hash encoding/decoding prefs r=bagder
These prefs have been added close to two years ago:
dom.url.encode_decode_hash and dom.url.getters_decode_hash
The main reason for their existence was in case we encounter any web-compat issues. At this point the extra code is mostly useless, and flipping the pref may lead to crashes.

MozReview-Commit-ID: LhAHkYmv0TR
2017-03-08 22:19:34 +01:00
Valentin Gosu
d658c247ea Bug 1324243 - Normalize IPv6 r=manishearth
MozReview-Commit-ID: 1UFIdeWrz1E
2017-03-09 00:55:05 +01:00
Carsten "Tomcat" Book
ef29ab69a8 Backed out changeset 189b914221f4 (bug 1324243) for wpt-11 bustage 2017-03-06 14:13:03 +01:00
Valentin Gosu
754adfd0d5 Bug 1324243 - Normalize IPv6 r=manishearth
MozReview-Commit-ID: Kxe9eLqvKp6
2017-03-01 00:01:15 +01:00
Eric Rahm
56140bb9f9 Bug 1332202 - Followup to fix comment to say infallible. DONTBUILD r=me
MozReview-Commit-ID: ByRWrv7nGnM
2017-02-16 11:52:54 -08:00
Junior Hsu
ae3461bdbe Bug 1338154 - not normalize ipv4 for resource and chrome uri. r=valentin 2017-02-13 03:10:00 +08:00