Closed
Bug 1436589
Opened 7 years ago
Closed 7 years ago
Use nsIFileURLMutator::SetFile in nsWebBrowserPersist.cpp
Categories
(Core :: Networking, enhancement, P3)
Core
Networking
Tracking
()
RESOLVED
FIXED
mozilla60
Tracking | Status | |
---|---|---|
firefox60 | --- | fixed |
People
(Reporter: valentin, Assigned: valentin)
References
Details
(Whiteboard: [necko-triaged])
Attachments
(1 file)
It seems merely changing the code to use a mutator breaks web page saving.
This requires a unit test too.
Comment hidden (mozreview-request) |
Comment 2•7 years ago
|
||
mozreview-review |
Comment on attachment 8953904 [details]
Bug 1436589 - Use nsIFileURLMutator::SetFile in nsWebBrowserPersist.cpp
https://reviewboard.mozilla.org/r/223054/#review229016
::: dom/webbrowserpersist/nsWebBrowserPersist.cpp:877
(Diff revision 1)
> data->mFile = uniqueFilenameURI;
> }
> +
> + // The URIData entry is pointing to the old unfixed URI, so we need
> + // to update it.
> + nsAutoCString spec;
move this near GetSpec()
Attachment #8953904 -
Flags: review?(amarchesini) → review+
Comment 3•7 years ago
|
||
mozreview-review |
Comment on attachment 8953904 [details]
Bug 1436589 - Use nsIFileURLMutator::SetFile in nsWebBrowserPersist.cpp
https://reviewboard.mozilla.org/r/223054/#review229112
::: dom/webbrowserpersist/nsWebBrowserPersist.cpp:862
(Diff revision 1)
>
> if (data->mCalcFileExt && !(mPersistFlags & PERSIST_FLAGS_DONT_CHANGE_FILENAMES))
> {
> nsCOMPtr<nsIURI> uriWithExt;
> // this is the first point at which the server can tell us the mimetype
> +
X
::: dom/webbrowserpersist/nsWebBrowserPersist.cpp:2136
(Diff revision 1)
> - nsresult rv;
> - nsCOMPtr<nsIFileURL> fileURL = do_QueryInterface(aURI, &rv);
> - NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE);
> - fileURL->SetFile(localFile); // this should recalculate uri
> + return NS_MutateURI(aURI)
> + .Apply(NS_MutatorMethod(&nsIFileURLMutator::SetFile,
> + localFile))
> + .Finalize(aOutURI);
> }
> else
else after return
::: dom/webbrowserpersist/nsWebBrowserPersist.cpp:2314
(Diff revision 1)
> - nsCOMPtr<nsIFileURL> fileURL = do_QueryInterface(aURI, &rv);
> - NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE);
> - fileURL->SetFile(localFile); // this should recalculate uri
> + return NS_MutateURI(url)
> + .Apply(NS_MutatorMethod(&nsIFileURLMutator::SetFile,
> + localFile))
> + .Finalize(aOutURI);
> }
> else
else after return
Attachment #8953904 -
Flags: review?(honzab.moz) → review+
Comment hidden (mozreview-request) |
Pushed by valentin.gosu@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/2fa454395a88
Use nsIFileURLMutator::SetFile in nsWebBrowserPersist.cpp r=baku,mayhemer
Comment 6•7 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla60
You need to log in
before you can comment on or make changes to this bug.
Description
•