Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit dcd9914

Browse files
committed
Backed out changeset c8fe57b085bd (bug 1333631)
1 parent 835c70f commit dcd9914

4 files changed

Lines changed: 29 additions & 46 deletions

File tree

xpcom/idl-parser/xpidl/header.py

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -385,16 +385,14 @@ def write_method_decl(m):
385385
printComments(fd, m.doccomments, ' ')
386386

387387
fd.write(" /* %s */\n" % m.toIDL())
388-
suffix = " = delete" if m.deleted else " = 0"
389-
fd.write(" %s%s;\n\n" % (methodAsNative(m), suffix))
388+
fd.write(" %s = 0;\n\n" % methodAsNative(m))
390389

391390
def write_attr_decl(a):
392391
printComments(fd, a.doccomments, ' ')
393392

394393
fd.write(" /* %s */\n" % a.toIDL())
395394

396-
suffix = " = delete" if a.deleted else " = 0"
397-
fd.write(" %s%s;\n" % (attributeAsNative(a, True), suffix))
395+
fd.write(" %s = 0;\n" % attributeAsNative(a, True))
398396
if a.infallible:
399397
fd.write(attr_infallible_tmpl %
400398
{'realtype': a.realtype.nativeType('in'),
@@ -403,7 +401,7 @@ def write_attr_decl(a):
403401
'argnames': '' if not a.implicit_jscontext else 'cx, '})
404402

405403
if not a.readonly:
406-
fd.write(" %s%s;\n" % (attributeAsNative(a, False), suffix))
404+
fd.write(" %s = 0;\n" % attributeAsNative(a, False))
407405
fd.write("\n")
408406

409407
defname = iface.name.upper()
@@ -466,15 +464,13 @@ def writeDeclaration(fd, iface, virtual):
466464
suffix = " override" if virtual else ""
467465
for member in iface.members:
468466
if isinstance(member, xpidl.Attribute):
469-
suffix2 = " = delete" if member.deleted else ""
470467
if member.infallible:
471468
fd.write("\\\n using %s::%s; " % (iface.name, attributeNativeName(member, True)))
472-
fd.write("\\\n %s%s%s; " % (attributeAsNative(member, True, declType), suffix, suffix2))
469+
fd.write("\\\n %s%s; " % (attributeAsNative(member, True, declType), suffix))
473470
if not member.readonly:
474-
fd.write("\\\n %s%s%s; " % (attributeAsNative(member, False, declType), suffix, suffix2))
471+
fd.write("\\\n %s%s; " % (attributeAsNative(member, False, declType), suffix))
475472
elif isinstance(member, xpidl.Method):
476-
suffix2 = " = delete" if member.deleted else ""
477-
fd.write("\\\n %s%s%s; " % (methodAsNative(member, declType), suffix, suffix2))
473+
fd.write("\\\n %s%s; " % (methodAsNative(member, declType), suffix))
478474
if len(iface.members) == 0:
479475
fd.write('\\\n /* no methods! */')
480476
elif not member.kind in ('attribute', 'method'):
@@ -485,14 +481,13 @@ def writeDeclaration(fd, iface, virtual):
485481
writeDeclaration(fd, iface, False);
486482
fd.write(iface_forward % names)
487483

