Closed
Bug 1419657
Opened 7 years ago
Closed 7 years ago
Port bug 1415205 |Add add mutate() to nsIURI| to mailnews
Categories
(MailNews Core :: Backend, enhancement)
MailNews Core
Backend
Tracking
(Not tracked)
RESOLVED
FIXED
Thunderbird 59.0
People
(Reporter: jorgk-bmo, Assigned: jorgk-bmo)
Details
Attachments
(1 file, 4 obsolete files)
10.31 KB,
patch
|
aceman
:
review+
|
Details | Diff | Splinter Review |
We're busted with 4 unresolved externals:
nsLDAPURL::Mutate()
nsAddbookUrl::Mutate()
nsMsgMailNewsUrl::Mutate()
nsMailtoUrl::Mutate()
Examples here:
https://hg.mozilla.org/mozilla-central/rev/306f999b79a5
Assignee | ||
Comment 1•7 years ago
|
||
Looks like the boilerplate is this:
C++ file:
+#include "nsIURIMutator.h" // Required, see below.
+NS_IMPL_ISUPPORTS(nsSimpleURI::Mutator, nsIURISetters, nsIURIMutator)
+
+
+NS_IMETHODIMP
+nsSimpleURI::Mutate(nsIURIMutator** aMutator)
+{
+ RefPtr<nsSimpleURI::Mutator> mutator = new XXX::Mutator(); // XXX URI class
+ nsresult rv = mutator->InitFromURI(this);
+ if (NS_FAILED(rv)) {
+ return rv;
+ }
+ mutator.forget(aMutator);
+ return NS_OK;
+}
+
Include file:
+#include "nsIURIMutator.h"
+
+
+public:
+ class Mutator
+ : public nsIURIMutator
+ , public BaseURIMutator<XXX>
+ {
+ NS_DECL_ISUPPORTS
+ NS_FORWARD_SAFE_NSIURISETTERS(mURI)
+ NS_DEFINE_NSIMUTATOR_COMMON
+
+ explicit Mutator() { }
+ private:
+ virtual ~Mutator() { }
+
+ friend class XXX;
+ };
Assignee | ||
Updated•7 years ago
|
Summary: Port |Add add mutate() to nsIURI| to mailnews → Port bug 1415205 |Add add mutate() to nsIURI| to mailnews
Assignee | ||
Comment 2•7 years ago
|
||
Something like this. If this works, compile needs to finish, I'll repeat three times.
Assignee: nobody → jorgk
Status: NEW → ASSIGNED
Assignee | ||
Comment 3•7 years ago
|
||
Fixed copy/paste errors.
Attachment #8930814 -
Attachment is obsolete: true
Assignee | ||
Comment 4•7 years ago
|
||
This is the closest I can get to compiling trying to follow the boilerplate.
Valentin, can you please help me out here.
I still get:
0:09.39 c:\mozilla-source\comm-central\obj-i686-pc-mingw32\dist\include\nsIURIMutator.h(61): error C2039: 'Deserialize': is not a member of 'nsMsgMailNewsUrl'
0:09.39 c:\mozilla-source\comm-central\mailnews\base\util\nsMsgMailNewsUrl.h(41): note: see declaration of 'nsMsgMailNewsUrl'
0:09.39 c:\mozilla-source\comm-central\obj-i686-pc-mingw32\dist\include\nsIURIMutator.h(59): note: while compiling class template member function 'nsresult BaseURIMutator<nsMsgMailNewsUrl>::InitFromIPCParams(const mozilla::ipc::URIParams &)'
0:09.39 c:\mozilla-source\comm-central\mailnews\base\util\nsMsgMailNewsUrl.h(60): note: see reference to function template instantiation 'nsresult BaseURIMutator<nsMsgMailNewsUrl>::InitFromIPCParams(const mozilla::ipc::URIParams &)' being compiled
0:09.39 c:\mozilla-source\comm-central\mailnews\base\util\nsMsgMailNewsUrl.h(57): note: see reference to class template instantiation 'BaseURIMutator<nsMsgMailNewsUrl>' being compiled
0:09.39 c:/mozilla-source/comm-central/mozilla/config/rules.mk:1028: recipe for target 'nsMsgMailNewsUrl.obj' failed
Attachment #8930816 -
Attachment is obsolete: true
Flags: needinfo?(valentin.gosu)
Assignee | ||
Comment 5•7 years ago
|
||
Assignee | ||
Comment 6•7 years ago
|
||
Adding NI for Daniel since this is pretty urgent.
Severity: normal → blocker
Flags: needinfo?(daniel)
Comment 7•7 years ago
|
||
Since nsMsgMailNewsUrl doesn't seem to implement nsIIPCSerializableURI then you must make Deserialize return NS_ERROR_NOT_IMPLEMENTED. See https://hg.mozilla.org/mozilla-central/diff/306f999b79a5/caps/NullPrincipalURI.h for an example of how the header would look.
Flags: needinfo?(valentin.gosu)
Flags: needinfo?(daniel)
Assignee | ||
Comment 8•7 years ago
|
||
This compiles and fixes the link errors for two of the four classes I need to do.
What about the other methods: Read(), SetSpec(). Should they return NS_ERROR_NOT_IMPLEMENTED as shown?
Attachment #8930828 -
Attachment is obsolete: true
Attachment #8930869 -
Flags: feedback?(valentin.gosu)
Comment 9•7 years ago
|
||
Comment on attachment 8930869 [details] [diff] [review]
1419657-nsIURI-mutate.patch (v2) - WIP
Review of attachment 8930869 [details] [diff] [review]:
-----------------------------------------------------------------
Read() is fine as it is, as long as the URL class doesn't implement nsISerializable (it seems it doesn't).
::: mailnews/addrbook/src/nsAddbookUrl.h
@@ +46,5 @@
> + }
> +
> + NS_IMETHOD SetSpec(const nsACString & aSpec) override
> + {
> + return NS_ERROR_NOT_IMPLEMENTED;
This should return InitFromSpec(aSpec)
::: mailnews/base/util/nsMsgMailNewsUrl.h
@@ +75,5 @@
> + }
> +
> + NS_IMETHOD SetSpec(const nsACString & aSpec) override
> + {
> + return NS_ERROR_NOT_IMPLEMENTED;
this should return InitFromSpec(aSpec).
Attachment #8930869 -
Flags: feedback?(valentin.gosu) → feedback+
Assignee | ||
Comment 10•7 years ago
|
||
Thanks Valentin, this should be it then.
Attachment #8930869 -
Attachment is obsolete: true
Attachment #8930966 -
Flags: review?(acelists)
Comment 11•7 years ago
|
||
Pushed by mozilla@jorgk.com:
https://hg.mozilla.org/comm-central/rev/ae04ad2124c2
Port bug 1415205 to mailnews: Add add Mutate() to four mailnews URLs. rs=bustage-fix CLOSED TREE
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Assignee | ||
Updated•7 years ago
|
Target Milestone: --- → Thunderbird 59.0
Assignee | ||
Comment 12•7 years ago
|
||
Looking at the patch now, I see that the indentation is mostly wrong :-(
Comment 13•7 years ago
|
||
Pushed by mozilla@jorgk.com:
https://hg.mozilla.org/comm-central/rev/3eb4ce879dc9
Follow-up: Fix incorrect indentation. rs=white-space-only DONTBUILD
![]() |
||
Comment 14•7 years ago
|
||
Comment on attachment 8930966 [details] [diff] [review]
1419657-nsIURI-mutate.patch (v3)
Review of attachment 8930966 [details] [diff] [review]:
-----------------------------------------------------------------
Thanks. Yes, the 3-spaces indents are strange.
Attachment #8930966 -
Flags: review?(acelists) → review+
Assignee | ||
Comment 15•7 years ago
|
||
Where do you see three? I think I did multiples of two too much which I've removed in the follow up. Is it still not right?
![]() |
||
Comment 16•7 years ago
|
||
Yeah, 4 spaces. I shouldn't read deep at night:) And I think you fixed them in the second patch.
Assignee | ||
Updated•7 years ago
|
Whiteboard: [PLR]
You need to log in
before you can comment on or make changes to this bug.
Description
•