author | Masatoshi Kimura <VYV03354@nifty.ne.jp> |
Fri, 07 Mar 2014 20:51:51 +0900 | |
changeset 172540 | 327b5e8a67089fafae4e12d733201368f4e5471f |
parent 172539 | 28938408b0e9431c0ab21b46e01b856f2283b5cd |
child 172541 | af1a435e117a7035d5e9f1464663ab5f49ea464f |
push id | 26365 |
push user | ryanvm@gmail.com |
push date | Fri, 07 Mar 2014 20:37:53 +0000 |
treeherder | mozilla-central@cd67334b34c5 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | smaug, khuey |
bugs | 978611 |
milestone | 30.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/content/base/src/nsDocument.cpp +++ b/content/base/src/nsDocument.cpp @@ -176,17 +176,16 @@ #include "mozilla/dom/Comment.h" #include "nsTextNode.h" #include "mozilla/dom/Link.h" #include "mozilla/dom/HTMLElementBinding.h" #include "mozilla/dom/SVGElementBinding.h" #include "nsXULAppAPI.h" #include "mozilla/dom/Touch.h" #include "mozilla/dom/TouchEvent.h" -#include "DictionaryHelpers.h" #include "GeneratedEvents.h" #include "mozilla/Preferences.h" #include "imgILoader.h" #include "imgRequestProxy.h" #include "nsWrapperCacheInlines.h" #include "nsSandboxFlags.h"
--- a/content/media/webspeech/recognition/nsIDOMSpeechRecognitionEvent.idl +++ b/content/media/webspeech/recognition/nsIDOMSpeechRecognitionEvent.idl @@ -24,15 +24,8 @@ interface nsIDOMSpeechRecognitionEvent : in DOMString interpretation, in nsIDOMDocument emma); readonly attribute unsigned long resultIndex; readonly attribute nsISupports results; readonly attribute DOMString interpretation; readonly attribute nsIDOMDocument emma; }; - -dictionary SpeechRecognitionEventInit : EventInit { - unsigned long resultIndex; - nsISupports results; - DOMString interpretation; - nsIDOMDocument emma; -};
--- a/content/media/webspeech/synth/nsIDOMSpeechSynthesisEvent.idl +++ b/content/media/webspeech/synth/nsIDOMSpeechSynthesisEvent.idl @@ -20,14 +20,8 @@ interface nsIDOMSpeechSynthesisEvent : n in unsigned long aCharIndex, in float aElapsedTime, in DOMString aName); readonly attribute unsigned long charIndex; readonly attribute float elapsedTime; readonly attribute DOMString name; }; - -dictionary SpeechSynthesisEventInit : EventInit { - unsigned long charIndex; - float elapsedTime; - DOMString name; -};
--- a/dom/file/ArchiveZipEvent.h +++ b/dom/file/ArchiveZipEvent.h @@ -8,18 +8,16 @@ #define mozilla_dom_file_domarchivezipevent_h__ #include "mozilla/Attributes.h" #include "ArchiveEvent.h" #include "FileCommon.h" #include "zipstruct.h" -#include "DictionaryHelpers.h" - BEGIN_FILE_NAMESPACE /** * ArchiveZipItem - ArchiveItem for ArchiveReaderZipEvent */ class ArchiveZipItem : public ArchiveItem { public:
--- a/dom/indexedDB/IDBDatabase.cpp +++ b/dom/indexedDB/IDBDatabase.cpp @@ -3,17 +3,16 @@ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "base/basictypes.h" #include "IDBDatabase.h" -#include "DictionaryHelpers.h" #include "mozilla/Mutex.h" #include "mozilla/storage.h" #include "mozilla/dom/ContentParent.h" #include "mozilla/dom/DOMStringList.h" #include "mozilla/dom/DOMStringListBinding.h" #include "mozilla/dom/quota/Client.h" #include "mozilla/dom/quota/QuotaManager.h" #include "nsJSUtils.h"
--- a/dom/indexedDB/IDBObjectStore.cpp +++ b/dom/indexedDB/IDBObjectStore.cpp @@ -34,17 +34,16 @@ #include "AsyncConnectionHelper.h" #include "IDBCursor.h" #include "IDBEvents.h" #include "IDBFileHandle.h" #include "IDBIndex.h" #include "IDBKeyRange.h" #include "IDBTransaction.h" #include "DatabaseInfo.h" -#include "DictionaryHelpers.h" #include "KeyPath.h" #include "ProfilerHelpers.h" #include "ReportInternalError.h" #include "ipc/IndexedDBChild.h" #include "ipc/IndexedDBParent.h" #include "IndexedDatabaseInlines.h"
--- a/dom/interfaces/apps/nsIDOMMozApplicationEvent.idl +++ b/dom/interfaces/apps/nsIDOMMozApplicationEvent.idl @@ -11,13 +11,8 @@ interface nsIDOMMozApplicationEvent : ns { readonly attribute mozIDOMApplication application; [noscript] void initMozApplicationEvent(in DOMString aType, in boolean aCanBubble, in boolean aCancelable, in mozIDOMApplication aApplication); }; - -dictionary MozApplicationEventInit : EventInit -{ - mozIDOMApplication application; -};
--- a/dom/interfaces/devicestorage/nsIDOMDeviceStorageChangeEvent.idl +++ b/dom/interfaces/devicestorage/nsIDOMDeviceStorageChangeEvent.idl @@ -13,14 +13,8 @@ interface nsIDOMDeviceStorageChangeEvent in boolean canBubbleArg, in boolean cancelableArg, in DOMString path, in DOMString reason); readonly attribute DOMString path; readonly attribute DOMString reason; }; - -dictionary DeviceStorageChangeEventInit : EventInit -{ - DOMString path; - DOMString reason; -};
--- a/dom/interfaces/events/nsIDOMCloseEvent.idl +++ b/dom/interfaces/events/nsIDOMCloseEvent.idl @@ -21,15 +21,8 @@ interface nsIDOMCloseEvent : nsIDOMEvent void initCloseEvent(in DOMString aType, in boolean aCanBubble, in boolean aCancelable, in boolean aWasClean, in unsigned short aReasonCode, in DOMString aReason); }; - -dictionary CloseEventInit : EventInit -{ - boolean wasClean; - unsigned short code; - DOMString reason; -};
--- a/dom/interfaces/events/nsIDOMCustomEvent.idl +++ b/dom/interfaces/events/nsIDOMCustomEvent.idl @@ -12,13 +12,8 @@ interface nsIDOMCustomEvent : nsIDOMEven readonly attribute nsIVariant detail; void initCustomEvent(in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in nsIVariant detailArg); }; - -dictionary CustomEventInit : EventInit -{ - nsIVariant detail; -};
--- a/dom/interfaces/events/nsIDOMDOMTransactionEvent.idl +++ b/dom/interfaces/events/nsIDOMDOMTransactionEvent.idl @@ -12,14 +12,8 @@ interface nsIDOMDOMTransactionEvent : ns { readonly attribute nsIVariant transactions; void initDOMTransactionEvent(in DOMString typeArg, in boolean canBubbleArg, in boolean canCancelArg, in nsIVariant transactions); }; - -dictionary DOMTransactionEventInit : EventInit -{ - nsIVariant transactions; -}; -
--- a/dom/interfaces/events/nsIDOMDeviceOrientationEvent.idl +++ b/dom/interfaces/events/nsIDOMDeviceOrientationEvent.idl @@ -35,16 +35,8 @@ interface nsIDOMDeviceOrientationEvent : * rolling an aircraft); gamma is in [-90,90). */ readonly attribute double alpha; readonly attribute double beta; readonly attribute double gamma; readonly attribute boolean absolute; }; - -dictionary DeviceOrientationEventInit : EventInit -{ - double alpha; - double beta; - double gamma; - boolean absolute; -};
--- a/dom/interfaces/events/nsIDOMElementReplaceEvent.idl +++ b/dom/interfaces/events/nsIDOMElementReplaceEvent.idl @@ -12,13 +12,8 @@ interface nsIDOMElementReplaceEvent : ns { readonly attribute nsIDOMElement upgrade; void initElementReplaceEvent(in DOMString typeArg, in boolean canBubbleArg, in boolean canCancelArg, in nsIDOMElement upgrade); }; - -dictionary ElementReplaceEventInit : EventInit -{ - nsIDOMElement upgrade; -};
--- a/dom/interfaces/events/nsIDOMEvent.idl +++ b/dom/interfaces/events/nsIDOMEvent.idl @@ -210,22 +210,16 @@ interface nsIDOMEvent : nsISupports [noscript,notxpcom] void SetTrusted(in boolean aTrusted); [notxpcom] void Serialize(in IPCMessagePtr aMsg, in boolean aSerializeInterfaceType); [notxpcom] boolean Deserialize(in ConstIPCMessagePtr aMsg, out voidPtr aIter); [noscript,notxpcom] void SetOwner(in EventTargetPtr aOwner); [notxpcom] DOMEventPtr InternalDOMEvent(); }; -dictionary EventInit -{ - boolean bubbles; - boolean cancelable; -}; - %{C++ nsresult NS_NewDOMEvent(nsIDOMEvent** aInstancePtrResult, mozilla::dom::EventTarget* aOwner, nsPresContext* aPresContext, mozilla::WidgetEvent* aEvent); nsresult
--- a/dom/interfaces/events/nsIDOMHashChangeEvent.idl +++ b/dom/interfaces/events/nsIDOMHashChangeEvent.idl @@ -12,14 +12,8 @@ interface nsIDOMHashChangeEvent : nsIDOM readonly attribute DOMString newURL; void initHashChangeEvent(in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in DOMString oldURLArg, in DOMString newURLArg); }; - -dictionary HashChangeEventInit : EventInit -{ - DOMString oldURL; - DOMString newURL; -};
--- a/dom/interfaces/events/nsIDOMPageTransitionEvent.idl +++ b/dom/interfaces/events/nsIDOMPageTransitionEvent.idl @@ -22,13 +22,8 @@ interface nsIDOMPageTransitionEvent : ns readonly attribute boolean persisted; /* Initialize a new pageshow or pagehide event. */ void initPageTransitionEvent(in DOMString typeArg, in boolean canBubbleArg, in boolean canCancelArg, in boolean persisted); }; - -dictionary PageTransitionEventInit : EventInit -{ - boolean persisted; -};
--- a/dom/interfaces/events/nsIDOMPopStateEvent.idl +++ b/dom/interfaces/events/nsIDOMPopStateEvent.idl @@ -15,13 +15,8 @@ interface nsIDOMPopStateEvent : nsIDOMEv */ readonly attribute nsIVariant state; void initPopStateEvent(in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in nsIVariant stateArg); }; - -dictionary PopStateEventInit : EventInit -{ - nsIVariant state; -};
--- a/dom/interfaces/events/nsIDOMPopupBlockedEvent.idl +++ b/dom/interfaces/events/nsIDOMPopupBlockedEvent.idl @@ -42,16 +42,8 @@ interface nsIDOMPopupBlockedEvent : nsID void initPopupBlockedEvent(in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in nsIDOMWindow requestingWindow, in nsIURI popupWindowURI, in DOMString popupWindowName, in DOMString popupWindowFeatures); }; - -dictionary PopupBlockedEventInit : EventInit -{ - nsIDOMWindow requestingWindow; - nsIURI popupWindowURI; - DOMString popupWindowFeatures; - DOMString popupWindowName; -};
--- a/dom/interfaces/events/nsIDOMProgressEvent.idl +++ b/dom/interfaces/events/nsIDOMProgressEvent.idl @@ -19,14 +19,8 @@ interface nsIDOMProgressEvent : nsIDOMEv [noscript] void initProgressEvent(in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in boolean lengthComputableArg, in unsigned long long loadedArg, in unsigned long long totalArg); }; - -dictionary ProgressEventInit : EventInit { - boolean lengthComputable; - unsigned long long loaded; - unsigned long long total; -};
--- a/dom/interfaces/events/nsIDOMRecordErrorEvent.idl +++ b/dom/interfaces/events/nsIDOMRecordErrorEvent.idl @@ -20,12 +20,8 @@ interface nsIDOMRecordErrorEvent : nsIDO readonly attribute DOMString name; [noscript] void initRecordErrorEvent(in DOMString aType, in boolean aCanBubble, in boolean aCancelable, in DOMString aName); }; - -dictionary RecordErrorEventInit : EventInit { - DOMString name; -};
--- a/dom/interfaces/events/nsIDOMSmartCardEvent.idl +++ b/dom/interfaces/events/nsIDOMSmartCardEvent.idl @@ -14,14 +14,8 @@ interface nsIDOMSmartCardEvent : nsIDOMEvent { readonly attribute DOMString tokenName; [noscript] void initSmartCardEvent(in DOMString aTypeArg, in boolean aCanBubbleArg, in boolean aCancelableArg, in DOMString aTokenNAme); }; - -dictionary SmartCardEventInit : EventInit -{ - DOMString tokenName; -}; -
--- a/dom/interfaces/events/nsIDOMStyleRuleChangeEvent.idl +++ b/dom/interfaces/events/nsIDOMStyleRuleChangeEvent.idl @@ -14,15 +14,8 @@ interface nsIDOMStyleRuleChangeEvent : n readonly attribute nsIDOMCSSStyleSheet stylesheet; readonly attribute nsIDOMCSSRule rule; [noscript] void initStyleRuleChangeEvent(in DOMString aTypeArg, in boolean aCanBubbleArg, in boolean aCancelableArg, in nsIDOMCSSStyleSheet aStyleSheet, in nsIDOMCSSRule aRule); }; - -dictionary StyleRuleChangeEventInit : EventInit -{ - nsIDOMCSSStyleSheet stylesheet; - nsIDOMCSSRule rule; -}; -
--- a/dom/interfaces/events/nsIDOMStyleSheetApplicableStateChangeEvent.idl +++ b/dom/interfaces/events/nsIDOMStyleSheetApplicableStateChangeEvent.idl @@ -13,15 +13,8 @@ interface nsIDOMStyleSheetApplicableStat readonly attribute nsIDOMCSSStyleSheet stylesheet; readonly attribute boolean applicable; [noscript] void initStyleSheetApplicableStateChangeEvent(in DOMString aTypeArg, in boolean aCanBubbleArg, in boolean aCancelableArg, in nsIDOMCSSStyleSheet aStyleSheet, in boolean aApplicable); }; - -dictionary StyleSheetApplicableStateChangeEventInit : EventInit -{ - nsIDOMCSSStyleSheet stylesheet; - boolean applicable; -}; -
--- a/dom/interfaces/events/nsIDOMStyleSheetChangeEvent.idl +++ b/dom/interfaces/events/nsIDOMStyleSheetChangeEvent.idl @@ -13,15 +13,8 @@ interface nsIDOMStyleSheetChangeEvent : readonly attribute nsIDOMCSSStyleSheet stylesheet; readonly attribute boolean documentSheet; [noscript] void initStyleSheetChangeEvent(in DOMString aTypeArg, in boolean aCanBubbleArg, in boolean aCancelableArg, in nsIDOMCSSStyleSheet aStyleSheet, in boolean aDocumentSheet); }; - -dictionary StyleSheetChangeEventInit : EventInit -{ - nsIDOMCSSStyleSheet stylesheet; - boolean documentSheet; -}; -
--- a/dom/interfaces/settings/nsIDOMMozSettingsEvent.idl +++ b/dom/interfaces/settings/nsIDOMMozSettingsEvent.idl @@ -12,14 +12,8 @@ interface nsIDOMMozSettingsEvent : nsIDO readonly attribute nsIVariant settingValue; [noscript] void initMozSettingsEvent(in DOMString aType, in boolean aCanBubble, in boolean aCancelable, in DOMString aSettingName, in nsIVariant aSettingValue); }; - -dictionary MozSettingsEventInit : EventInit -{ - DOMString settingName; - nsIVariant settingValue; -};
--- a/dom/interfaces/storage/nsIDOMStorageEvent.idl +++ b/dom/interfaces/storage/nsIDOMStorageEvent.idl @@ -57,17 +57,8 @@ interface nsIDOMStorageEvent : nsIDOMEve in boolean canBubbleArg, in boolean cancelableArg, in DOMString keyArg, in DOMString oldValueArg, in DOMString newValueArg, in DOMString urlArg, in nsIDOMStorage storageAreaArg); }; - -dictionary StorageEventInit : EventInit -{ - DOMString? key; - DOMString? oldValue; - DOMString? newValue; - DOMString url; - nsIDOMStorage storageArea; -};
--- a/dom/src/geolocation/nsGeolocation.h +++ b/dom/src/geolocation/nsGeolocation.h @@ -27,17 +27,16 @@ #include "nsIDOMGeoPositionErrorCallback.h" #include "mozilla/dom/GeolocationBinding.h" #include "mozilla/dom/PositionErrorBinding.h" #include "mozilla/dom/CallbackObject.h" #include "nsIGeolocationProvider.h" #include "nsIContentPermissionPrompt.h" #include "nsIDOMWindow.h" -#include "DictionaryHelpers.h" #include "mozilla/Attributes.h" class nsGeolocationService; class nsGeolocationRequest; namespace mozilla { namespace dom { class Geolocation;
--- a/dom/voicemail/nsIDOMMozVoicemailEvent.idl +++ b/dom/voicemail/nsIDOMMozVoicemailEvent.idl @@ -16,13 +16,8 @@ interface nsIDOMMozVoicemailEvent : nsID */ readonly attribute nsIDOMMozVoicemailStatus status; [noscript] void initMozVoicemailEvent(in DOMString aType, in boolean aCanBubble, in boolean aCancelable, in nsIDOMMozVoicemailStatus aStatus); }; - -dictionary MozVoicemailEventInit : EventInit -{ - nsIDOMMozVoicemailStatus status; -};
--- a/dom/wifi/nsIDOMMozWifiConnectionInfoEvent.idl +++ b/dom/wifi/nsIDOMMozWifiConnectionInfoEvent.idl @@ -38,18 +38,8 @@ interface nsIDOMMozWifiConnectionInfoEve in boolean aCanBubble, in boolean aCancelable, in nsIVariant aNetwork, in short signalStrength, in short relSignalStrength, in long linkSpeed, in DOMString ipAddress); }; - -dictionary MozWifiConnectionInfoEventInit : EventInit -{ - nsIVariant network; - short signalStrength; - short relSignalStrength; - long linkSpeed; - DOMString ipAddress; -}; -
--- a/dom/wifi/nsIDOMMozWifiP2pStatusChangeEvent.idl +++ b/dom/wifi/nsIDOMMozWifiP2pStatusChangeEvent.idl @@ -12,13 +12,8 @@ interface nsIDOMMozWifiP2pStatusChangeEv */ readonly attribute DOMString peerAddress; [noscript] void initMozWifiP2pStatusChangeEvent(in DOMString aType, in boolean aCanBubble, in boolean aCancelable, in DOMString aPeerAddress); }; - -dictionary MozWifiP2pStatusChangeEventInit : EventInit -{ - DOMString peerAddress; -};
--- a/dom/wifi/nsIDOMMozWifiStatusChangeEvent.idl +++ b/dom/wifi/nsIDOMMozWifiStatusChangeEvent.idl @@ -22,14 +22,8 @@ interface nsIDOMMozWifiStatusChangeEvent readonly attribute DOMString status; [noscript] void initMozWifiStatusChangeEvent(in DOMString aType, in boolean aCanBubble, in boolean aCancelable, in nsIVariant aNetwork, in DOMString aStatus); }; - -dictionary MozWifiStatusChangeEventInit : EventInit -{ - nsIVariant network; - DOMString status; -};
--- a/js/xpconnect/src/Makefile.in +++ b/js/xpconnect/src/Makefile.in @@ -1,18 +1,17 @@ # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. -EXTRA_MDDEPEND_FILES = dom_qsgen.pp dictionary_helper_gen.pp event_impl_gen.pp +EXTRA_MDDEPEND_FILES = dom_qsgen.pp event_impl_gen.pp INSTALL_TARGETS += extra_export_files extra_export_files_FILES := \ - DictionaryHelpers.h \ GeneratedEventClasses.h \ GeneratedEvents.h \ $(NULL) extra_export_files_DEST = $(DIST)/include extra_export_files_TARGET := export include $(topsrcdir)/config/rules.mk @@ -28,58 +27,35 @@ dom_quickstubs.cpp: $(srcdir)/dom_quicks $(srcdir)/qsgen.py \ --idlpath=$(DEPTH)/dist/idl \ --header-output dom_quickstubs.h \ --stub-output dom_quickstubs.cpp \ --makedepend-output $(MDDEPDIR)/dom_qsgen.pp \ $(ENABLE_TRACEABLE_FLAGS) \ $(srcdir)/dom_quickstubs.qsconf -DictionaryHelpers.h: DictionaryHelpers.cpp - -DictionaryHelpers.cpp: $(srcdir)/dictionary_helper_gen.conf \ - event_impl_gen.conf \ - $(srcdir)/dictionary_helper_gen.py \ - $(LIBXUL_DIST)/sdk/bin/header.py \ - $(LIBXUL_DIST)/sdk/bin/xpidl.py - $(PYTHON) $(topsrcdir)/config/pythonpath.py \ - $(PLY_INCLUDE) \ - -I$(LIBXUL_DIST)/sdk/bin \ - $(srcdir)/dictionary_helper_gen.py \ - -I $(DEPTH)/dist/idl \ - --header-output DictionaryHelpers.h \ - --stub-output DictionaryHelpers.cpp \ - --makedepend-output $(MDDEPDIR)/dictionary_helper_gen.pp \ - $(srcdir)/dictionary_helper_gen.conf \ - event_impl_gen.conf - event_impl_gen.conf : $(srcdir)/event_impl_gen.conf.in $(call py_action,preprocessor,$(DEFINES) $(ACDEFINES) $^ -o event_impl_gen.conf) -GeneratedEvents.h: $(srcdir)/dictionary_helper_gen.conf \ - event_impl_gen.conf \ - $(srcdir)/dictionary_helper_gen.py \ +GeneratedEvents.h: event_impl_gen.conf \ $(srcdir)/event_impl_gen.py \ $(LIBXUL_DIST)/sdk/bin/header.py \ $(LIBXUL_DIST)/sdk/bin/xpidl.py $(PYTHON) $(topsrcdir)/config/pythonpath.py \ $(PLY_INCLUDE) \ -I$(LIBXUL_DIST)/sdk/bin \ $(srcdir)/event_impl_gen.py \ -I $(DEPTH)/dist/idl \ --header-output GeneratedEvents.h \ event_impl_gen.conf GeneratedEventClasses.h: GeneratedEvents.cpp -GeneratedEvents.cpp: DictionaryHelpers.h \ - GeneratedEvents.h \ - $(srcdir)/dictionary_helper_gen.conf \ +GeneratedEvents.cpp: GeneratedEvents.h \ event_impl_gen.conf \ - $(srcdir)/dictionary_helper_gen.py \ $(srcdir)/event_impl_gen.py \ $(LIBXUL_DIST)/sdk/bin/header.py \ $(LIBXUL_DIST)/sdk/bin/xpidl.py $(PYTHON) $(topsrcdir)/config/pythonpath.py \ $(PLY_INCLUDE) \ -I$(LIBXUL_DIST)/sdk/bin \ $(srcdir)/event_impl_gen.py \ -I $(DEPTH)/dist/idl \ @@ -97,12 +73,11 @@ GeneratedEvents-webidl: event_impl_gen.c --webidltarget=$(top_srcdir)/dom/webidl \ event_impl_gen.conf GARBAGE += \ event_impl_gen.conf \ xpidl_debug \ $(MDDEPDIR)/dom_qsgen.pp \ $(MDDEPDIR)/dombindingsgen.pp \ - $(MDDEPDIR)/dictionary_helper_gen.pp \ $(MDDEPDIR)/event_impl_gen.pp \ $(wildcard $(topsrcdir)/other-licenses/ply/ply/*.pyc) \ $(NULL)
--- a/js/xpconnect/src/XPCJSRuntime.cpp +++ b/js/xpconnect/src/XPCJSRuntime.cpp @@ -3195,19 +3195,16 @@ XPCJSRuntime::newXPCJSRuntime(nsXPConnec } NS_RUNTIMEABORT("new XPCJSRuntime failed to initialize."); delete self; return nullptr; } -// InternStaticDictionaryJSVals is automatically generated. -bool InternStaticDictionaryJSVals(JSContext* aCx); - bool XPCJSRuntime::OnJSContextNew(JSContext *cx) { // If we were the first cx ever created (like the SafeJSContext), the caller // would have had no way to enter a request. Enter one now before doing the // rest of the cx setup. JSAutoRequest ar(cx); @@ -3219,18 +3216,17 @@ XPCJSRuntime::OnJSContextNew(JSContext * if (!str) { mStrIDs[0] = JSID_VOID; return false; } mStrIDs[i] = INTERNED_STRING_TO_JSID(cx, str); mStrJSVals[i] = STRING_TO_JSVAL(str); } - if (!mozilla::dom::DefineStaticJSVals(cx) || - !InternStaticDictionaryJSVals(cx)) { + if (!mozilla::dom::DefineStaticJSVals(cx)) { return false; } } XPCContext* xpc = new XPCContext(this, cx); if (!xpc) return false;
deleted file mode 100644 --- a/js/xpconnect/src/dictionary_helper_gen.conf +++ /dev/null @@ -1,21 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -# Dictionary interface name, interface file name -dictionaries = [ - [ 'SmsThreadListItem', 'nsIMobileMessageCallback.idl' ] - ] - -# include file names -special_includes = [ - 'XPCQuickStubs.h', - 'nsIDOMFile.h' - ] - -# name of the type to not include using #include "typename.h" -exclude_automatic_type_include = [ - 'nsISupports', - 'mozIDOMApplication', - 'nsIDOMBlob' - ]
deleted file mode 100644 --- a/js/xpconnect/src/dictionary_helper_gen.py +++ /dev/null @@ -1,436 +0,0 @@ -#!/usr/bin/env python -# header.py - Generate C++ header files from IDL. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -import sys, os, xpidl, makeutils - -def strip_begin(text, suffix): - if not text.startswith(suffix): - return text - return text[len(suffix):] - -def strip_end(text, suffix): - if not text.endswith(suffix): - return text - return text[:-len(suffix)] - -def findIDL(includePath, interfaceFileName): - for d in includePath: - # Not os.path.join: we need a forward slash even on Windows because - # this filename ends up in makedepend output. - path = d + '/' + interfaceFileName - if os.path.exists(path): - return path - raise BaseException("No IDL file found for interface %s " - "in include path %r" - % (interfaceFileName, includePath)) - -def loadIDL(parser, includePath, filename): - idlFile = findIDL(includePath, filename) - if not idlFile in makeutils.dependencies: - makeutils.dependencies.append(idlFile) - idl = p.parse(open(idlFile).read(), idlFile) - idl.resolve(includePath, p) - return idl - -class Configuration: - def __init__(self, filename): - config = {} - execfile(filename, config) - self.dictionaries = config.get('dictionaries', []) - self.special_includes = config.get('special_includes', []) - self.exclude_automatic_type_include = config.get('exclude_automatic_type_include', []) - -def readConfigFile(filename): - return Configuration(filename) - -def firstCap(str): - return str[0].upper() + str[1:] - -def attributeVariableTypeAndName(a): - if a.realtype.nativeType('in').endswith('*'): - l = ["nsCOMPtr<%s> %s" % (a.realtype.nativeType('in').strip('* '), - a.name)] - elif a.realtype.nativeType('in').count("nsAString"): - l = ["nsString %s" % a.name] - elif a.realtype.nativeType('in').count("JS::Value"): - l = ["JS::Value %s" % a.name] - elif a.realtype.nativeType('in').count("DOMTimeStamp"): - l = ["uint64_t /* DOMTimeStamp */ %s" % a.name] - else: - l = ["%s%s" % (a.realtype.nativeType('in'), - a.name)] - - return ", ".join(l) - -def print_header(idl, fd, conf, dictname, dicts): - for p in idl.productions: - if p.kind == 'dictionary': - interfaces = [] - base = p.base - baseiface = p - while base is not None and not base in dicts: - baseiface = baseiface.idl.getName(baseiface.base, baseiface.location) - dicts.append(base) - interfaces.append(baseiface) - base = baseiface.base - - interfaces.reverse() - for iface in interfaces: - write_header(iface, fd) - - if not p.name in dicts: - dicts.append(p.name) - write_header(p, fd) - -def print_header_file(fd, conf): - fd.write("/* THIS FILE IS AUTOGENERATED - DO NOT EDIT */\n\n" - "#ifndef _gen_mozilla_idl_dictionary_helpers_h_\n" - "#define _gen_mozilla_idl_dictionary_helpers_h_\n\n") - - fd.write("#include \"js/TypeDecls.h\"\n" - "#include \"js/Value.h\"\n" - "#include \"nsError.h\"\n" - "#include \"nsStringGlue.h\"\n" - "#include \"nsCOMPtr.h\"\n\n") - - forwards = [] - attrnames = [] - for d in conf.dictionaries: - idl = loadIDL(p, options.incdirs, d[1]) - collect_names_and_non_primitive_attribute_types(idl, d[0], attrnames, forwards) - - for c in forwards: - fd.write("class %s;\n" % c) - - - fd.write("\n" - "namespace mozilla {\n" - "namespace idl {\n\n") - - dicts = [] - for d in conf.dictionaries: - if not d[0] in set(dicts): - idl = loadIDL(p, options.incdirs, d[1]) - print_header(idl, fd, conf, d[0], dicts) - fd.write("}\n" - "}\n" - "#endif\n") - -def collect_names_and_non_primitive_attribute_types(idl, dictname, attrnames, forwards): - for p in idl.productions: - if p.kind == 'dictionary': - interfaces = [] - base = p.base - baseiface = p - while base is not None: - baseiface = baseiface.idl.getName(baseiface.base, baseiface.location) - interfaces.append(baseiface) - base = baseiface.base - - interfaces.reverse() - interfaces.append(p) - - for iface in interfaces: - collect_names_and_non_primitive_attribute_types_from_interface(iface, attrnames, forwards) - -def collect_names_and_non_primitive_attribute_types_from_interface(iface, attrnames, forwards): - for member in iface.members: - if isinstance(member, xpidl.Attribute): - if not member.name in attrnames: - attrnames.append(member.name) - if member.realtype.nativeType('in').endswith('*'): - t = member.realtype.nativeType('in').strip('* ') - if not t in forwards: - forwards.append(t) - -def print_cpp(idl, fd, conf, dictname, dicts): - for p in idl.productions: - if p.kind == 'dictionary': - interfaces = [] - base = p.base - baseiface = p - while base is not None and not base in dicts: - baseiface = baseiface.idl.getName(baseiface.base, baseiface.location) - dicts.append(base) - interfaces.append(baseiface) - base = baseiface.base - - interfaces.reverse() - for iface in interfaces: - write_cpp(iface, fd) - - if not p.name in dicts: - dicts.append(p.name) - write_cpp(p, fd) - -def get_jsid(name): - return ("gDictionary_id_%s" % name) - -def print_cpp_file(fd, conf): - fd.write("/* THIS FILE IS AUTOGENERATED - DO NOT EDIT */\n\n") - fd.write('#include "DictionaryHelpers.h"\n') - fd.write('#include "mozilla/dom/BindingUtils.h"\n') - - includes = [] - for s in conf.special_includes: - if not s in includes: - includes.append(strip_end(s, ".h")) - - for d in conf.dictionaries: - if not d[1] in includes: - includes.append(strip_end(d[1], ".idl")) - - attrnames = [] - for d in conf.dictionaries: - idl = loadIDL(p, options.incdirs, d[1]) - collect_names_and_non_primitive_attribute_types(idl, d[0], attrnames, includes) - - for c in includes: - if not c in conf.exclude_automatic_type_include: - fd.write("#include \"%s.h\"\n" % c) - - fd.write("\n" - "using namespace mozilla::idl;\n" - "using namespace mozilla::dom;\n\n") - - for a in attrnames: - fd.write("static InternedStringId %s;\n" % get_jsid(a)) - - fd.write("\n" - "bool\n" - "InternStaticDictionaryJSVals(JSContext* aCx)\n" - "{\n" - " return\n") - for a in attrnames: - fd.write(" %s.init(aCx, \"%s\") &&\n" - % (get_jsid(a), a)) - - fd.write(" true;\n") - fd.write("}\n\n") - - dicts = [] - for d in conf.dictionaries: - if not d[0] in set(dicts): - idl = p.parse(open(findIDL(options.incdirs, d[1])).read(), d[1]) - idl.resolve(options.incdirs, p) - print_cpp(idl, fd, conf, d[0], dicts) - -def init_value(attribute): - realtype = attribute.realtype.nativeType('in') - realtype = realtype.strip(' ') - if attribute.defvalue is None: - if realtype.endswith('*'): - return "nullptr" - if realtype == "bool": - return "false" - if realtype.count("nsAString"): - return "" - if realtype.count("nsACString"): - return "" - return "0" - else: - if realtype.count("double") and attribute.defvalue == "Infinity": - return "mozilla::PositiveInfinity<double>()" - if realtype.count("double") and attribute.defvalue == "-Infinity": - return "mozilla::NegativeInfinity<double>()" - if realtype.count("nsAString"): - return "NS_LITERAL_STRING(\"%s\")" % attribute.defvalue - if realtype.count("nsACString"): - return "NS_LITERAL_CSTRING(\"%s\")" % attribute.defvalue - raise xpidl.IDLError("Default value of %s is not supported for type %s" % - (attribute.defvalue, realtype), attribute.location) - -def write_header(iface, fd): - attributes = [] - for member in iface.members: - if isinstance(member, xpidl.Attribute): - attributes.append(member) - - fd.write("class %s" % iface.name) - if iface.base is not None: - fd.write(" : public %s" % iface.base) - fd.write("\n{\npublic:\n") - fd.write(" %s();\n" % iface.name) - fd.write(" ~%s();\n\n" % iface.name) - - fd.write(" // If aCx or aVal is null, NS_OK is returned and \n" - " // dictionary will use the default values. \n" - " nsresult Init(JSContext* aCx, const jsval* aVal);\n") - - fd.write("\n") - - for member in attributes: - fd.write(" %s;\n" % attributeVariableTypeAndName(member)) - - fd.write("};\n\n") - -def write_getter(a, iface, fd): - realtype = a.realtype.nativeType('in') - fd.write(" NS_ENSURE_STATE(JS_GetPropertyById(aCx, aObj, %s, &v));\n" - % get_jsid(a.name)) - if realtype.count("bool"): - fd.write(" aDict.%s = JS::ToBoolean(v);\n" % a.name) - elif realtype.count("uint16_t"): - fd.write(" uint32_t u;\n") - fd.write(" NS_ENSURE_STATE(JS::ToUint32(aCx, v, &u));\n") - fd.write(" aDict.%s = u;\n" % a.name) - elif realtype.count("int16_t"): - fd.write(" int32_t i;\n") - fd.write(" NS_ENSURE_STATE(JS::ToInt32(aCx, v, &i));\n") - fd.write(" aDict.%s = i;\n" % a.name) - elif realtype.count("uint32_t"): - fd.write(" NS_ENSURE_STATE(JS::ToUint32(aCx, v, &aDict.%s));\n" % a.name) - elif realtype.count("int32_t"): - fd.write(" NS_ENSURE_STATE(JS::ToInt32(aCx, v, &aDict.%s));\n" % a.name) - elif realtype.count("uint64_t") or realtype.count("DOMTimeStamp"): - fd.write(" NS_ENSURE_STATE(JS::ToUint64(aCx, v, &aDict.%s));\n" % a.name) - elif realtype.count("int64_t"): - fd.write(" NS_ENSURE_STATE(JS::ToInt64(aCx, v, &aDict.%s));\n" % a.name) - elif realtype.count("double"): - fd.write(" NS_ENSURE_STATE(JS::ToNumber(aCx, v, &aDict.%s));\n" % a.name) - elif realtype.count("float"): - fd.write(" double d;\n") - fd.write(" NS_ENSURE_STATE(JS::ToNumber(aCx, v, &d));") - fd.write(" aDict.%s = (float) d;\n" % a.name) - elif realtype.count("nsAString"): - if a.nullable: - fd.write(" xpc_qsDOMString d(aCx, v, &v, false, xpc_qsDOMString::eNull, xpc_qsDOMString::eNull);\n") - else: - fd.write(" xpc_qsDOMString d(aCx, v, &v, false, xpc_qsDOMString::eStringify, xpc_qsDOMString::eStringify);\n") - fd.write(" NS_ENSURE_STATE(d.IsValid());\n") - fd.write(" aDict.%s = d;\n" % a.name) - elif realtype.count("nsIVariant"): - fd.write(" nsCOMPtr<nsIVariant> d(already_AddRefed<nsIVariant>(XPCVariant::newVariant(ccx, v)));\n") - fd.write(" NS_ENSURE_STATE(d);\n") - fd.write(" aDict.%s = d;\n" % a.name) - elif realtype.endswith('*'): - fd.write(" %s d;\n" % realtype) - fd.write(" xpc_qsSelfRef ref;\n") - fd.write(" nsresult rv = xpc_qsUnwrapArg<%s>(aCx, v, &d, &ref.ptr, &v);\n" % realtype.strip('* ')) - fd.write(" NS_ENSURE_SUCCESS(rv, rv);\n") - fd.write(" aDict.%s = d;\n" % a.name) - else: - raise BaseException("Unsupported type %s found in dictionary %s" % (realtype, iface.name)) - -def write_cpp(iface, fd): - attributes = [] - for member in iface.members: - if isinstance(member, xpidl.Attribute): - attributes.append(member) - - fd.write("%s::%s()" % (iface.name, iface.name)) - - if iface.base is not None or len(attributes) > 0: - fd.write(" :\n") - - if iface.base is not None: - fd.write(" %s()" % iface.base) - if len(attributes) > 0: - fd.write(",\n") - - for i in range(len(attributes)): - fd.write(" %s(%s)" % (attributes[i].name, init_value(attributes[i]))) - if i < (len(attributes) - 1): - fd.write(",") - fd.write("\n") - - fd.write("{") - hasnullable = False - for i in range(len(attributes)): - if attributes[i].nullable: - hasnullable = True - fd.write("\n %s.SetIsVoid(true);" % attributes[i].name) - if hasnullable: - fd.write("\n") - fd.write("}\n\n") - fd.write("%s::~%s() {}\n\n" % (iface.name, iface.name)) - - fd.write("static nsresult\n%s_InitInternal(%s& aDict, JSContext* aCx, JS::HandleObject aObj)\n" % - (iface.name, iface.name)) - fd.write("{\n") - if iface.base is not None: - fd.write(" nsresult rv = %s_InitInternal(aDict, aCx, aObj);\n" % - iface.base) - fd.write(" NS_ENSURE_SUCCESS(rv, rv);\n") - - fd.write(" bool found = false;\n") - needccx = False - for a in attributes: - if a.realtype.nativeType('in').count("nsIVariant"): - needccx = True - fd.write(" JS::RootedValue v(aCx, JSVAL_VOID);\n") - if needccx: - fd.write(" XPCCallContext ccx(NATIVE_CALLER, aCx);\n") - fd.write(" NS_ENSURE_STATE(ccx.IsValid());\n") - for a in attributes: - fd.write(" NS_ENSURE_STATE(JS_HasPropertyById(aCx, aObj, %s, &found));\n" - % get_jsid(a.name)) - fd.write(" if (found) {\n") - write_getter(a, iface, fd) - fd.write(" }\n") - fd.write(" return NS_OK;\n") - fd.write("}\n\n") - - fd.write("nsresult\n%s::Init(JSContext* aCx, const jsval* aVal)\n" % iface.name) - fd.write("{\n" - " MOZ_ASSERT(NS_IsMainThread());\n" - " if (!aCx || !aVal) {\n" - " return NS_OK;\n" - " }\n" - " if (!aVal->isObject()) {\n" - " return aVal->isNullOrUndefined() ? NS_OK : NS_ERROR_TYPE_ERR;\n" - " }\n\n" - " JS::RootedObject obj(aCx, &aVal->toObject());\n" - " nsCxPusher pusher;\n" - " pusher.Push(aCx);\n" - " JSAutoCompartment ac(aCx, obj);\n") - - fd.write(" return %s_InitInternal(*this, aCx, obj);\n}\n\n" % - iface.name) - - -if __name__ == '__main__': - from optparse import OptionParser - o = OptionParser(usage="usage: %prog [options] configfile") - o.add_option('-I', action='append', dest='incdirs', default=['.'], - help="Directory to search for imported files") - o.add_option('-o', "--stub-output", - type='string', dest='stub_output', default=None, - help="Quick stub C++ source output file", metavar="FILE") - o.add_option('--header-output', type='string', default=None, - help="Quick stub header output file", metavar="FILE") - o.add_option('--makedepend-output', type='string', default=None, - help="gnumake dependencies output file", metavar="FILE") - o.add_option('--cachedir', dest='cachedir', default=None, - help="Directory in which to cache lex/parse tables.") - (options, filenames) = o.parse_args() - if len(filenames) < 1: - o.error("At least one config filename is needed.") - filename = filenames[0] - - if options.cachedir is not None: - if not os.path.isdir(options.cachedir): - os.mkdir(options.cachedir) - sys.path.append(options.cachedir) - - # Instantiate the parser. - p = xpidl.IDLParser(outputdir=options.cachedir) - - conf = readConfigFile(filename) - - if options.header_output is not None: - outfd = open(options.header_output, 'w') - print_header_file(outfd, conf) - outfd.close() - if options.stub_output is not None: - makeutils.targets.append(options.stub_output) - outfd = open(options.stub_output, 'w') - print_cpp_file(outfd, conf) - outfd.close() - if options.makedepend_output is not None: - makeutils.writeMakeDependOutput(options.makedepend_output) -
--- a/js/xpconnect/src/moz.build +++ b/js/xpconnect/src/moz.build @@ -48,33 +48,31 @@ UNIFIED_SOURCES += [ ] # XPCComponents.cpp cannot be built in unified mode because it uses plarena.h. SOURCES += [ 'XPCComponents.cpp', ] GENERATED_SOURCES += [ - 'DictionaryHelpers.cpp', 'dom_quickstubs.cpp', 'GeneratedEvents.cpp', ] FAIL_ON_WARNINGS = True MSVC_ENABLE_PGO = True LIBRARY_NAME = 'xpconnect_s' include('/ipc/chromium/chromium-config.mozbuild') FINAL_LIBRARY = 'gklayout' GENERATED_FILES = [ - 'DictionaryHelpers.h', 'dom_quickstubs.h', 'GeneratedEventClasses.h', 'GeneratedEvents.h', ] DEFINES['JS_THREADSAFE'] = True if CONFIG['MOZ_JSDEBUGGER']:
--- a/xpcom/idl-parser/xpidl.py +++ b/xpcom/idl-parser/xpidl.py @@ -454,23 +454,23 @@ class Native(object): m = '*' + ((self.modifier == 'ptr' and calltype != 'in') and '*' or '') else: m = calltype != 'in' and '*' or '' return "%s%s %s" % (const and 'const ' or '', self.nativename, m) def __str__(self): return "native %s(%s)\n" % (self.name, self.nativename) -class BaseInterface(object): +class Interface(object): + kind = 'interface' + def __init__(self, name, attlist, base, members, location, doccomments): self.name = name self.attributes = InterfaceAttributes(attlist, location) self.base = base - if self.kind == 'dictionary': - members.sort(key=lambda x:x.name) self.members = members self.location = location self.namemap = NameMap() self.doccomments = doccomments self.nativename = name for m in members: if not isinstance(m, CDATA): @@ -498,18 +498,18 @@ class BaseInterface(object): if has_method: raise IDLError("interface '%s' has multiple methods, but marked 'function'" % self.name, self.location) else: has_method = True parent.setName(self) if self.base is not None: realbase = parent.getName(self.base, self.location) - if realbase.kind != self.kind: - raise IDLError("%s '%s' inherits from non-%s type '%s'" % (self.kind, self.name, self.kind, self.base), self.location) + if realbase.kind != 'interface': + raise IDLError("interface '%s' inherits from non-interface type '%s'" % (self.name, self.base), self.location) if self.attributes.scriptable and not realbase.attributes.scriptable: print >>sys.stderr, IDLError("interface '%s' is scriptable but derives from non-scriptable '%s'" % (self.name, self.base), self.location, warning=True) if self.attributes.scriptable and realbase.attributes.builtinclass and not self.attributes.builtinclass: raise IDLError("interface '%s' is not builtinclass but derives from builtinclass '%s'" % (self.name, self.base), self.location) for member in self.members: @@ -570,31 +570,16 @@ class BaseInterface(object): def countEntries(self): ''' Returns the number of entries in the vtable for this interface. ''' total = sum(member.count() for member in self.members) if self.base is not None: realbase = self.idl.getName(self.base, self.location) total += realbase.countEntries() return total -class Interface(BaseInterface): - kind = 'interface' - - def __init__(self, name, attlist, base, members, location, doccomments): - BaseInterface.__init__(self, name, attlist, base, members, location, doccomments) - - if self.attributes.uuid is None: - raise IDLError("interface has no uuid", location) - -class Dictionary(BaseInterface): - kind = 'dictionary' - - def __init__(self, name, attlist, base, members, location, doccomments): - BaseInterface.__init__(self, name, attlist, base, members, location, doccomments) - class InterfaceAttributes(object): uuid = None scriptable = False builtinclass = False function = False deprecated = False noscript = False @@ -640,16 +625,19 @@ class InterfaceAttributes(object): action(self, val) else: if val is not None: raise IDLError("Unexpected value for attribute '%s'" % name, aloc) action(self) + if self.uuid is None: + raise IDLError("interface has no uuid", location) + def __str__(self): l = [] if self.uuid: l.append("\tuuid: %s\n" % self.uuid) if self.scriptable: l.append("\tscriptable\n") if self.builtinclass: l.append("\tbuiltinclass\n") @@ -691,27 +679,23 @@ class Attribute(object): noscript = False readonly = False implicit_jscontext = False nostdcall = False binaryname = None null = None undefined = None deprecated = False - nullable = False infallible = False - defvalue = None - def __init__(self, type, name, attlist, readonly, nullable, defvalue, location, doccomments): + def __init__(self, type, name, attlist, readonly, location, doccomments): self.type = type self.name = name self.attlist = attlist self.readonly = readonly - self.nullable = nullable - self.defvalue = defvalue self.location = location self.doccomments = doccomments for name, value, aloc in attlist: if name == 'binaryname': if value is None: raise IDLError("binaryname attribute requires a value", aloc) @@ -762,20 +746,16 @@ class Attribute(object): if (self.null is not None and getBuiltinOrNativeTypeName(self.realtype) != '[domstring]'): raise IDLError("'Null' attribute can only be used on DOMString", self.location) if (self.undefined is not None and getBuiltinOrNativeTypeName(self.realtype) != '[domstring]'): raise IDLError("'Undefined' attribute can only be used on DOMString", self.location) - if (self.nullable and - getBuiltinOrNativeTypeName(self.realtype) != '[domstring]'): - raise IDLError("Nullable types (T?) is supported only for DOMString", - self.location) if self.infallible and not self.realtype.kind == 'builtin': raise IDLError('[infallible] only works on builtin types ' '(numbers, booleans, and raw char types)', self.location) if self.infallible and not iface.attributes.builtinclass: raise IDLError('[infallible] attributes are only allowed on ' '[builtinclass] interfaces', self.location) @@ -1001,17 +981,16 @@ class Array(object): def nativeType(self, calltype, const=False): return "%s%s*" % (const and 'const ' or '', self.type.nativeType(calltype)) class IDLParser(object): keywords = { 'const': 'CONST', 'interface': 'INTERFACE', - 'dictionary': 'DICTIONARY', 'in': 'IN', 'inout': 'INOUT', 'out': 'OUT', 'attribute': 'ATTRIBUTE', 'raises': 'RAISES', 'readonly': 'READONLY', 'native': 'NATIVE', 'typedef': 'TYPEDEF', @@ -1023,33 +1002,32 @@ class IDLParser(object): 'CDATA', 'INCLUDE', 'IID', 'NUMBER', 'HEXNUM', 'LSHIFT', 'RSHIFT', 'NATIVEID', - 'STRING', ] tokens.extend(keywords.values()) states = ( ('nativeid', 'exclusive'), ) hexchar = r'[a-fA-F0-9]' t_NUMBER = r'-?\d+' t_HEXNUM = r'0x%s+' % hexchar t_LSHIFT = r'<<' t_RSHIFT= r'>>' - literals = '"(){}[],;:=|+-*?' + literals = '"(){}[],;:=|+-*' t_ignore = ' \t' def t_multilinecomment(self, t): r'/\*(?s).*?\*/' t.lexer.lineno += t.value.count('\n') if t.value.startswith("/**"): self._doccomments.append(t.value) @@ -1074,22 +1052,16 @@ class IDLParser(object): return t def t_INCLUDE(self, t): r'\#include[ \t]+"[^"\n]+"' inc, value, end = t.value.split('"') t.value = value return t - def t_STRING(self, t): - r'"[^"\n]+"' - begin, value, end = t.value.split('"') - t.value = value - return t - def t_directive(self, t): r'\#(?P<directive>[a-zA-Z]+)[^\n]+' raise IDLError("Unrecognized directive %s" % t.lexer.lexmatch.group('directive'), Location(lexer=self.lexer, lineno=self.lexer.lineno, lexpos=self.lexer.lexpos)) def t_newline(self, t): r'\n+' @@ -1131,17 +1103,16 @@ class IDLParser(object): def p_productions_include(self, p): """productions : INCLUDE productions""" p[0] = list(p[2]) p[0].insert(0, Include(p[1], self.getLocation(p, 1))) def p_productions_interface(self, p): """productions : interface productions - | dictionary productions | typedef productions | native productions""" p[0] = list(p[2]) p[0].insert(0, p[1]) def p_typedef(self, p): """typedef : TYPEDEF IDENTIFIER IDENTIFIER ';'""" p[0] = Typedef(type=p[2], @@ -1309,30 +1280,28 @@ class IDLParser(object): def p_number_bitor(self, p): """number : number '|' number""" n1 = p[1] n2 = p[3] p[0] = lambda i: n1(i) | n2(i) def p_member_att(self, p): - """member : attributes optreadonly ATTRIBUTE IDENTIFIER identifier ';'""" + """member : attributes optreadonly ATTRIBUTE IDENTIFIER IDENTIFIER ';'""" if 'doccomments' in p[1]: doccomments = p[1]['doccomments'] elif p[2] is not None: doccomments = p[2] else: doccomments = p.slice[3].doccomments p[0] = Attribute(type=p[4], name=p[5], attlist=p[1]['attlist'], readonly=p[2] is not None, - nullable=False, - defvalue=None, location=self.getLocation(p, 3), doccomments=doccomments) def p_member_method(self, p): """member : attributes IDENTIFIER IDENTIFIER '(' paramlist ')' raises ';'""" if 'doccomments' in p[1]: doccomments = p[1]['doccomments'] else: @@ -1360,17 +1329,17 @@ class IDLParser(object): p[0] = [] def p_moreparams_continue(self, p): """moreparams : ',' param moreparams""" p[0] = list(p[3]) p[0].insert(0, p[2]) def p_param(self, p): - """param : attributes paramtype IDENTIFIER identifier""" + """param : attributes paramtype IDENTIFIER IDENTIFIER""" p[0] = Param(paramtype=p[2], type=p[3], name=p[4], attlist=p[1]['attlist'], location=self.getLocation(p, 3)) def p_paramtype(self, p): """paramtype : IN @@ -1381,88 +1350,16 @@ class IDLParser(object): def p_optreadonly(self, p): """optreadonly : READONLY | """ if len(p) > 1: p[0] = p.slice[1].doccomments else: p[0] = None - def p_dictionary(self, p): - """dictionary : attributes DICTIONARY IDENTIFIER ifacebase dictbody ';'""" - atts, DICTIONARY, name, base, body, SEMI = p[1:] - attlist = atts['attlist'] - doccomments = [] - if 'doccomments' in atts: - doccomments.extend(atts['doccomments']) - doccomments.extend(p.slice[2].doccomments) - - l = lambda: self.getLocation(p, 2) - - p[0] = Dictionary(name=name, - attlist=attlist, - base=base, - members=body, - location=l(), - doccomments=doccomments) - - def p_dictbody(self, p): - """dictbody : '{' dictmembers '}' - | """ - if len(p) > 1: - p[0] = p[2] - - def p_dictmembers_start(self, p): - """dictmembers : """ - p[0] = [] - - def p_dictmembers_continue(self, p): - """dictmembers : dictmember dictmembers""" - p[0] = list(p[2]) - p[0].insert(0, p[1]) - - def p_dictmember(self, p): - """dictmember : attributes IDENTIFIER optnullable IDENTIFIER optdefvalue ';'""" - if 'doccomments' in p[1]: - doccomments = p[1]['doccomments'] - else: - doccomments = p.slice[2].doccomments - - p[0] = Attribute(type=p[2], - name=p[4], - attlist=p[1]['attlist'], - readonly=False, - nullable=p[3] is not None, - defvalue=p[5], - location=self.getLocation(p, 1), - doccomments=doccomments) - - def p_optnullable(self, p): - """optnullable : '?' - | """ - if len(p) > 1: - p[0] = p[1] - else: - p[0] = None - - def p_optdefvalue(self, p): - """optdefvalue : '=' STRING - | '=' INFINITY - | '=' '-' INFINITY - | """ - if len(p) > 1: - p[0] = "".join(p[2:]) - else: - p[0] = None - - def p_identifier(self, p): - """identifier : DICTIONARY - | IDENTIFIER""" - p[0] = p[1] - def p_raises(self, p): """raises : RAISES '(' idlist ')' | """ if len(p) == 1: p[0] = [] else: p[0] = p[3]