488-
def emitTemplate(forward_infallible, tmpl_normal, tmpl_notxpcom=None, tmpl_deleted=None):
484+
def emitTemplate(forward_infallible, tmpl, tmpl_notxpcom=None):
489485
if tmpl_notxpcom is None:
490-
tmpl_notxpcom = tmpl_normal
486+
tmpl_notxpcom = tmpl
491487
for member in iface.members:
492488
if isinstance(member, xpidl.Attribute):
493489
if forward_infallible and member.infallible:
494490
fd.write("\\\n using %s::%s; " % (iface.name, attributeNativeName(member, True)))
495-
tmpl = tmpl_deleted if member.deleted else tmpl_normal
496491
fd.write(tmpl % {'asNative': attributeAsNative(member, True),
497492
'nativeName': attributeNativeName(member, True),
498493
'paramList': attributeParamNames(member)})
@@ -501,7 +496,6 @@ def emitTemplate(forward_infallible, tmpl_normal, tmpl_notxpcom=None, tmpl_delet
501496
'nativeName': attributeNativeName(member, False),
502497
'paramList': attributeParamNames(member)})
503498
elif isinstance(member, xpidl.Method):
504-
tmpl = tmpl_deleted if member.deleted else tmpl_normal
505499
if member.notxpcom:
506500
fd.write(tmpl_notxpcom % {'asNative': methodAsNative(member),
507501
'nativeName': methodNativeName(member),
@@ -516,9 +510,7 @@ def emitTemplate(forward_infallible, tmpl_normal, tmpl_notxpcom=None, tmpl_delet
516510
fd.write('\\')
517511

518512
emitTemplate(True,
519-
"\\\n %(asNative)s override { return _to %(nativeName)s(%(paramList)s); } ",
520-
None,
521-
"\\\n %(asNative)s override = delete; ")
513+
"\\\n %(asNative)s override { return _to %(nativeName)s(%(paramList)s); } ")
522514

523515
fd.write(iface_forward_safe % names)
524516

@@ -527,8 +519,7 @@ def emitTemplate(forward_infallible, tmpl_normal, tmpl_notxpcom=None, tmpl_delet
527519
# implement them.
528520
emitTemplate(False,
529521
"\\\n %(asNative)s override { return !_to ? NS_ERROR_NULL_POINTER : _to->%(nativeName)s(%(paramList)s); } ",
530-
"\\\n %(asNative)s override; ",
531-
"\\\n %(asNative)s override = delete; ")
522+
"\\\n %(asNative)s override; ")
532523

533524
fd.write(iface_template_prolog % names)
534525

xpcom/idl-parser/xpidl/xpidl.py

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
import re
1313
from ply import lex
1414
from ply import yacc
15-
from buildconfig import substs
1615

1716
"""A type conforms to the following pattern:
1817
@@ -717,7 +716,6 @@ class Attribute(object):
717716
binaryname = None
718717
null = None
719718
undefined = None
720-
deleted = False
721719
deprecated = False
722720
infallible = False
723721

@@ -738,14 +736,6 @@ def __init__(self, type, name, attlist, readonly, location, doccomments):
738736
self.binaryname = value
739737
continue
740738

741-
if name == 'deleted':
742-
if value is None:
743-
raise IDLError("deleted attribute requires a value",
744-
aloc)
745-
746-
self.deleted = substs['MOZ_WIDGET_TOOLKIT'] == value
747-
continue
748-
749739
if name == 'Null':
750740
if value is None:
751741
raise IDLError("'Null' attribute requires a value", aloc)
@@ -813,7 +803,7 @@ def toIDL(self):
813803
def isScriptable(self):
814804
if not self.iface.attributes.scriptable:
815805
return False
816-
return not (self.noscript or self.deleted)
806+
return not self.noscript
817807

818808
def __str__(self):
819809
return "\t%sattribute %s %s\n" % (self.readonly and 'readonly ' or '',
@@ -828,7 +818,6 @@ class Method(object):
828818
noscript = False
829819
notxpcom = False
830820
binaryname = None
831-
deleted = False
832821
implicit_jscontext = False
833822
nostdcall = False
834823
must_use = False
@@ -853,14 +842,6 @@ def __init__(self, type, name, attlist, paramlist, location, doccomments, raises
853842
self.binaryname = value
854843
continue
855844

856-
if name == 'deleted':
857-
if value is None:
858-
raise IDLError("deleted attribute requires a value",
859-
aloc)
860-
861-
self.deleted = substs['MOZ_WIDGET_TOOLKIT'] == value
862-
continue
863-
864845
if value is not None:
865846
raise IDLError("Unexpected attribute value", aloc)
866847

@@ -906,7 +887,7 @@ def resolve(self, iface):
906887
def isScriptable(self):
907888
if not self.iface.attributes.scriptable:
908889
return False
909-
return not (self.noscript or self.notxpcom or self.deleted)
890+
return not (self.noscript or self.notxpcom)
910891

911892
def __str__(self):
912893
return "\t%s %s(%s)\n" % (self.type, self.name, ", ".join([p.name for p in self.params]))

xpcom/io/nsIFile.idl

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -249,12 +249,7 @@ interface nsIFile : nsISupports
249249
*
250250
*/
251251
readonly attribute AString target;
252-
/**
253-
* We only provide this API for Unix-like platforms, because
254-
* it would be lossy on Windows.
255-
*/
256-
[noscript, deleted(windows)]
257-
readonly attribute ACString nativeTarget;
252+
[noscript] readonly attribute ACString nativeTarget;
258253
readonly attribute AString path;
259254
[noscript] readonly attribute ACString nativePath;
260255

xpcom/io/nsLocalFileWin.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3632,6 +3632,22 @@ nsLocalFile::MoveToNative(nsIFile* aNewParentDir, const nsACString& aNewName)
36323632
return rv;
36333633
}
36343634

3635+
NS_IMETHODIMP
3636+
nsLocalFile::GetNativeTarget(nsACString& aResult)
3637+
{
3638+
// Check we are correctly initialized.
3639+
CHECK_mWorkingPath();
3640+
3641+
NS_WARNING("This API is lossy. Use GetTarget !");
3642+
nsAutoString tmp;
3643+
nsresult rv = GetTarget(tmp);
3644+
if (NS_SUCCEEDED(rv)) {
3645+
rv = NS_CopyUnicodeToNative(tmp, aResult);
3646+
}
3647+
3648+
return rv;
3649+
}
3650+
36353651
nsresult
36363652
NS_NewNativeLocalFile(const nsACString& aPath, bool aFollowLinks,
36373653
nsIFile** aResult)

0 commit comments

Comments
 (0)