diff --git a/dom/public/idl/base/nsIDOMWindowInternal.idl b/dom/public/idl/base/nsIDOMWindowInternal.idl index c4f1021d534..c14e20e7169 100644 --- a/dom/public/idl/base/nsIDOMWindowInternal.idl +++ b/dom/public/idl/base/nsIDOMWindowInternal.idl @@ -44,13 +44,6 @@ interface nsIControllers; interface nsIDOMLocation; interface nsIVariant; -%{C++ -/* I hate you, Windows. */ -#ifdef PostMessage -#undef PostMessage -#endif -%} - [scriptable, uuid(86f7b733-aff9-469a-9e8c-2996f7db2720)] interface nsIDOMWindowInternal : nsIDOMWindow2 { @@ -221,5 +214,5 @@ interface nsIDOMWindowInternal : nsIDOMWindow2 * * See the WHATWG HTML5 specification, section 6.4, for more details. */ - void postMessage(in DOMString message); + [binaryname(PostMessageMoz)] void postMessage(in DOMString message); }; diff --git a/dom/src/base/nsGlobalWindow.cpp b/dom/src/base/nsGlobalWindow.cpp index e17612c3307..3cd3708f1dc 100644 --- a/dom/src/base/nsGlobalWindow.cpp +++ b/dom/src/base/nsGlobalWindow.cpp @@ -5046,15 +5046,10 @@ nsGlobalWindow::CallerInnerWindow() return static_cast(win.get()); } -/* I hate you, Windows. */ -#ifdef PostMessage -#undef PostMessage -#endif - NS_IMETHODIMP -nsGlobalWindow::PostMessage(const nsAString& aMessage) +nsGlobalWindow::PostMessageMoz(const nsAString& aMessage) { - FORWARD_TO_INNER_CREATE(PostMessage, (aMessage)); + FORWARD_TO_INNER_CREATE(PostMessageMoz, (aMessage)); // // Window.postMessage is an intentional subversion of the same-origin policy. diff --git a/dom/src/base/nsGlobalWindow.h b/dom/src/base/nsGlobalWindow.h index 8517d63b343..ee6537fd3aa 100644 --- a/dom/src/base/nsGlobalWindow.h +++ b/dom/src/base/nsGlobalWindow.h @@ -98,11 +98,6 @@ #include "nsPIDOMEventTarget.h" #include "nsIArray.h" -/* I hate you, Windows. */ -#ifdef PostMessage -#undef PostMessage -#endif - #define DEFAULT_HOME_PAGE "www.mozilla.org" #define PREF_BROWSER_STARTUP_HOMEPAGE "browser.startup.homepage" diff --git a/xpcom/typelib/xpidl/xpidl_header.c b/xpcom/typelib/xpidl/xpidl_header.c index e73cf36f2a6..9d4247ec4c8 100644 --- a/xpcom/typelib/xpidl/xpidl_header.c +++ b/xpcom/typelib/xpidl/xpidl_header.c @@ -733,6 +733,7 @@ write_type(IDL_tree type_tree, gboolean is_out, FILE *outfile) #define ATTR_IDENT(tree) (IDL_IDENT(IDL_LIST(IDL_ATTR_DCL(tree).simple_declarations).data)) #define ATTR_TYPE_DECL(tree) (IDL_ATTR_DCL(tree).param_type_spec) #define ATTR_TYPE(tree) (IDL_NODE_TYPE(ATTR_TYPE_DECL(tree))) +#define ATTR_DECLS(tree) (IDL_LIST(IDL_ATTR_DCL(tree).simple_declarations).data) /* * AS_DECL writes 'NS_IMETHOD foo(string bar, long sil)' @@ -744,15 +745,24 @@ write_attr_accessor(IDL_tree attr_tree, FILE * outfile, gboolean getter, int mode, const char *className) { char *attrname = ATTR_IDENT(attr_tree).str; + const char *binaryname; if (mode == AS_DECL) { fputs("NS_IMETHOD ", outfile); } else if (mode == AS_IMPL) { fprintf(outfile, "NS_IMETHODIMP %s::", className); } - fprintf(outfile, "%cet%c%s(", - getter ? 'G' : 'S', - toupper(*attrname), attrname + 1); + fprintf(outfile, "%cet", + getter ? 'G' : 'S'); + binaryname = IDL_tree_property_get(ATTR_DECLS(attr_tree), "binaryname"); + if (binaryname) { + fprintf(outfile, "%s(", + binaryname); + } else { + fprintf(outfile, "%c%s(", + toupper(*attrname), + attrname + 1); + } if (mode == AS_DECL || mode == AS_IMPL) { /* Setters for string, wstring, nsid, domstring, utf8string, * cstring and astring get const. @@ -1009,6 +1019,7 @@ write_method_signature(IDL_tree method_tree, FILE *outfile, int mode, gboolean op_notxpcom = (IDL_tree_property_get(op->ident, "notxpcom") != NULL); const char *name; + const char *binaryname; IDL_tree iter; if (mode == AS_DECL) { @@ -1035,7 +1046,11 @@ write_method_signature(IDL_tree method_tree, FILE *outfile, int mode, } name = IDL_IDENT(op->ident).str; if (mode == AS_IMPL) { - fprintf(outfile, "%s::%c%s(", className, toupper(*name), name + 1); + fprintf(outfile, "%s::", className); + } + binaryname = IDL_tree_property_get(op->ident, "binaryname"); + if (binaryname) { + fprintf(outfile, "%s(", binaryname); } else { fprintf(outfile, "%c%s(", toupper(*name), name + 1); }