Closed
Bug 1415205
Opened 7 years ago
Closed 7 years ago
Add add mutate() to nsIURI
Categories
(Core :: Networking, enhancement, P2)
Core
Networking
Tracking
()
RESOLVED
FIXED
mozilla59
Tracking | Status | |
---|---|---|
firefox59 | --- | fixed |
People
(Reporter: valentin, Assigned: valentin)
References
Details
(Whiteboard: [necko-triaged])
Attachments
(2 files)
Part of making nsIURI implementations immutable, we need to remove the setters.
To achieve this, we will first add nsIURI.mutate() that returns a mutator.
The mutator will have all the appropriate setters (while not implementing nsIURI, to prevent it from being passed to others).
Calling finalize() on the mutator will return a new (immutable) nsIURI.
After this pattern is adopted we can remove the setters from nsIURI (separate bug)
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment 3•7 years ago
|
||
mozreview-review |
Comment on attachment 8929418 [details]
Bug 1415205 - Add nsIURIMutator impls for all objects implementing nsIURI
https://reviewboard.mozilla.org/r/200746/#review205960
C/C++ static analysis found 1 defect in this patch.
You can run this analysis locally with: `./mach static-analysis check path/to/file.cpp`
::: ipc/glue/URIUtils.cpp:128
(Diff revision 1)
> MOZ_ASSERT(false, "Deserialize failed!");
> return nullptr;
> }
>
> - nsCOMPtr<nsIURI> uri = do_QueryInterface(serializable);
> + nsCOMPtr<nsIURI> uri;
> + rv = mutator->Finalize(getter_AddRefs(uri));
Warning: Value stored to 'rv' is never read [clang-tidy: clang-analyzer-deadcode.DeadStores]
Comment 4•7 years ago
|
||
mozreview-review |
Comment on attachment 8929417 [details]
Bug 1415205 - Add nsIURIMutator interface and nsIURI.mutate()
https://reviewboard.mozilla.org/r/200744/#review206016
Attachment #8929417 -
Flags: review?(daniel) → review+
Comment 5•7 years ago
|
||
mozreview-review |
Comment on attachment 8929418 [details]
Bug 1415205 - Add nsIURIMutator impls for all objects implementing nsIURI
https://reviewboard.mozilla.org/r/200746/#review206332
LGTM!
::: ipc/glue/URIUtils.cpp:128
(Diff revision 1)
> MOZ_ASSERT(false, "Deserialize failed!");
> return nullptr;
> }
>
> - nsCOMPtr<nsIURI> uri = do_QueryInterface(serializable);
> + nsCOMPtr<nsIURI> uri;
> + rv = mutator->Finalize(getter_AddRefs(uri));
clang warns about this 'rv' is not used!
Attachment #8929418 -
Flags: review?(daniel) → review+
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Pushed by valentin.gosu@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/a6339ec0511b
Add nsIURIMutator interface and nsIURI.mutate() r=bagder
https://hg.mozilla.org/integration/autoland/rev/306f999b79a5
Add nsIURIMutator impls for all objects implementing nsIURI r=bagder
Comment 9•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/a6339ec0511b
https://hg.mozilla.org/mozilla-central/rev/306f999b79a5
Status: NEW → RESOLVED
Closed: 7 years ago
status-firefox59:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla59
Updated•7 years ago
|
status-firefox58:
affected → ---
You need to log in
before you can comment on or make changes to this bug.
Description
•