Closed
Bug 1318428
Opened 8 years ago
Closed 8 years ago
Use nsstring bindings in rust-url-capi
Categories
(Core :: Networking, defect)
Core
Networking
Tracking
()
RESOLVED
FIXED
mozilla53
Tracking | Status | |
---|---|---|
firefox53 | --- | fixed |
People
(Reporter: manishearth, Assigned: nika)
References
Details
(Whiteboard: [necko-active])
Attachments
(1 file)
34.83 KB,
patch
|
valentin
:
review+
manishearth
:
review+
|
Details | Diff | Splinter Review |
We should use Michael's nsstring bindings in rust-url-capi instead of the c_fn_get_buffer stuff.
Assignee | ||
Comment 1•8 years ago
|
||
This patch also drops the pretense that rust-url-capi will be used from
outside of c++, or that it will be used outside of mozilla-central,
removing the ifdef __cplusplus code, and including the C++ header
"nsString.h".
MozReview-Commit-ID: BULhHf3DObe
Attachment #8812790 -
Flags: review?(valentin.gosu)
Assignee | ||
Updated•8 years ago
|
Assignee: nobody → michael
Assignee | ||
Updated•8 years ago
|
Attachment #8812790 -
Flags: review?(manishearth)
Reporter | ||
Comment 2•8 years ago
|
||
Comment on attachment 8812790 [details] [diff] [review]
Use the nsstring bindings in rust-url-capi
Review of attachment 8812790 [details] [diff] [review]:
-----------------------------------------------------------------
LGTM. Needs peer review to land.
Have you tested it with network logging to see if it's still largely working? It shouldn't complain about mismatches on regular sites but will complain with malformed IDNA like https://github.com/servo/rust-url/issues/207
Attachment #8812790 -
Flags: review?(manishearth) → review+
Comment 3•8 years ago
|
||
Comment on attachment 8812790 [details] [diff] [review]
Use the nsstring bindings in rust-url-capi
Review of attachment 8812790 [details] [diff] [review]:
-----------------------------------------------------------------
Looks good to me. Please do a try run before pushing.
::: netwerk/base/rust-url-capi/src/lib.rs
@@ +70,4 @@
> if urlptr.is_null() {
> return NSError::InvalidArg.error_code();
> }
> + let url = &*(urlptr as *const Url);
Is there an advantage to using this syntax instead of let url: &Url = mem::transmute(urlptr); ?
Attachment #8812790 -
Flags: review?(valentin.gosu) → review+
Reporter | ||
Comment 4•8 years ago
|
||
> Is there an advantage to using this syntax instead of let url: &Url = mem::transmute(urlptr); ?
Generally good style to avoid transmuting when you can do it a different way. Transmutes are a swiss army knife, and just as pointy -- if the type of the argument changed here you may end up transmuting the wrong thing, whereas you'd be protected from that to some degree with this.
Updated•8 years ago
|
Whiteboard: [necko-active]
Pushed by michael@thelayzells.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/bd1c7797c866
Use the nsstring bindings in rust-url-capi, r=valentin
Comment 6•8 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox53:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla53
You need to log in
before you can comment on or make changes to this bug.
Description
•