From ef4b082952d328e6cef793697aa835aba752b85f Mon Sep 17 00:00:00 2001 From: Brad Lassey Date: Tue, 25 Aug 2015 19:42:21 -0400 Subject: [PATCH 01/55] bug 1190018 - External protocol handlers don't work in e10s r=mrbkap --- docshell/build/moz.build | 2 + docshell/build/nsDocShellModule.cpp | 8 + dom/ipc/ContentChild.cpp | 15 + dom/ipc/ContentChild.h | 3 + dom/ipc/ContentParent.cpp | 16 ++ dom/ipc/ContentParent.h | 3 + dom/ipc/PContent.ipdl | 4 + .../exthandler/ContentHandlerService.cpp | 169 +++++++++++ uriloader/exthandler/ContentHandlerService.h | 52 ++++ uriloader/exthandler/HandlerServiceChild.h | 15 + uriloader/exthandler/HandlerServiceParent.cpp | 269 ++++++++++++++++++ uriloader/exthandler/HandlerServiceParent.h | 31 ++ uriloader/exthandler/PHandlerService.ipdl | 42 +++ uriloader/exthandler/moz.build | 4 + .../exthandler/nsHandlerService.manifest | 2 +- 15 files changed, 634 insertions(+), 1 deletion(-) create mode 100644 uriloader/exthandler/ContentHandlerService.cpp create mode 100644 uriloader/exthandler/ContentHandlerService.h create mode 100644 uriloader/exthandler/HandlerServiceChild.h create mode 100644 uriloader/exthandler/HandlerServiceParent.cpp create mode 100644 uriloader/exthandler/HandlerServiceParent.h create mode 100644 uriloader/exthandler/PHandlerService.ipdl diff --git a/docshell/build/moz.build b/docshell/build/moz.build index 46e57b7d4e9..8d68fd5f4e6 100644 --- a/docshell/build/moz.build +++ b/docshell/build/moz.build @@ -23,6 +23,8 @@ LOCAL_INCLUDES += [ if CONFIG["MOZ_WIDGET_TOOLKIT"] == "cocoa": LOCAL_INCLUDES += ['/uriloader/exthandler/mac'] +include('/ipc/chromium/chromium-config.mozbuild') + FINAL_LIBRARY = 'xul' if CONFIG['GNU_CXX']: diff --git a/docshell/build/nsDocShellModule.cpp b/docshell/build/nsDocShellModule.cpp index 86339645848..1b99a3ffe28 100644 --- a/docshell/build/nsDocShellModule.cpp +++ b/docshell/build/nsDocShellModule.cpp @@ -21,6 +21,7 @@ #include "nsPrefetchService.h" #include "nsOfflineCacheUpdate.h" #include "nsLocalHandlerApp.h" +#include "ContentHandlerService.h" #ifdef MOZ_ENABLE_DBUS #include "nsDBusHandlerApp.h" #endif @@ -38,6 +39,8 @@ // download history #include "nsDownloadHistory.h" +using mozilla::dom::ContentHandlerService; + static bool gInitialized = false; // The one time initialization for this module @@ -86,6 +89,7 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsDBusHandlerApp) NS_GENERIC_FACTORY_CONSTRUCTOR(nsExternalSharingAppService) NS_GENERIC_FACTORY_CONSTRUCTOR(nsExternalURLHandlerService) #endif +NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(ContentHandlerService, Init) // session history NS_GENERIC_FACTORY_CONSTRUCTOR(nsSHEntry) @@ -119,6 +123,7 @@ NS_DEFINE_NAMED_CID(NS_SHTRANSACTION_CID); NS_DEFINE_NAMED_CID(NS_SHISTORY_CID); NS_DEFINE_NAMED_CID(NS_SHISTORY_INTERNAL_CID); NS_DEFINE_NAMED_CID(NS_DOWNLOADHISTORY_CID); +NS_DEFINE_NAMED_CID(NS_CONTENTHANDLERSERVICE_CID); const mozilla::Module::CIDEntry kDocShellCIDs[] = { { &kNS_DOCSHELL_CID, false, nullptr, nsDocShellConstructor }, @@ -128,6 +133,8 @@ const mozilla::Module::CIDEntry kDocShellCIDs[] = { { &kNS_URI_LOADER_CID, false, nullptr, nsURILoaderConstructor }, { &kNS_DOCUMENTLOADER_SERVICE_CID, false, nullptr, nsDocLoaderConstructor }, { &kNS_EXTERNALHELPERAPPSERVICE_CID, false, nullptr, nsOSHelperAppServiceConstructor }, + { &kNS_CONTENTHANDLERSERVICE_CID, false, nullptr, ContentHandlerServiceConstructor, + mozilla::Module::CONTENT_PROCESS_ONLY }, { &kNS_EXTERNALPROTOCOLHANDLER_CID, false, nullptr, nsExternalProtocolHandlerConstructor }, { &kNS_PREFETCHSERVICE_CID, false, nullptr, nsPrefetchServiceConstructor }, { &kNS_OFFLINECACHEUPDATESERVICE_CID, false, nullptr, nsOfflineCacheUpdateServiceConstructor }, @@ -179,6 +186,7 @@ const mozilla::Module::ContractIDEntry kDocShellContracts[] = { { NS_ABOUT_MODULE_CONTRACTID_PREFIX "webrtc", &kNS_ABOUT_REDIRECTOR_MODULE_CID }, { NS_URI_LOADER_CONTRACTID, &kNS_URI_LOADER_CID }, { NS_DOCUMENTLOADER_SERVICE_CONTRACTID, &kNS_DOCUMENTLOADER_SERVICE_CID }, + { NS_HANDLERSERVICE_CONTRACTID, &kNS_CONTENTHANDLERSERVICE_CID, mozilla::Module::CONTENT_PROCESS_ONLY }, { NS_EXTERNALHELPERAPPSERVICE_CONTRACTID, &kNS_EXTERNALHELPERAPPSERVICE_CID }, { NS_EXTERNALPROTOCOLSERVICE_CONTRACTID, &kNS_EXTERNALHELPERAPPSERVICE_CID }, { NS_MIMESERVICE_CONTRACTID, &kNS_EXTERNALHELPERAPPSERVICE_CID }, diff --git a/dom/ipc/ContentChild.cpp b/dom/ipc/ContentChild.cpp index b37a7f650e7..d4ff4fa9b12 100644 --- a/dom/ipc/ContentChild.cpp +++ b/dom/ipc/ContentChild.cpp @@ -18,6 +18,7 @@ #include "CrashReporterChild.h" #include "GeckoProfiler.h" #include "TabChild.h" +#include "HandlerServiceChild.h" #include "mozilla/Attributes.h" #include "mozilla/LookAndFeel.h" @@ -1894,6 +1895,20 @@ ContentChild::DeallocPExternalHelperAppChild(PExternalHelperAppChild* aService) return true; } +PHandlerServiceChild* +ContentChild::AllocPHandlerServiceChild() +{ + HandlerServiceChild* actor = new HandlerServiceChild(); + actor->AddRef(); + return actor; +} + +bool ContentChild::DeallocPHandlerServiceChild(PHandlerServiceChild* aHandlerServiceChild) +{ + static_cast(aHandlerServiceChild)->Release(); + return true; +} + PCellBroadcastChild* ContentChild::AllocPCellBroadcastChild() { diff --git a/dom/ipc/ContentChild.h b/dom/ipc/ContentChild.h index 9ec5efdb41a..66e32275ae6 100644 --- a/dom/ipc/ContentChild.h +++ b/dom/ipc/ContentChild.h @@ -273,6 +273,9 @@ public: PBrowserChild* aBrowser) override; virtual bool DeallocPExternalHelperAppChild(PExternalHelperAppChild *aService) override; + virtual PHandlerServiceChild* AllocPHandlerServiceChild() override; + virtual bool DeallocPHandlerServiceChild(PHandlerServiceChild*) override; + virtual PCellBroadcastChild* AllocPCellBroadcastChild() override; PCellBroadcastChild* SendPCellBroadcastConstructor(PCellBroadcastChild* aActor); virtual bool DeallocPCellBroadcastChild(PCellBroadcastChild* aActor) override; diff --git a/dom/ipc/ContentParent.cpp b/dom/ipc/ContentParent.cpp index 9393b4202b2..cd8b9a36926 100755 --- a/dom/ipc/ContentParent.cpp +++ b/dom/ipc/ContentParent.cpp @@ -31,6 +31,7 @@ #include "BlobParent.h" #include "CrashReporterParent.h" #include "GMPServiceParent.h" +#include "HandlerServiceParent.h" #include "IHistory.h" #include "imgIContainer.h" #include "mozIApplication.h" @@ -3898,6 +3899,21 @@ ContentParent::DeallocPExternalHelperAppParent(PExternalHelperAppParent* aServic return true; } +PHandlerServiceParent* +ContentParent::AllocPHandlerServiceParent() +{ + HandlerServiceParent* actor = new HandlerServiceParent(); + actor->AddRef(); + return actor; +} + +bool +ContentParent::DeallocPHandlerServiceParent(PHandlerServiceParent* aHandlerServiceParent) +{ + static_cast(aHandlerServiceParent)->Release(); + return true; +} + PCellBroadcastParent* ContentParent::AllocPCellBroadcastParent() { diff --git a/dom/ipc/ContentParent.h b/dom/ipc/ContentParent.h index d390b1af424..35054e0dd0e 100644 --- a/dom/ipc/ContentParent.h +++ b/dom/ipc/ContentParent.h @@ -703,6 +703,9 @@ private: PBrowserParent* aBrowser) override; virtual bool DeallocPExternalHelperAppParent(PExternalHelperAppParent* aService) override; + virtual PHandlerServiceParent* AllocPHandlerServiceParent() override; + virtual bool DeallocPHandlerServiceParent(PHandlerServiceParent*) override; + virtual PCellBroadcastParent* AllocPCellBroadcastParent() override; virtual bool DeallocPCellBroadcastParent(PCellBroadcastParent*) override; virtual bool RecvPCellBroadcastConstructor(PCellBroadcastParent* aActor) override; diff --git a/dom/ipc/PContent.ipdl b/dom/ipc/PContent.ipdl index 21e04cce215..a060c730e79 100644 --- a/dom/ipc/PContent.ipdl +++ b/dom/ipc/PContent.ipdl @@ -16,6 +16,7 @@ include protocol PCycleCollectWithLogs; include protocol PCrashReporter; include protocol PPSMContentDownloader; include protocol PExternalHelperApp; +include protocol PHandlerService; include protocol PDeviceStorageRequest; include protocol PFileDescriptorSet; include protocol PFMRadio; @@ -458,6 +459,7 @@ prio(normal upto urgent) sync protocol PContent manages PFileDescriptorSet; manages PFMRadio; manages PHal; + manages PHandlerService; manages PHeapSnapshotTempFileHelper; manages PIcc; manages PMedia; @@ -891,6 +893,8 @@ parent: OptionalURIParams aReferrer, nullable PBrowser aBrowser); + PHandlerService(); + AddGeolocationListener(Principal principal, bool highAccuracy); RemoveGeolocationListener(); SetGeolocationHigherAccuracy(bool enable); diff --git a/uriloader/exthandler/ContentHandlerService.cpp b/uriloader/exthandler/ContentHandlerService.cpp new file mode 100644 index 00000000000..75575a73048 --- /dev/null +++ b/uriloader/exthandler/ContentHandlerService.cpp @@ -0,0 +1,169 @@ +#include "ContentHandlerService.h" +#include "HandlerServiceChild.h" +#include "ContentChild.h" +#include "nsIMutableArray.h" +#include "nsIMIMEInfo.h" + +using mozilla::dom::ContentChild; +using mozilla::dom::PHandlerServiceChild; +using mozilla::dom::HandlerInfo; + +namespace mozilla { +namespace dom { + +NS_IMPL_ISUPPORTS(ContentHandlerService, nsIHandlerService) + +ContentHandlerService::ContentHandlerService() +{ +} + +nsresult +ContentHandlerService::Init() +{ + if (!XRE_IsContentProcess()) { + return NS_ERROR_FAILURE; + } + ContentChild* cpc = ContentChild::GetSingleton(); + + mHandlerServiceChild = static_cast(cpc->SendPHandlerServiceConstructor()); + return NS_OK; +} + +void +ContentHandlerService::nsIHandlerInfoToHandlerInfo(nsIHandlerInfo* aInfo, + HandlerInfo* aHandlerInfo) +{ + nsCString type; + aInfo->GetType(type); + nsCOMPtr mimeInfo = do_QueryInterface(aInfo); + bool isMIMEInfo = !!mimeInfo; + nsString description; + aInfo->GetDescription(description); + bool alwaysAskBeforeHandling; + aInfo->GetAlwaysAskBeforeHandling(&alwaysAskBeforeHandling); + nsCOMPtr app; + aInfo->GetPreferredApplicationHandler(getter_AddRefs(app)); + nsString name; + nsString detailedDescription; + if (app) { + app->GetName(name); + app->GetDetailedDescription(detailedDescription); + } + HandlerApp happ(name, detailedDescription); + nsTArray happs; + nsCOMPtr apps; + aInfo->GetPossibleApplicationHandlers(getter_AddRefs(apps)); + if (apps) { + unsigned int length; + apps->GetLength(&length); + for (unsigned int i = 0; i < length; i++) { + apps->QueryElementAt(i, NS_GET_IID(nsIHandlerApp), getter_AddRefs(app)); + app->GetName(name); + app->GetDetailedDescription(detailedDescription); + happs.AppendElement(HandlerApp(name, detailedDescription)); + } + } + nsHandlerInfoAction action; + aInfo->GetPreferredAction(&action); + HandlerInfo info(type, isMIMEInfo, description, alwaysAskBeforeHandling, happ, happs, action); + *aHandlerInfo = info; +} + + +NS_IMETHODIMP RemoteHandlerApp::GetName(nsAString & aName) +{ + aName.Assign(mAppChild.name()); + return NS_OK; +} + +NS_IMETHODIMP RemoteHandlerApp::SetName(const nsAString & aName) +{ + return NS_ERROR_NOT_IMPLEMENTED; +} + +NS_IMETHODIMP RemoteHandlerApp::GetDetailedDescription(nsAString & aDetailedDescription) +{ + aDetailedDescription.Assign(mAppChild.detailedDescription()); + return NS_OK; +} + +NS_IMETHODIMP RemoteHandlerApp::SetDetailedDescription(const nsAString & aDetailedDescription) +{ + return NS_ERROR_NOT_IMPLEMENTED; +} + +NS_IMETHODIMP RemoteHandlerApp::Equals(nsIHandlerApp *aHandlerApp, bool *_retval) +{ + return NS_ERROR_NOT_IMPLEMENTED; +} + +NS_IMETHODIMP RemoteHandlerApp::LaunchWithURI(nsIURI *aURI, nsIInterfaceRequestor *aWindowContext) +{ + return NS_ERROR_NOT_IMPLEMENTED; +} + +NS_IMPL_ISUPPORTS(RemoteHandlerApp, nsIHandlerApp) + +static inline void CopyHanderInfoTonsIHandlerInfo(HandlerInfo info, nsIHandlerInfo* aHandlerInfo) +{ + HandlerApp preferredApplicationHandler = info.preferredApplicationHandler(); + nsCOMPtr preferredApp(new RemoteHandlerApp(preferredApplicationHandler)); + aHandlerInfo->SetPreferredApplicationHandler(preferredApp); + nsCOMPtr possibleHandlers; + aHandlerInfo->GetPossibleApplicationHandlers(getter_AddRefs(possibleHandlers)); + possibleHandlers->AppendElement(preferredApp, false); +} +ContentHandlerService::~ContentHandlerService() +{ +} + +NS_IMETHODIMP ContentHandlerService::Enumerate(nsISimpleEnumerator * *_retval) +{ + return NS_ERROR_NOT_IMPLEMENTED; +} + +NS_IMETHODIMP ContentHandlerService::FillHandlerInfo(nsIHandlerInfo *aHandlerInfo, const nsACString & aOverrideType) +{ + HandlerInfo info; + nsIHandlerInfoToHandlerInfo(aHandlerInfo, &info); + mHandlerServiceChild->SendFillHandlerInfo(info, nsCString(aOverrideType), &info); + CopyHanderInfoTonsIHandlerInfo(info, aHandlerInfo); + return NS_OK; +} + +NS_IMETHODIMP ContentHandlerService::Store(nsIHandlerInfo *aHandlerInfo) +{ + return NS_ERROR_NOT_IMPLEMENTED; +} + +NS_IMETHODIMP ContentHandlerService::Exists(nsIHandlerInfo *aHandlerInfo, bool *_retval) +{ + HandlerInfo info; + nsIHandlerInfoToHandlerInfo(aHandlerInfo, &info); + mHandlerServiceChild->SendExists(info, _retval); + return NS_OK; +} + +NS_IMETHODIMP ContentHandlerService::Remove(nsIHandlerInfo *aHandlerInfo) +{ + return NS_ERROR_NOT_IMPLEMENTED; +} + + +NS_IMETHODIMP ContentHandlerService::GetTypeFromExtension(const nsACString & aFileExtension, nsACString & _retval) +{ + nsCString* cachedType = nullptr; + if (!!mExtToTypeMap.Get(aFileExtension, &cachedType) && !!cachedType) { + _retval.Assign(*cachedType); + return NS_OK; + } + nsCString type; + mHandlerServiceChild->SendGetTypeFromExtension(nsCString(aFileExtension), &type); + _retval.Assign(type); + mExtToTypeMap.Put(nsCString(aFileExtension), new nsCString(type)); + + return NS_OK; +} + +} +} diff --git a/uriloader/exthandler/ContentHandlerService.h b/uriloader/exthandler/ContentHandlerService.h new file mode 100644 index 00000000000..c8955ebcd97 --- /dev/null +++ b/uriloader/exthandler/ContentHandlerService.h @@ -0,0 +1,52 @@ +#ifndef ContentHandlerService_h +#define ContentHandlerService_h + +#include "nsIHandlerService.h" +#include "nsClassHashtable.h" +#include "HandlerServiceChild.h" +#include "nsIMIMEInfo.h" + +#define NS_CONTENTHANDLERSERVICE_CID \ + {0xc4b6fb7c, 0xbfb1, 0x49dc, {0xa6, 0x5f, 0x03, 0x57, 0x96, 0x52, 0x4b, 0x53}} + +namespace mozilla { +namespace dom { + +class PHandlerServiceChild; + +class ContentHandlerService : public nsIHandlerService +{ +public: + NS_DECL_ISUPPORTS + NS_DECL_NSIHANDLERSERVICE + + ContentHandlerService(); + nsresult Init(); + static void nsIHandlerInfoToHandlerInfo(nsIHandlerInfo* aInfo, HandlerInfo* aHandlerInfo); + +private: + virtual ~ContentHandlerService(); + RefPtr mHandlerServiceChild; + nsClassHashtable mExtToTypeMap; +}; + +class RemoteHandlerApp : public nsIHandlerApp +{ +public: + NS_DECL_ISUPPORTS + NS_DECL_NSIHANDLERAPP + + explicit RemoteHandlerApp(HandlerApp aAppChild) : mAppChild(aAppChild) + { + } +private: + virtual ~RemoteHandlerApp() + { + } + HandlerApp mAppChild; +}; + + +} +} +#endif diff --git a/uriloader/exthandler/HandlerServiceChild.h b/uriloader/exthandler/HandlerServiceChild.h new file mode 100644 index 00000000000..6ef6833a842 --- /dev/null +++ b/uriloader/exthandler/HandlerServiceChild.h @@ -0,0 +1,15 @@ +#ifndef handler_service_child_h +#define handler_service_child_h + +#include "mozilla/dom/PHandlerServiceChild.h" + +class HandlerServiceChild final : public mozilla::dom::PHandlerServiceChild +{ + public: + NS_INLINE_DECL_REFCOUNTING(HandlerServiceChild) + HandlerServiceChild() {} + private: + virtual ~HandlerServiceChild() {} +}; + +#endif diff --git a/uriloader/exthandler/HandlerServiceParent.cpp b/uriloader/exthandler/HandlerServiceParent.cpp new file mode 100644 index 00000000000..e7afe7baa97 --- /dev/null +++ b/uriloader/exthandler/HandlerServiceParent.cpp @@ -0,0 +1,269 @@ +#include "HandlerServiceParent.h" +#include "nsIHandlerService.h" +#include "nsIMIMEInfo.h" +#include "ContentHandlerService.h" + +using mozilla::dom::HandlerInfo; +using mozilla::dom::HandlerApp; +using mozilla::dom::ContentHandlerService; +using mozilla::dom::RemoteHandlerApp; + +namespace { + +class ProxyHandlerInfo final : public nsIHandlerInfo { +public: + explicit ProxyHandlerInfo(const HandlerInfo& aHandlerInfo); + NS_DECL_ISUPPORTS; + NS_DECL_NSIHANDLERINFO; +protected: + ~ProxyHandlerInfo() {} + HandlerInfo mHandlerInfo; + nsHandlerInfoAction mPrefAction; + nsCOMPtr mPossibleApps; +}; + +NS_IMPL_ISUPPORTS(ProxyHandlerInfo, nsIHandlerInfo) + +ProxyHandlerInfo::ProxyHandlerInfo(const HandlerInfo& aHandlerInfo) : mHandlerInfo(aHandlerInfo), mPossibleApps(do_CreateInstance(NS_ARRAY_CONTRACTID)) +{ + for (auto& happ : aHandlerInfo.possibleApplicationHandlers()) { + mPossibleApps->AppendElement(new RemoteHandlerApp(happ), false); + } +} + +/* readonly attribute ACString type; */ +NS_IMETHODIMP ProxyHandlerInfo::GetType(nsACString & aType) +{ + aType.Assign(mHandlerInfo.type()); + return NS_OK; +} + +/* attribute AString description; */ +NS_IMETHODIMP ProxyHandlerInfo::GetDescription(nsAString & aDescription) +{ + return NS_ERROR_NOT_IMPLEMENTED; +} +NS_IMETHODIMP ProxyHandlerInfo::SetDescription(const nsAString & aDescription) +{ + return NS_ERROR_NOT_IMPLEMENTED; +} + +/* attribute nsIHandlerApp preferredApplicationHandler; */ +NS_IMETHODIMP ProxyHandlerInfo::GetPreferredApplicationHandler(nsIHandlerApp * *aPreferredApplicationHandler) +{ + *aPreferredApplicationHandler = new RemoteHandlerApp(mHandlerInfo.preferredApplicationHandler()); + NS_IF_ADDREF(*aPreferredApplicationHandler); + return NS_OK; +} + +NS_IMETHODIMP ProxyHandlerInfo::SetPreferredApplicationHandler(nsIHandlerApp *aApp) +{ + nsString name; + nsString detailedDescription; + if (aApp) { + aApp->GetName(name); + aApp->GetDetailedDescription(detailedDescription); + } + HandlerApp happ(name, detailedDescription); + mHandlerInfo = HandlerInfo(mHandlerInfo.type(), + mHandlerInfo.isMIMEInfo(), + mHandlerInfo.description(), + mHandlerInfo.alwaysAskBeforeHandling(), + happ, + mHandlerInfo.possibleApplicationHandlers(), + mHandlerInfo.preferredAction()); + return NS_OK; +} + +/* readonly attribute nsIMutableArray possibleApplicationHandlers; */ +NS_IMETHODIMP ProxyHandlerInfo::GetPossibleApplicationHandlers(nsIMutableArray * *aPossibleApplicationHandlers) +{ + *aPossibleApplicationHandlers = mPossibleApps; + NS_IF_ADDREF(*aPossibleApplicationHandlers); + return NS_OK; +} + +/* readonly attribute boolean hasDefaultHandler; */ +NS_IMETHODIMP ProxyHandlerInfo::GetHasDefaultHandler(bool *aHasDefaultHandler) +{ + return NS_ERROR_NOT_IMPLEMENTED; +} + +/* readonly attribute AString defaultDescription; */ +NS_IMETHODIMP ProxyHandlerInfo::GetDefaultDescription(nsAString & aDefaultDescription) +{ + return NS_ERROR_NOT_IMPLEMENTED; +} + +/* void launchWithURI (in nsIURI aURI, [optional] in nsIInterfaceRequestor aWindowContext); */ +NS_IMETHODIMP ProxyHandlerInfo::LaunchWithURI(nsIURI *aURI, nsIInterfaceRequestor *aWindowContext) +{ + return NS_ERROR_NOT_IMPLEMENTED; +} + +/* attribute ProxyHandlerInfoAction preferredAction; */ +NS_IMETHODIMP ProxyHandlerInfo::GetPreferredAction(nsHandlerInfoAction *aPreferredAction) +{ + *aPreferredAction = mPrefAction; + return NS_OK; +} +NS_IMETHODIMP ProxyHandlerInfo::SetPreferredAction(nsHandlerInfoAction aPreferredAction) +{ + mHandlerInfo = HandlerInfo(mHandlerInfo.type(), + mHandlerInfo.isMIMEInfo(), + mHandlerInfo.description(), + mHandlerInfo.alwaysAskBeforeHandling(), + mHandlerInfo.preferredApplicationHandler(), + mHandlerInfo.possibleApplicationHandlers(), + aPreferredAction); + return NS_OK; +} + +/* attribute boolean alwaysAskBeforeHandling; */ +NS_IMETHODIMP ProxyHandlerInfo::GetAlwaysAskBeforeHandling(bool *aAlwaysAskBeforeHandling) +{ + *aAlwaysAskBeforeHandling = mHandlerInfo.alwaysAskBeforeHandling(); + return NS_OK; +} +NS_IMETHODIMP ProxyHandlerInfo::SetAlwaysAskBeforeHandling(bool aAlwaysAskBeforeHandling) +{ + mHandlerInfo = HandlerInfo(mHandlerInfo.type(), + mHandlerInfo.isMIMEInfo(), + mHandlerInfo.description(), + aAlwaysAskBeforeHandling, + mHandlerInfo.preferredApplicationHandler(), + mHandlerInfo.possibleApplicationHandlers(), + mHandlerInfo.preferredAction()); + return NS_OK; +} + + +class ProxyMIMEInfo : public nsIMIMEInfo +{ +public: + NS_DECL_ISUPPORTS + NS_DECL_NSIMIMEINFO + NS_FORWARD_NSIHANDLERINFO(mProxyHandlerInfo->); + + explicit ProxyMIMEInfo(HandlerInfo aHandlerInfo) : mProxyHandlerInfo(new ProxyHandlerInfo(aHandlerInfo)) {} + +private: + virtual ~ProxyMIMEInfo() {} + nsCOMPtr mProxyHandlerInfo; + +protected: + /* additional members */ +}; + +NS_IMPL_ISUPPORTS(ProxyMIMEInfo, nsIMIMEInfo, nsIHandlerInfo) + +/* nsIUTF8StringEnumerator getFileExtensions (); */ +NS_IMETHODIMP ProxyMIMEInfo::GetFileExtensions(nsIUTF8StringEnumerator * *_retval) +{ + return NS_ERROR_NOT_IMPLEMENTED; +} + +/* void setFileExtensions (in AUTF8String aExtensions); */ +NS_IMETHODIMP ProxyMIMEInfo::SetFileExtensions(const nsACString & aExtensions) +{ + return NS_ERROR_NOT_IMPLEMENTED; +} + +/* boolean extensionExists (in AUTF8String aExtension); */ +NS_IMETHODIMP ProxyMIMEInfo::ExtensionExists(const nsACString & aExtension, bool *_retval) +{ + return NS_ERROR_NOT_IMPLEMENTED; +} + +/* void appendExtension (in AUTF8String aExtension); */ +NS_IMETHODIMP ProxyMIMEInfo::AppendExtension(const nsACString & aExtension) +{ + return NS_ERROR_NOT_IMPLEMENTED; +} + +/* attribute AUTF8String primaryExtension; */ +NS_IMETHODIMP ProxyMIMEInfo::GetPrimaryExtension(nsACString & aPrimaryExtension) +{ + return NS_ERROR_NOT_IMPLEMENTED; +} + +NS_IMETHODIMP ProxyMIMEInfo::SetPrimaryExtension(const nsACString & aPrimaryExtension) +{ + return NS_ERROR_NOT_IMPLEMENTED; +} + +/* readonly attribute ACString MIMEType; */ +NS_IMETHODIMP ProxyMIMEInfo::GetMIMEType(nsACString & aMIMEType) +{ + return NS_ERROR_NOT_IMPLEMENTED; +} + +/* boolean equals (in nsIMIMEInfo aMIMEInfo); */ +NS_IMETHODIMP ProxyMIMEInfo::Equals(nsIMIMEInfo *aMIMEInfo, bool *_retval) +{ + return NS_ERROR_NOT_IMPLEMENTED; +} + +/* readonly attribute nsIArray possibleLocalHandlers; */ +NS_IMETHODIMP ProxyMIMEInfo::GetPossibleLocalHandlers(nsIArray * *aPossibleLocalHandlers) +{ + return NS_ERROR_NOT_IMPLEMENTED; +} + +/* void launchWithFile (in nsIFile aFile); */ +NS_IMETHODIMP ProxyMIMEInfo::LaunchWithFile(nsIFile *aFile) +{ + return NS_ERROR_NOT_IMPLEMENTED; +} + +static already_AddRefed WrapHandlerInfo(const HandlerInfo& aHandlerInfo) { + nsCOMPtr info; + if (aHandlerInfo.isMIMEInfo()) { + info = new ProxyMIMEInfo(aHandlerInfo); + } else { + info = new ProxyHandlerInfo(aHandlerInfo); + } + return info.forget(); +} + +} // anonymous namespace + +HandlerServiceParent::HandlerServiceParent() +{ +} + +HandlerServiceParent::~HandlerServiceParent() +{ +} + +bool HandlerServiceParent::RecvFillHandlerInfo(const HandlerInfo& aHandlerInfoData, + const nsCString& aOverrideType, + HandlerInfo* handlerInfoData) +{ + nsCOMPtr info(WrapHandlerInfo(aHandlerInfoData)); + nsCOMPtr handlerSvc = do_GetService(NS_HANDLERSERVICE_CONTRACTID); + handlerSvc->FillHandlerInfo(info, aOverrideType); + ContentHandlerService::nsIHandlerInfoToHandlerInfo(info, handlerInfoData); + return true; +} + +bool HandlerServiceParent::RecvExists(const HandlerInfo& aHandlerInfo, + bool* exists) +{ + nsCOMPtr info(WrapHandlerInfo(aHandlerInfo)); + nsCOMPtr handlerSvc = do_GetService(NS_HANDLERSERVICE_CONTRACTID); + handlerSvc->Exists(info, exists); + return true; +} + +bool HandlerServiceParent::RecvGetTypeFromExtension(const nsCString& aFileExtension, + nsCString* type) +{ + nsCOMPtr handlerSvc = do_GetService(NS_HANDLERSERVICE_CONTRACTID); + handlerSvc->GetTypeFromExtension(aFileExtension, *type); + return true; +} + +void HandlerServiceParent::ActorDestroy(ActorDestroyReason aWhy) +{ +} diff --git a/uriloader/exthandler/HandlerServiceParent.h b/uriloader/exthandler/HandlerServiceParent.h new file mode 100644 index 00000000000..37f58601879 --- /dev/null +++ b/uriloader/exthandler/HandlerServiceParent.h @@ -0,0 +1,31 @@ +#ifndef handler_service_parent_h +#define handler_service_parent_h + +#include "mozilla/dom/PHandlerServiceParent.h" +#include "nsIMIMEInfo.h" + +class nsIHandlerApp; + +class HandlerServiceParent final : public mozilla::dom::PHandlerServiceParent +{ + public: + HandlerServiceParent(); + NS_INLINE_DECL_REFCOUNTING(HandlerServiceParent) + + private: + virtual ~HandlerServiceParent(); + virtual void ActorDestroy(ActorDestroyReason aWhy) override; + + + virtual bool RecvFillHandlerInfo(const HandlerInfo& aHandlerInfoData, + const nsCString& aOverrideType, + HandlerInfo* handlerInfoData) override; + virtual bool RecvExists(const HandlerInfo& aHandlerInfo, + bool* exits) override; + + virtual bool RecvGetTypeFromExtension(const nsCString& aFileExtension, + nsCString* type) override; + +}; + +#endif diff --git a/uriloader/exthandler/PHandlerService.ipdl b/uriloader/exthandler/PHandlerService.ipdl new file mode 100644 index 00000000000..7e5cff0faac --- /dev/null +++ b/uriloader/exthandler/PHandlerService.ipdl @@ -0,0 +1,42 @@ +/* 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 protocol PContent; + +namespace mozilla { +namespace dom { + +struct HandlerApp { + nsString name; + nsString detailedDescription; +}; + +struct HandlerInfo { + nsCString type; + bool isMIMEInfo; + nsString description; + bool alwaysAskBeforeHandling; + HandlerApp preferredApplicationHandler; + HandlerApp[] possibleApplicationHandlers; + long preferredAction; +}; + +sync protocol PHandlerService +{ + manager PContent; + +parent: + sync FillHandlerInfo(HandlerInfo aHandlerInfoData, + nsCString aOverrideType) + returns (HandlerInfo handlerInfoData); + sync Exists(HandlerInfo aHandlerInfo) + returns (bool exists); + sync GetTypeFromExtension(nsCString aFileExtension) + returns (nsCString type); + __delete__(); +}; + + +} // namespace dom +} // namespace mozilla diff --git a/uriloader/exthandler/moz.build b/uriloader/exthandler/moz.build index 8cbbab936d8..b2aaa70660f 100644 --- a/uriloader/exthandler/moz.build +++ b/uriloader/exthandler/moz.build @@ -34,6 +34,7 @@ EXPORTS += [ ] EXPORTS += [ + 'ContentHandlerService.h', 'nsExternalHelperAppService.h', ] @@ -49,8 +50,10 @@ EXPORTS.mozilla.dom += [ ] UNIFIED_SOURCES += [ + 'ContentHandlerService.cpp', 'ExternalHelperAppChild.cpp', 'ExternalHelperAppParent.cpp', + 'HandlerServiceParent.cpp', 'nsExternalHelperAppService.cpp', 'nsExternalProtocolHandler.cpp', 'nsLocalHandlerApp.cpp', @@ -119,6 +122,7 @@ EXTRA_COMPONENTS += [ IPDL_SOURCES += [ 'PExternalHelperApp.ipdl', + 'PHandlerService.ipdl', ] include('/ipc/chromium/chromium-config.mozbuild') diff --git a/uriloader/exthandler/nsHandlerService.manifest b/uriloader/exthandler/nsHandlerService.manifest index f3d81ce8e98..5ed86c79878 100644 --- a/uriloader/exthandler/nsHandlerService.manifest +++ b/uriloader/exthandler/nsHandlerService.manifest @@ -1,2 +1,2 @@ component {32314cc8-22f7-4f7f-a645-1a45453ba6a6} nsHandlerService.js -contract @mozilla.org/uriloader/handler-service;1 {32314cc8-22f7-4f7f-a645-1a45453ba6a6} \ No newline at end of file +contract @mozilla.org/uriloader/handler-service;1 {32314cc8-22f7-4f7f-a645-1a45453ba6a6} process=main \ No newline at end of file From 258334855a6ae504abd568f48641ea60ac2a323f Mon Sep 17 00:00:00 2001 From: Eric Rahm Date: Thu, 30 Apr 2015 15:13:05 -0700 Subject: [PATCH 02/55] Bug 1160272 - DMD build should include |mfbt/Poison.cpp|. r=glandium --- memory/replace/dmd/moz.build | 1 + 1 file changed, 1 insertion(+) diff --git a/memory/replace/dmd/moz.build b/memory/replace/dmd/moz.build index f4401d60f36..588372ff73d 100644 --- a/memory/replace/dmd/moz.build +++ b/memory/replace/dmd/moz.build @@ -11,6 +11,7 @@ EXPORTS += [ SOURCES += [ '../../../mfbt/HashFunctions.cpp', '../../../mfbt/JSONWriter.cpp', + '../../../mfbt/Poison.cpp', '../../../mozglue/misc/StackWalk.cpp', 'DMD.cpp', ] From c3e7b4d9aab6ee5baa2d3bffffc6a07769ac5b89 Mon Sep 17 00:00:00 2001 From: Eric Rahm Date: Wed, 11 Nov 2015 14:07:30 -0800 Subject: [PATCH 03/55] Bug 1223927 - Add resident-unique measurement to OS X. r=njn --- xpcom/base/nsMemoryReporterManager.cpp | 121 +++++++++++++++++++++++++ 1 file changed, 121 insertions(+) diff --git a/xpcom/base/nsMemoryReporterManager.cpp b/xpcom/base/nsMemoryReporterManager.cpp index ed61ff5d237..7bbc2df99d5 100644 --- a/xpcom/base/nsMemoryReporterManager.cpp +++ b/xpcom/base/nsMemoryReporterManager.cpp @@ -420,7 +420,10 @@ ResidentFastDistinguishedAmount(int64_t* aN) #elif defined(XP_MACOSX) #include +#include +#include #include +#include static bool GetTaskBasicInfo(struct task_basic_info* aTi) @@ -485,6 +488,124 @@ ResidentDistinguishedAmount(int64_t* aN) return ResidentDistinguishedAmountHelper(aN, /* doPurge = */ true); } +#define HAVE_RESIDENT_UNIQUE_REPORTER 1 + +static bool +InSharedRegion(mach_vm_address_t aAddr, cpu_type_t aType) +{ + mach_vm_address_t base; + mach_vm_address_t size; + + switch (aType) { + case CPU_TYPE_ARM: + base = SHARED_REGION_BASE_ARM; + size = SHARED_REGION_SIZE_ARM; + break; + case CPU_TYPE_I386: + base = SHARED_REGION_BASE_I386; + size = SHARED_REGION_SIZE_I386; + break; + case CPU_TYPE_X86_64: + base = SHARED_REGION_BASE_X86_64; + size = SHARED_REGION_SIZE_X86_64; + break; + default: + return false; + } + + return base <= aAddr && aAddr < (base + size); +} + +static nsresult +ResidentUniqueDistinguishedAmount(int64_t* aN) +{ + if (!aN) { + return NS_ERROR_FAILURE; + } + + cpu_type_t cpu_type; + size_t len = sizeof(cpu_type); + if (sysctlbyname("sysctl.proc_cputype", &cpu_type, &len, NULL, 0) != 0) { + return NS_ERROR_FAILURE; + } + + // Roughly based on libtop_update_vm_regions in + // http://www.opensource.apple.com/source/top/top-100.1.2/libtop.c + size_t privatePages = 0; + mach_vm_size_t size = 0; + for (mach_vm_address_t addr = MACH_VM_MIN_ADDRESS; ; addr += size) { + vm_region_top_info_data_t info; + mach_msg_type_number_t infoCount = VM_REGION_TOP_INFO_COUNT; + mach_port_t objectName; + + kern_return_t kr = + mach_vm_region(mach_task_self(), &addr, &size, VM_REGION_TOP_INFO, + reinterpret_cast(&info), + &infoCount, &objectName); + if (kr == KERN_INVALID_ADDRESS) { + // Done iterating VM regions. + break; + } else if (kr != KERN_SUCCESS) { + return NS_ERROR_FAILURE; + } + + if (InSharedRegion(addr, cpu_type) && info.share_mode != SM_PRIVATE) { + continue; + } + + switch (info.share_mode) { + case SM_LARGE_PAGE: + // NB: Large pages are not shareable and always resident. + case SM_PRIVATE: + privatePages += info.private_pages_resident; + privatePages += info.shared_pages_resident; + break; + case SM_COW: + privatePages += info.private_pages_resident; + if (info.ref_count == 1) { + // Treat copy-on-write pages as private if they only have one reference. + privatePages += info.shared_pages_resident; + } + break; + case SM_SHARED: + default: + break; + } + } + + vm_size_t pageSize; + if (host_page_size(mach_host_self(), &pageSize) != KERN_SUCCESS) { + pageSize = PAGE_SIZE; + } + + *aN = privatePages * pageSize; + return NS_OK; +} + +class ResidentUniqueReporter final : public nsIMemoryReporter +{ + ~ResidentUniqueReporter() {} + +public: + NS_DECL_ISUPPORTS + + NS_METHOD CollectReports(nsIHandleReportCallback* aHandleReport, + nsISupports* aData, bool aAnonymize) override + { + int64_t amount = 0; + nsresult rv = ResidentUniqueDistinguishedAmount(&amount); + NS_ENSURE_SUCCESS(rv, rv); + + return MOZ_COLLECT_REPORT( + "resident-unique", KIND_OTHER, UNITS_BYTES, amount, +"Memory mapped by the process that is present in physical memory and not " +"shared with any other processes. This is also known as the process's unique " +"set size (USS). This is the amount of RAM we'd expect to be freed if we " +"closed this process."); + } +}; +NS_IMPL_ISUPPORTS(ResidentUniqueReporter, nsIMemoryReporter) + #elif defined(XP_WIN) #include From 2ce217b2298cc9885e6ac820634cd71067f4f764 Mon Sep 17 00:00:00 2001 From: Chris Manchester Date: Mon, 16 Nov 2015 14:00:56 -0800 Subject: [PATCH 04/55] Bug 1222549 - Add build-metrics submission to perfherder. r=wlach,jlund This adds "basic" build time metrics to data already submitted to perfherder from mozharness: the overall build time, and the duration of each build step as a subtest. --- testing/mozharness/mozharness/base/python.py | 16 +++++++++++++ .../mozharness/mozilla/building/buildbase.py | 24 ++++++++++++++----- 2 files changed, 34 insertions(+), 6 deletions(-) diff --git a/testing/mozharness/mozharness/base/python.py b/testing/mozharness/mozharness/base/python.py index 7db071843db..108553f356a 100644 --- a/testing/mozharness/mozharness/base/python.py +++ b/testing/mozharness/mozharness/base/python.py @@ -581,6 +581,7 @@ class InfluxRecordingMixin(object): self.recording = False self.post = None self.posturl = None + self.build_metrics_summary = None self.res_props = self.config.get('build_resources_path') % self.query_abs_dirs() self.info("build_resources.json path: %s" % self.res_props) if self.res_props: @@ -727,6 +728,7 @@ class InfluxRecordingMixin(object): "cpu_percent", ], } + # The io and cpu_times fields aren't static - they may vary based # on the specific platform being measured. Mach records the field # names, which we use as the column names here. @@ -735,6 +737,13 @@ class InfluxRecordingMixin(object): iolen = len(resources['io_fields']) cpulen = len(resources['cpu_times_fields']) + if 'duration' in resources: + self.build_metrics_summary = { + 'name': 'build times', + 'value': resources['duration'], + 'subtests': [], + } + # The top-level data has the overall resource usage, which we record # under the name 'TOTAL' to separate it from the individual tiers. data['points'].append(self._get_resource_usage(resources, 'TOTAL', iolen, cpulen)) @@ -742,6 +751,13 @@ class InfluxRecordingMixin(object): # Each tier also has the same resource stats as the top-level. for tier in resources['tiers']: data['points'].append(self._get_resource_usage(tier, tier['name'], iolen, cpulen)) + if 'duration' not in tier: + self.build_metrics_summary = None + elif self.build_metrics_summary: + self.build_metrics_summary['subtests'].append({ + 'name': tier['name'], + 'value': tier['duration'], + }) self.record_influx_stat([data]) diff --git a/testing/mozharness/mozharness/mozilla/building/buildbase.py b/testing/mozharness/mozharness/mozilla/building/buildbase.py index 7fddb74276a..fc781c8d3ed 100755 --- a/testing/mozharness/mozharness/mozilla/building/buildbase.py +++ b/testing/mozharness/mozharness/mozilla/building/buildbase.py @@ -1643,13 +1643,25 @@ or run without that action (ie: --no-{action})" installer_size = filesize else: size_measurements.append({'name': name, 'value': filesize}) + + perfherder_data = { + "framework": { + "name": "build_metrics" + }, + "suites": [], + } if installer_size or size_measurements: - self.info('PERFHERDER_DATA: %s' % (json.dumps({ - "framework": {"name": "build_metrics"}, - "suites": [{"name": "installer size", - "value": installer_size, - "subtests": size_measurements}] - }))) + perfherder_data["suites"].append({ + "name": "installer size", + "value": installer_size, + "subtests": size_measurements + }) + if (hasattr(self, "build_metrics_summary") and + self.build_metrics_summary): + perfherder_data["suites"].append(self.build_metrics_summary) + + if perfherder_data["suites"]: + self.info('PERFHERDER_DATA: %s' % json.dumps(perfherder_data)) def _set_file_properties(self, file_name, find_dir, prop_type, error_level=ERROR): From eb6607915c57c146600f822248c460f20cfbbb39 Mon Sep 17 00:00:00 2001 From: Cameron McCormack Date: Mon, 16 Nov 2015 19:18:45 +1100 Subject: [PATCH 05/55] Bug 1225004 - Record reason for NS_ERROR_FILE_CORRUPTED in nsLayoutStylesheetCache::LoadSheet in crash reports. r=roc --- layout/style/nsLayoutStylesheetCache.cpp | 44 +++++++++++++++++++++++- modules/libjar/nsJAR.cpp | 14 ++++++-- modules/libjar/nsJARInputStream.cpp | 12 +++++-- modules/libjar/nsZipArchive.cpp | 28 +++++++++++---- modules/libjar/nsZipArchive.h | 2 ++ xpcom/build/FileLocation.cpp | 6 +++- 6 files changed, 92 insertions(+), 14 deletions(-) diff --git a/layout/style/nsLayoutStylesheetCache.cpp b/layout/style/nsLayoutStylesheetCache.cpp index a3beca5f809..1295f361e60 100644 --- a/layout/style/nsLayoutStylesheetCache.cpp +++ b/layout/style/nsLayoutStylesheetCache.cpp @@ -27,6 +27,8 @@ #include "nsIChromeRegistry.h" #include "nsISimpleEnumerator.h" #include "nsISubstitutingProtocolHandler.h" +#include "zlib.h" +#include "nsZipArchive.h" #endif using namespace mozilla; @@ -469,6 +471,30 @@ nsLayoutStylesheetCache::LoadSheetFile(nsIFile* aFile, } #ifdef MOZ_CRASHREPORTER +static inline nsresult +ComputeCRC32(nsIFile* aFile, uint32_t* aResult) +{ + PRFileDesc* fd; + nsresult rv = aFile->OpenNSPRFileDesc(PR_RDONLY, 0, &fd); + NS_ENSURE_SUCCESS(rv, rv); + + uint32_t crc = crc32(0, nullptr, 0); + + unsigned char buf[512]; + int32_t n; + while ((n = PR_Read(fd, buf, sizeof(buf))) > 0) { + crc = crc32(crc, buf, n); + } + PR_Close(fd); + + if (n < 0) { + return NS_ERROR_FAILURE; + } + + *aResult = crc; + return NS_OK; +} + static void ListInterestingFiles(nsString& aAnnotation, nsIFile* aFile, const nsTArray& aInterestingFilenames) @@ -488,7 +514,14 @@ ListInterestingFiles(nsString& aAnnotation, nsIFile* aFile, } else { aAnnotation.AppendLiteral("???"); } - aAnnotation.AppendLiteral(" bytes)\n"); + aAnnotation.AppendLiteral(" bytes, crc32 = "); + uint32_t crc; + nsresult rv = ComputeCRC32(aFile, &crc); + if (NS_SUCCEEDED(rv)) { + aAnnotation.AppendPrintf("0x%08x)\n", crc); + } else { + aAnnotation.AppendPrintf("error 0x%08x)\n", uint32_t(rv)); + } return; } } @@ -553,6 +586,14 @@ AnnotateCrashReport(nsIURI* aURI) annotation.Append(NS_ConvertUTF8toUTF16(spec).get()); annotation.Append('\n'); + annotation.AppendLiteral("NS_ERROR_FILE_CORRUPTION reason: "); + if (nsZipArchive::sFileCorruptedReason) { + annotation.Append(NS_ConvertUTF8toUTF16(nsZipArchive::sFileCorruptedReason).get()); + annotation.Append('\n'); + } else { + annotation.AppendLiteral("(none)\n"); + } + // The jar: or file: URL that the sheet's resource: or chrome: URL // resolves to. if (scheme.EqualsLiteral("resource")) { @@ -739,6 +780,7 @@ nsLayoutStylesheetCache::LoadSheet(nsIURI* aURI, } + nsZipArchive::sFileCorruptedReason = nullptr; nsresult rv = gCSSLoader->LoadSheetSync(aURI, aParsingMode, true, getter_AddRefs(aSheet)); if (NS_FAILED(rv)) { diff --git a/modules/libjar/nsJAR.cpp b/modules/libjar/nsJAR.cpp index 8ea93e7a5d6..b50289124a3 100644 --- a/modules/libjar/nsJAR.cpp +++ b/modules/libjar/nsJAR.cpp @@ -446,14 +446,19 @@ nsJAR::LoadEntry(const nsACString &aFilename, char** aBuf, uint32_t* aBufLen) uint64_t len64; rv = manifestStream->Available(&len64); if (NS_FAILED(rv)) return rv; - NS_ENSURE_TRUE(len64 < UINT32_MAX, NS_ERROR_FILE_CORRUPTED); // bug 164695 + if (len64 >= UINT32_MAX) { // bug 164695 + nsZipArchive::sFileCorruptedReason = "nsJAR: invalid manifest size"; + return NS_ERROR_FILE_CORRUPTED; + } uint32_t len = (uint32_t)len64; buf = (char*)malloc(len+1); if (!buf) return NS_ERROR_OUT_OF_MEMORY; uint32_t bytesRead; rv = manifestStream->Read(buf, len, &bytesRead); - if (bytesRead != len) + if (bytesRead != len) { + nsZipArchive::sFileCorruptedReason = "nsJAR: manifest too small"; rv = NS_ERROR_FILE_CORRUPTED; + } if (NS_FAILED(rv)) { free(buf); return rv; @@ -539,6 +544,7 @@ nsJAR::ParseManifest() if (more) { mParsedManifest = true; + nsZipArchive::sFileCorruptedReason = "nsJAR: duplicate manifests"; return NS_ERROR_FILE_CORRUPTED; // More than one MF file } @@ -638,8 +644,10 @@ nsJAR::ParseOneFile(const char* filebuf, int16_t aFileType) curLine.Assign(filebuf, linelen); if ( ((aFileType == JAR_MF) && !curLine.Equals(JAR_MF_HEADER) ) || - ((aFileType == JAR_SF) && !curLine.Equals(JAR_SF_HEADER) ) ) + ((aFileType == JAR_SF) && !curLine.Equals(JAR_SF_HEADER) ) ) { + nsZipArchive::sFileCorruptedReason = "nsJAR: invalid manifest header"; return NS_ERROR_FILE_CORRUPTED; + } //-- Skip header section do { diff --git a/modules/libjar/nsJARInputStream.cpp b/modules/libjar/nsJARInputStream.cpp index 4a4c1d64cf3..4df5d7a0495 100644 --- a/modules/libjar/nsJARInputStream.cpp +++ b/modules/libjar/nsJARInputStream.cpp @@ -58,8 +58,10 @@ nsJARInputStream::InitFile(nsJAR *aJar, nsZipItem *item) // Must keep handle to filepointer and mmap structure as long as we need access to the mmapped data mFd = aJar->mZip->GetFD(); mZs.next_in = (Bytef *)aJar->mZip->GetData(item); - if (!mZs.next_in) + if (!mZs.next_in) { + nsZipArchive::sFileCorruptedReason = "nsJARInputStream: !mZs.next_in"; return NS_ERROR_FILE_CORRUPTED; + } mZs.avail_in = item->Size(); mOutSize = item->RealSize(); mZs.total_out = 0; @@ -266,8 +268,10 @@ nsJARInputStream::ContinueInflate(char* aBuffer, uint32_t aCount, // now inflate int zerr = inflate(&mZs, Z_SYNC_FLUSH); - if ((zerr != Z_OK) && (zerr != Z_STREAM_END)) + if ((zerr != Z_OK) && (zerr != Z_STREAM_END)) { + nsZipArchive::sFileCorruptedReason = "nsJARInputStream: error while inflating"; return NS_ERROR_FILE_CORRUPTED; + } *aBytesRead = (mZs.total_out - oldTotalOut); @@ -280,8 +284,10 @@ nsJARInputStream::ContinueInflate(char* aBuffer, uint32_t aCount, inflateEnd(&mZs); // stop returning valid data as soon as we know we have a bad CRC - if (mOutCrc != mInCrc) + if (mOutCrc != mInCrc) { + nsZipArchive::sFileCorruptedReason = "nsJARInputStream: crc mismatch"; return NS_ERROR_FILE_CORRUPTED; + } } return NS_OK; diff --git a/modules/libjar/nsZipArchive.cpp b/modules/libjar/nsZipArchive.cpp index 508319b5e75..568d0b68eab 100644 --- a/modules/libjar/nsZipArchive.cpp +++ b/modules/libjar/nsZipArchive.cpp @@ -444,6 +444,7 @@ nsresult nsZipArchive::ExtractFile(nsZipItem *item, const char *outname, uint32_t count = 0; uint8_t* buf = cursor.Read(&count); if (!buf) { + nsZipArchive::sFileCorruptedReason = "nsZipArchive: Read() failed to return a buffer"; rv = NS_ERROR_FILE_CORRUPTED; break; } else if (count == 0) { @@ -644,22 +645,28 @@ MOZ_WIN_MEM_TRY_BEGIN } } - if (!centralOffset) + if (!centralOffset) { + nsZipArchive::sFileCorruptedReason = "nsZipArchive: no central offset"; return NS_ERROR_FILE_CORRUPTED; + } buf = startp + centralOffset; // avoid overflow of startp + centralOffset. - if (buf < startp) + if (buf < startp) { + nsZipArchive::sFileCorruptedReason = "nsZipArchive: overflow looking for central directory"; return NS_ERROR_FILE_CORRUPTED; + } //-- Read the central directory headers uint32_t sig = 0; while (buf + int32_t(sizeof(uint32_t)) <= endp && (sig = xtolong(buf)) == CENTRALSIG) { // Make sure there is enough data available. - if (endp - buf < ZIPCENTRAL_SIZE) + if (endp - buf < ZIPCENTRAL_SIZE) { + nsZipArchive::sFileCorruptedReason = "nsZipArchive: central directory too small"; return NS_ERROR_FILE_CORRUPTED; + } // Read the fixed-size data. ZipCentral* central = (ZipCentral*)buf; @@ -672,9 +679,13 @@ MOZ_WIN_MEM_TRY_BEGIN // Sanity check variable sizes and refuse to deal with // anything too big: it's likely a corrupt archive. if (namelen < 1 || - namelen > kMaxNameLength || - buf >= buf + diff || // No overflow + namelen > kMaxNameLength) { + nsZipArchive::sFileCorruptedReason = "nsZipArchive: namelen out of range"; + return NS_ERROR_FILE_CORRUPTED; + } + if (buf >= buf + diff || // No overflow buf >= endp - diff) { + nsZipArchive::sFileCorruptedReason = "nsZipArchive: overflow looking for next item"; return NS_ERROR_FILE_CORRUPTED; } @@ -697,8 +708,10 @@ MOZ_WIN_MEM_TRY_BEGIN sig = 0; } /* while reading central directory records */ - if (sig != ENDSIG) + if (sig != ENDSIG) { + nsZipArchive::sFileCorruptedReason = "nsZipArchive: unexpected sig"; return NS_ERROR_FILE_CORRUPTED; + } // Make the comment available for consumers. if (endp - buf >= ZIPEND_SIZE) { @@ -1213,3 +1226,6 @@ nsZipItemPtr_base::nsZipItemPtr_base(nsZipArchive *aZip, return; } } + +/* static */ const char* +nsZipArchive::sFileCorruptedReason = nullptr; diff --git a/modules/libjar/nsZipArchive.h b/modules/libjar/nsZipArchive.h index 242ee4a3c8b..73a524e9918 100644 --- a/modules/libjar/nsZipArchive.h +++ b/modules/libjar/nsZipArchive.h @@ -102,6 +102,8 @@ class nsZipArchive final ~nsZipArchive(); public: + static const char* sFileCorruptedReason; + /** constructing does not open the archive. See OpenArchive() */ nsZipArchive(); diff --git a/xpcom/build/FileLocation.cpp b/xpcom/build/FileLocation.cpp index 67a558b4b10..73ea5c57852 100644 --- a/xpcom/build/FileLocation.cpp +++ b/xpcom/build/FileLocation.cpp @@ -233,7 +233,11 @@ FileLocation::Data::Copy(char* aBuf, uint32_t aLen) aLen, true); uint32_t readLen; cursor.Copy(&readLen); - return (readLen == aLen) ? NS_OK : NS_ERROR_FILE_CORRUPTED; + if (readLen != aLen) { + nsZipArchive::sFileCorruptedReason = "FileLocation::Data: insufficient data"; + return NS_ERROR_FILE_CORRUPTED; + } + return NS_OK; } #endif // !defined(MOZILLA_XPCOMRT_API) return NS_ERROR_NOT_INITIALIZED; From 896fe1e81dd2b446dc3c74e948c4d1fed62b287d Mon Sep 17 00:00:00 2001 From: Jim Blandy Date: Mon, 5 Oct 2015 13:57:39 -0700 Subject: [PATCH 06/55] Bug 1191765: Make Debugger.Object.prototype.getScript properly recognize functions without scripts. r=fitzgen --- .../tests/debug/Object-script-AsmJSNative.js | 15 +++++++++++++++ js/src/vm/Debugger.cpp | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 js/src/jit-test/tests/debug/Object-script-AsmJSNative.js diff --git a/js/src/jit-test/tests/debug/Object-script-AsmJSNative.js b/js/src/jit-test/tests/debug/Object-script-AsmJSNative.js new file mode 100644 index 00000000000..650b71374aa --- /dev/null +++ b/js/src/jit-test/tests/debug/Object-script-AsmJSNative.js @@ -0,0 +1,15 @@ +function test(stdlib, foreign) { + "use asm" + function f(y) { + y = +y; + } + return f; +}; +var g = newGlobal(); +g.parent = this; +g.eval(` + var dbg = new Debugger(); + var parentw = dbg.addDebuggee(parent); + var testw = parentw.makeDebuggeeValue(parent.test); + var scriptw = testw.script; +`); diff --git a/js/src/vm/Debugger.cpp b/js/src/vm/Debugger.cpp index dc9db7f74a4..a8cdf8ea01e 100644 --- a/js/src/vm/Debugger.cpp +++ b/js/src/vm/Debugger.cpp @@ -7099,7 +7099,7 @@ DebuggerObject_getScript(JSContext* cx, unsigned argc, Value* vp) } RootedFunction fun(cx, &obj->as()); - if (fun->isBuiltin()) { + if (!fun->isInterpreted()) { args.rval().setUndefined(); return true; } From d36f5706ceb91a58e8a0ff8b5fc52bdb243e33a4 Mon Sep 17 00:00:00 2001 From: Landry Breuil Date: Mon, 16 Nov 2015 23:14:16 +0100 Subject: [PATCH 07/55] Bug 911450: webrtc sndio audio_device backend r=jesup Most of the code originally from Alexandre Ratchov --- media/webrtc/trunk/webrtc/common_types.h | 3 +- .../modules/audio_device/audio_device_impl.cc | 9 + .../audio_device/include/audio_device.h | 3 +- .../audio_device/sndio/audio_device_sndio.cc | 1044 +++++++++++++++++ .../audio_device/sndio/audio_device_sndio.h | 203 ++++ .../sndio/audio_device_utility_sndio.cc | 53 + .../sndio/audio_device_utility_sndio.h | 36 + .../test/audio_device_test_api.cc | 6 + .../audio_device/test/func_test_manager.cc | 3 + .../webrtc/voice_engine/voe_hardware_impl.cc | 6 + 10 files changed, 1364 insertions(+), 2 deletions(-) create mode 100644 media/webrtc/trunk/webrtc/modules/audio_device/sndio/audio_device_sndio.cc create mode 100644 media/webrtc/trunk/webrtc/modules/audio_device/sndio/audio_device_sndio.h create mode 100644 media/webrtc/trunk/webrtc/modules/audio_device/sndio/audio_device_utility_sndio.cc create mode 100644 media/webrtc/trunk/webrtc/modules/audio_device/sndio/audio_device_utility_sndio.h diff --git a/media/webrtc/trunk/webrtc/common_types.h b/media/webrtc/trunk/webrtc/common_types.h index 17830a9c400..87b8b05cd24 100644 --- a/media/webrtc/trunk/webrtc/common_types.h +++ b/media/webrtc/trunk/webrtc/common_types.h @@ -491,7 +491,8 @@ enum AudioLayers kAudioWindowsWave = 1, kAudioWindowsCore = 2, kAudioLinuxAlsa = 3, - kAudioLinuxPulse = 4 + kAudioLinuxPulse = 4, + kAudioSndio = 5 }; // TODO(henrika): to be removed. diff --git a/media/webrtc/trunk/webrtc/modules/audio_device/audio_device_impl.cc b/media/webrtc/trunk/webrtc/modules/audio_device/audio_device_impl.cc index eeb5727aca7..e20f1a163a2 100644 --- a/media/webrtc/trunk/webrtc/modules/audio_device/audio_device_impl.cc +++ b/media/webrtc/trunk/webrtc/modules/audio_device/audio_device_impl.cc @@ -331,6 +331,7 @@ int32_t AudioDeviceModuleImpl::CreatePlatformSpecificObjects() if (ptrAudioDevice != NULL) { WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "attempting to use the Sndio audio API..."); + _platformAudioLayer = kSndioAudio; // Create the sndio implementation of the Device Utility. ptrAudioDeviceUtility = new AudioDeviceUtilitySndio(Id()); } @@ -623,6 +624,10 @@ int32_t AudioDeviceModuleImpl::ActiveAudioLayer(AudioLayer* audioLayer) const { WEBRTC_TRACE(kTraceStateInfo, kTraceAudioDevice, _id, "output: kLinuxAlsaAudio"); } + else if (*audioLayer == AudioDeviceModule::kSndioAudio) + { + WEBRTC_TRACE(kTraceStateInfo, kTraceAudioDevice, _id, "output: kSndioAudio"); + } else { WEBRTC_TRACE(kTraceStateInfo, kTraceAudioDevice, _id, "output: NOT_SUPPORTED"); @@ -2069,6 +2074,10 @@ AudioDeviceModule::AudioLayer AudioDeviceModuleImpl::PlatformAudioLayer() const WEBRTC_TRACE(kTraceStateInfo, kTraceAudioDevice, _id, "output: kLinuxAlsaAudio"); break; + case kSndioAudio: + WEBRTC_TRACE(kTraceStateInfo, kTraceAudioDevice, _id, + "output: kSndioAudio"); + break; case kDummyAudio: WEBRTC_TRACE(kTraceStateInfo, kTraceAudioDevice, _id, "output: kDummyAudio"); diff --git a/media/webrtc/trunk/webrtc/modules/audio_device/include/audio_device.h b/media/webrtc/trunk/webrtc/modules/audio_device/include/audio_device.h index ec40274de49..21603395517 100644 --- a/media/webrtc/trunk/webrtc/modules/audio_device/include/audio_device.h +++ b/media/webrtc/trunk/webrtc/modules/audio_device/include/audio_device.h @@ -29,7 +29,8 @@ class AudioDeviceModule : public RefCountedModule { kWindowsCoreAudio = 2, kLinuxAlsaAudio = 3, kLinuxPulseAudio = 4, - kDummyAudio = 5 + kSndioAudio = 5, + kDummyAudio = 6 }; enum WindowsDeviceType { diff --git a/media/webrtc/trunk/webrtc/modules/audio_device/sndio/audio_device_sndio.cc b/media/webrtc/trunk/webrtc/modules/audio_device/sndio/audio_device_sndio.cc new file mode 100644 index 00000000000..f6343dcd6e0 --- /dev/null +++ b/media/webrtc/trunk/webrtc/modules/audio_device/sndio/audio_device_sndio.cc @@ -0,0 +1,1044 @@ +/* + * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +#include +#include + +#include "webrtc/modules/audio_device/audio_device_config.h" +#include "webrtc/modules/audio_device/audio_device_utility.h" +#include "webrtc/modules/audio_device/sndio/audio_device_sndio.h" + +#include "webrtc/system_wrappers/interface/event_wrapper.h" +#include "webrtc/system_wrappers/interface/sleep.h" +#include "webrtc/system_wrappers/interface/thread_wrapper.h" +#include "webrtc/system_wrappers/interface/trace.h" + +#include "Latency.h" + +#define LOG_FIRST_CAPTURE(x) LogTime(AsyncLatencyLogger::AudioCaptureBase, \ + reinterpret_cast(x), 0) +#define LOG_CAPTURE_FRAMES(x, frames) LogLatency(AsyncLatencyLogger::AudioCapture, \ + reinterpret_cast(x), frames) +extern "C" +{ + static void playOnmove(void *arg, int delta) + { + static_cast(arg)->_playDelay -= delta; + } + + static void recOnmove(void *arg, int delta) + { + static_cast(arg)->_recDelay += delta; + } +} + +namespace webrtc +{ +AudioDeviceSndio::AudioDeviceSndio(const int32_t id) : + _ptrAudioBuffer(NULL), + _critSect(*CriticalSectionWrapper::CreateCriticalSection()), + _id(id), + _recordingBuffer(NULL), + _playoutBuffer(NULL), + _playBufType(AudioDeviceModule::kFixedBufferSize), + _initialized(false), + _playHandle(NULL), + _recHandle(NULL), + _recording(false), + _playing(false), + _AGC(false), + _playWarning(0), + _playError(0), + _recWarning(0), + _recError(0), + _playBufDelay(80), + _playBufDelayFixed(80) +{ + WEBRTC_TRACE(kTraceMemory, kTraceAudioDevice, id, + "%s created", __FUNCTION__); +} + +AudioDeviceSndio::~AudioDeviceSndio() +{ + WEBRTC_TRACE(kTraceMemory, kTraceAudioDevice, _id, + "%s destroyed", __FUNCTION__); + + Terminate(); + + // Clean up the recording buffer and playout buffer. + if (_recordingBuffer) + { + delete [] _recordingBuffer; + _recordingBuffer = NULL; + } + if (_playoutBuffer) + { + delete [] _playoutBuffer; + _playoutBuffer = NULL; + } + delete &_critSect; +} + +void AudioDeviceSndio::AttachAudioBuffer(AudioDeviceBuffer* audioBuffer) +{ + + CriticalSectionScoped lock(&_critSect); + + _ptrAudioBuffer = audioBuffer; + + // Inform the AudioBuffer about default settings for this implementation. + // Set all values to zero here since the actual settings will be done by + // InitPlayout and InitRecording later. + _ptrAudioBuffer->SetRecordingSampleRate(0); + _ptrAudioBuffer->SetPlayoutSampleRate(0); + _ptrAudioBuffer->SetRecordingChannels(0); + _ptrAudioBuffer->SetPlayoutChannels(0); +} + +int32_t AudioDeviceSndio::ActiveAudioLayer( + AudioDeviceModule::AudioLayer& audioLayer) const +{ + audioLayer = AudioDeviceModule::kSndioAudio; + return 0; +} + +int32_t AudioDeviceSndio::Init() +{ + + CriticalSectionScoped lock(&_critSect); + + if (_initialized) + { + return 0; + } + _playError = 0; + _recError = 0; + _initialized = true; + return 0; +} + +int32_t AudioDeviceSndio::Terminate() +{ + if (!_initialized) + { + return 0; + } + + CriticalSectionScoped lock(&_critSect); + + if (_playing) + { + StopPlayout(); + } + + if (_recording) + { + StopRecording(); + } + + if (_playHandle) + { + sio_close(_playHandle); + delete [] _playoutBuffer; + _playHandle = NULL; + } + + if (_recHandle) + { + sio_close(_recHandle); + delete [] _recordingBuffer; + _recHandle = NULL; + } + + _initialized = false; + return 0; +} + +bool AudioDeviceSndio::Initialized() const +{ + return (_initialized); +} + +int32_t AudioDeviceSndio::InitSpeaker() +{ + return 0; +} + + +int32_t AudioDeviceSndio::InitMicrophone() +{ + return 0; +} + +bool AudioDeviceSndio::SpeakerIsInitialized() const +{ + return true; +} + +bool AudioDeviceSndio::MicrophoneIsInitialized() const +{ + return true; +} + +int32_t AudioDeviceSndio::SpeakerVolumeIsAvailable(bool& available) +{ + available = true; + return 0; +} + +int32_t AudioDeviceSndio::SetSpeakerVolume(uint32_t volume) +{ + + CriticalSectionScoped lock(&_critSect); + + // XXX: call sio_onvol() + sio_setvol(_playHandle, volume); + return 0; +} + +int32_t AudioDeviceSndio::SpeakerVolume(uint32_t& volume) const +{ + + CriticalSectionScoped lock(&_critSect); + + // XXX: copy value reported by sio_onvol() call-back + volume = 0; + return 0; +} + +int32_t AudioDeviceSndio::SetWaveOutVolume(uint16_t volumeLeft, + uint16_t volumeRight) +{ + WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, + " API call not supported on this platform"); + return -1; +} + +int32_t AudioDeviceSndio::WaveOutVolume( + uint16_t& /*volumeLeft*/, + uint16_t& /*volumeRight*/) const +{ + WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, + " API call not supported on this platform"); + return -1; +} + +int32_t AudioDeviceSndio::MaxSpeakerVolume( + uint32_t& maxVolume) const +{ + maxVolume = SIO_MAXVOL; + return 0; +} + +int32_t AudioDeviceSndio::MinSpeakerVolume( + uint32_t& minVolume) const +{ + minVolume = 0; + return 0; +} + +int32_t AudioDeviceSndio::SpeakerVolumeStepSize( + uint16_t& stepSize) const +{ + stepSize = 1; + return 0; +} + +int32_t AudioDeviceSndio::SpeakerMuteIsAvailable(bool& available) +{ + available = false; + return 0; +} + +int32_t AudioDeviceSndio::SetSpeakerMute(bool enable) +{ + WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, + " API call not supported on this platform"); + return -1; +} + +int32_t AudioDeviceSndio::SpeakerMute(bool& enabled) const +{ + WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, + " API call not supported on this platform"); + return -1; +} + +int32_t AudioDeviceSndio::MicrophoneMuteIsAvailable(bool& available) +{ + available = false; + return 0; +} + +int32_t AudioDeviceSndio::SetMicrophoneMute(bool enable) +{ + WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, + " API call not supported on this platform"); + return -1; +} + +int32_t AudioDeviceSndio::MicrophoneMute(bool& enabled) const +{ + WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, + " API call not supported on this platform"); + return -1; +} + +int32_t AudioDeviceSndio::MicrophoneBoostIsAvailable(bool& available) +{ + available = false; + return 0; +} + +int32_t AudioDeviceSndio::SetMicrophoneBoost(bool enable) +{ + WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, + " API call not supported on this platform"); + return -1; +} + +int32_t AudioDeviceSndio::MicrophoneBoost(bool& enabled) const +{ + WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, + " API call not supported on this platform"); + return -1; +} + +int32_t AudioDeviceSndio::StereoRecordingIsAvailable(bool& available) +{ + available = true; + return 0; +} + +int32_t AudioDeviceSndio::SetStereoRecording(bool enable) +{ + + if (enable) + { + _recChannels = 2; + } else { + _recChannels = 1; + } + return 0; +} + +int32_t AudioDeviceSndio::StereoRecording(bool& enabled) const +{ + + if (_recChannels == 2) + { + enabled = true; + } else { + enabled = false; + } + return 0; +} + +int32_t AudioDeviceSndio::StereoPlayoutIsAvailable(bool& available) +{ + available = true; + return 0; +} + +int32_t AudioDeviceSndio::SetStereoPlayout(bool enable) +{ + + if (enable) + { + _playChannels = 2; + } else { + _playChannels = 1; + } + return 0; +} + +int32_t AudioDeviceSndio::StereoPlayout(bool& enabled) const +{ + if (_playChannels == 2) + { + enabled = true; + } else { + enabled = false; + } + return 0; +} + +int32_t AudioDeviceSndio::SetAGC(bool enable) +{ + _AGC = enable; + + return 0; +} + +bool AudioDeviceSndio::AGC() const +{ + return _AGC; +} + +int32_t AudioDeviceSndio::MicrophoneVolumeIsAvailable(bool& available) +{ + available = false; + return 0; +} + +int32_t AudioDeviceSndio::SetMicrophoneVolume(uint32_t volume) +{ + WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, + " API call not supported on this platform"); + return -1; +} + +int32_t AudioDeviceSndio::MicrophoneVolume(uint32_t& volume) const +{ + WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, + " API call not supported on this platform"); + return -1; +} + +int32_t AudioDeviceSndio::MaxMicrophoneVolume( + uint32_t& maxVolume) const +{ + WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, + " API call not supported on this platform"); + return -1; +} + +int32_t AudioDeviceSndio::MinMicrophoneVolume( + uint32_t& minVolume) const +{ + WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, + " API call not supported on this platform"); + return -1; +} + +int32_t AudioDeviceSndio::MicrophoneVolumeStepSize( + uint16_t& stepSize) const +{ + return -1; + WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, + " API call not supported on this platform"); +} + +int16_t AudioDeviceSndio::PlayoutDevices() +{ + return 1; +} + +int32_t AudioDeviceSndio::SetPlayoutDevice(uint16_t index) +{ + if (index != 0) { + WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id, + " device index != 0"); + return -1; + } + return 0; +} + +int32_t AudioDeviceSndio::SetPlayoutDevice( + AudioDeviceModule::WindowsDeviceType /*device*/) +{ + WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id, + "WindowsDeviceType not supported"); + return -1; +} + +int32_t AudioDeviceSndio::PlayoutDeviceName( + uint16_t index, + char name[kAdmMaxDeviceNameSize], + char guid[kAdmMaxGuidSize]) +{ + + if (index != 0 || (name == NULL)) + { + return -1; + } + + strlcpy(name, SIO_DEVANY, kAdmMaxDeviceNameSize); + + if (guid != NULL) + { + memset(guid, 0, kAdmMaxGuidSize); + } + + return 0; +} + +int32_t AudioDeviceSndio::RecordingDeviceName( + uint16_t index, + char name[kAdmMaxDeviceNameSize], + char guid[kAdmMaxGuidSize]) +{ + + if (index != 0 || (name == NULL)) + { + return -1; + } + + strlcpy(name, SIO_DEVANY, kAdmMaxDeviceNameSize); + + if (guid != NULL) + { + memset(guid, 0, kAdmMaxGuidSize); + } + + return 0; +} + +int16_t AudioDeviceSndio::RecordingDevices() +{ + return 1; +} + +int32_t AudioDeviceSndio::SetRecordingDevice(uint16_t index) +{ + if (index != 0) + { + WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id, + " device index != 0"); + return -1; + } + return 0; +} + +int32_t AudioDeviceSndio::SetRecordingDevice( + AudioDeviceModule::WindowsDeviceType /*device*/) +{ + WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id, + "WindowsDeviceType not supported"); + return -1; +} + +int32_t AudioDeviceSndio::PlayoutIsAvailable(bool& available) +{ + struct sio_hdl *hdl; + + hdl = sio_open(SIO_DEVANY, SIO_PLAY, 0); + if (hdl == NULL) + { + available = false; + } else { + sio_close(hdl); + available = true; + } + return 0; +} + +int32_t AudioDeviceSndio::RecordingIsAvailable(bool& available) +{ + struct sio_hdl *hdl; + + hdl = sio_open(SIO_DEVANY, SIO_REC, 0); + if (hdl == NULL) + { + available = false; + } else { + sio_close(hdl); + available = true; + } + return 0; +} + +int32_t AudioDeviceSndio::InitPlayout() +{ + CriticalSectionScoped lock(&_critSect); + if (_playing) { + return -1; + } + + if (_playHandle != NULL) + { + return 0; + } + + _playHandle = sio_open(SIO_DEVANY, SIO_PLAY, 0); + if (_playHandle == NULL) + { + WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id, + " Error opening play device"); + return -1; + } + + sio_initpar(&_playParams); + _playParams.rate = 48000; + _playParams.pchan = 2; + _playParams.bits = 16; + _playParams.sig = 1; + _playParams.le = SIO_LE_NATIVE; + _playParams.appbufsz = _playParams.rate * 40 / 1000; + + if (!sio_setpar(_playHandle, &_playParams)) + { + WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id, + " Error setting _playParams"); + sio_close(_playHandle); + _playHandle = NULL; + return -1; + } + if (!sio_getpar(_playHandle, &_playParams)) + { + WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id, + " Error getting _playParams"); + sio_close(_playHandle); + _playHandle = NULL; + return -1; + } + + _playFrames = _playParams.rate / 100; + _playoutBuffer = new int8_t[_playFrames * + _playParams.bps * + _playParams.pchan]; + if (_playoutBuffer == NULL) + { + WEBRTC_TRACE(kTraceCritical, kTraceAudioDevice, _id, + " failed to alloc play buffer"); + sio_close(_playHandle); + _playHandle = NULL; + return -1; + } + + if (_ptrAudioBuffer) + { + // Update webrtc audio buffer with the selected parameters + _ptrAudioBuffer->SetPlayoutSampleRate(_playParams.rate); + _ptrAudioBuffer->SetPlayoutChannels(_playParams.pchan); + } + + _playDelay = 0; + sio_onmove(_playHandle, playOnmove, this); + return 0; +} + +int32_t AudioDeviceSndio::InitRecording() +{ + CriticalSectionScoped lock(&_critSect); + + if (_recording) + { + return -1; + } + + if (_recHandle != NULL) + { + return 0; + } + + _recHandle = sio_open(SIO_DEVANY, SIO_REC, 0); + if (_recHandle == NULL) + { + WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id, + " Error opening rec device"); + return -1; + } + + sio_initpar(&_recParams); + _recParams.rate = 48000; + _recParams.rchan = 2; + _recParams.bits = 16; + _recParams.sig = 1; + _recParams.le = SIO_LE_NATIVE; + _recParams.appbufsz = _recParams.rate * 40 / 1000; + + if (!sio_setpar(_recHandle, &_recParams)) + { + WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id, + " Error setting _recParams"); + sio_close(_recHandle); + _recHandle = NULL; + return -1; + } + if (!sio_getpar(_recHandle, &_recParams)) + { + WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id, + " Error getting _recParams"); + sio_close(_recHandle); + _recHandle = NULL; + return -1; + } + + _recFrames = _recParams.rate / 100; + _recordingBuffer = new int8_t[_recFrames * + _recParams.bps * + _recParams.rchan]; + if (_recordingBuffer == NULL) + { + WEBRTC_TRACE(kTraceCritical, kTraceAudioDevice, _id, + " failed to alloc rec buffer"); + sio_close(_recHandle); + _recHandle = NULL; + return -1; + } + + if (_ptrAudioBuffer) + { + _ptrAudioBuffer->SetRecordingSampleRate(_recParams.rate); + _ptrAudioBuffer->SetRecordingChannels(_recParams.rchan); + } + + _recDelay = 0; + sio_onmove(_recHandle, recOnmove, this); + return 0; +} + +int32_t AudioDeviceSndio::StartRecording() +{ + unsigned int unused_thread_id; + const char* threadName = "webrtc_audio_module_capture_thread"; + + if (_recHandle == NULL) + { + return -1; + } + + if (_recording) + { + return 0; + } + + _ptrThreadRec = ThreadWrapper::CreateThread(RecThreadFunc, + this, + kRealtimePriority, + threadName); + if (_ptrThreadRec == NULL) + { + WEBRTC_TRACE(kTraceCritical, kTraceAudioDevice, _id, + " failed to create the rec audio thread"); + _recording = false; + delete [] _recordingBuffer; + _recordingBuffer = NULL; + return -1; + } + + _playDelay = 0; + + if (!sio_start(_recHandle)) + { + WEBRTC_TRACE(kTraceCritical, kTraceAudioDevice, _id, + " couldn't start recording"); + delete _ptrThreadRec; + _ptrThreadRec = NULL; + delete [] _recordingBuffer; + _recordingBuffer = NULL; + return -1; + } + + if (!_ptrThreadRec->Start(unused_thread_id)) + { + WEBRTC_TRACE(kTraceCritical, kTraceAudioDevice, _id, + " failed to start the rec audio thread"); + _recording = false; + sio_stop(_recHandle); + delete _ptrThreadRec; + _ptrThreadRec = NULL; + delete [] _recordingBuffer; + _recordingBuffer = NULL; + return -1; + } + _recording = true; + return 0; +} + +int32_t AudioDeviceSndio::StopRecording() +{ + + CriticalSectionScoped lock(&_critSect); + + if (_recHandle == NULL) + { + return 0; + } + + _recording = false; + + if (_ptrThreadRec && !_ptrThreadRec->Stop()) + { + WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id, + " failed to stop the rec audio thread"); + return -1; + } + + sio_stop(_recHandle); + + delete _ptrThreadRec; + _ptrThreadRec = NULL; + return 0; +} + +bool AudioDeviceSndio::RecordingIsInitialized() const +{ + return (_recHandle != NULL); +} + +bool AudioDeviceSndio::Recording() const +{ + return (_recording); +} + +bool AudioDeviceSndio::PlayoutIsInitialized() const +{ + return (_playHandle != NULL); +} + +int32_t AudioDeviceSndio::StartPlayout() +{ + unsigned int unused_thread_id; + const char* threadName = "webrtc_audio_module_play_thread"; + + if (_playHandle == NULL) + { + return -1; + } + + if (_playing) + { + return 0; + } + + _ptrThreadPlay = ThreadWrapper::CreateThread(PlayThreadFunc, + this, + kRealtimePriority, + threadName); + if (_ptrThreadPlay == NULL) + { + WEBRTC_TRACE(kTraceCritical, kTraceAudioDevice, _id, + " failed to create the play audio thread"); + _playing = false; + delete [] _playoutBuffer; + _playoutBuffer = NULL; + return -1; + } + + if (!sio_start(_playHandle)) { + WEBRTC_TRACE(kTraceCritical, kTraceAudioDevice, _id, + " failed to start audio playback"); + delete _ptrThreadPlay; + _ptrThreadPlay = NULL; + delete [] _playoutBuffer; + _playoutBuffer = NULL; + return -1; + } + + if (!_ptrThreadPlay->Start(unused_thread_id)) + { + WEBRTC_TRACE(kTraceCritical, kTraceAudioDevice, _id, + " failed to start the play audio thread"); + sio_stop(_playHandle); + delete _ptrThreadPlay; + _ptrThreadPlay = NULL; + delete [] _playoutBuffer; + _playoutBuffer = NULL; + return -1; + } + _playing = true; + return 0; +} + +int32_t AudioDeviceSndio::StopPlayout() +{ + CriticalSectionScoped lock(&_critSect); + if (_playHandle == NULL) + { + return 0; + } + _playing = false; + + if (_ptrThreadPlay && !_ptrThreadPlay->Stop()) + { + WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id, + " failed to stop the play audio thread"); + return -1; + } else { + delete _ptrThreadPlay; + _ptrThreadPlay = NULL; + } + + sio_stop(_playHandle); + + CriticalSectionScoped lock(&_critSect); + + delete [] _playoutBuffer; + _playoutBuffer = NULL; + delete _ptrThreadPlay; + _ptrThreadPlay = NULL; + return 0; +} + +int32_t AudioDeviceSndio::PlayoutDelay(uint16_t& delayMS) const +{ + CriticalSectionScoped lock(&_critSect); + delayMS = (uint16_t) (_playDelay * 1000) / _playParams.rate; + return 0; +} + +int32_t AudioDeviceSndio::RecordingDelay(uint16_t& delayMS) const +{ + CriticalSectionScoped lock(&_critSect); + delayMS = (uint16_t) (_recDelay * 1000) / _recParams.rate; + return 0; +} + +bool AudioDeviceSndio::Playing() const +{ + return (_playing); +} +// ---------------------------------------------------------------------------- +// SetPlayoutBuffer +// ---------------------------------------------------------------------------- + +int32_t AudioDeviceSndio::SetPlayoutBuffer( + const AudioDeviceModule::BufferType type, + uint16_t sizeMS) +{ + _playBufType = type; + if (type == AudioDeviceModule::kFixedBufferSize) + { + _playBufDelayFixed = sizeMS; + } + return 0; +} + +int32_t AudioDeviceSndio::PlayoutBuffer( + AudioDeviceModule::BufferType& type, + uint16_t& sizeMS) const +{ + type = _playBufType; + if (type == AudioDeviceModule::kFixedBufferSize) + { + sizeMS = _playBufDelayFixed; + } else { + sizeMS = _playBufDelay; + } + return 0; +} + +int32_t AudioDeviceSndio::CPULoad(uint16_t& load) const +{ + + WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, + " API call not supported on this platform"); + return -1; +} + +bool AudioDeviceSndio::PlayoutWarning() const +{ + CriticalSectionScoped lock(&_critSect); + return (_playWarning > 0); +} + +bool AudioDeviceSndio::PlayoutError() const +{ + CriticalSectionScoped lock(&_critSect); + return (_playError > 0); +} + +bool AudioDeviceSndio::RecordingWarning() const +{ + CriticalSectionScoped lock(&_critSect); + return (_recWarning > 0); +} + +bool AudioDeviceSndio::RecordingError() const +{ + CriticalSectionScoped lock(&_critSect); + return (_recError > 0); +} + +void AudioDeviceSndio::ClearPlayoutWarning() +{ + CriticalSectionScoped lock(&_critSect); + _playWarning = 0; +} + +void AudioDeviceSndio::ClearPlayoutError() +{ + CriticalSectionScoped lock(&_critSect); + _playError = 0; +} + +void AudioDeviceSndio::ClearRecordingWarning() +{ + CriticalSectionScoped lock(&_critSect); + _recWarning = 0; +} + +void AudioDeviceSndio::ClearRecordingError() +{ + CriticalSectionScoped lock(&_critSect); + _recError = 0; +} + +bool AudioDeviceSndio::PlayThreadFunc(void* pThis) +{ + return (static_cast(pThis)->PlayThreadProcess()); +} + +bool AudioDeviceSndio::RecThreadFunc(void* pThis) +{ + return (static_cast(pThis)->RecThreadProcess()); +} + +bool AudioDeviceSndio::PlayThreadProcess() +{ + int n; + bool res; + + res = true; + CriticalSectionScoped lock(&_critSect); + // XXX: update volume here + _ptrAudioBuffer->RequestPlayoutData(_playFrames); + n = _ptrAudioBuffer->GetPlayoutData(_playoutBuffer); + sio_write(_playHandle, _playoutBuffer, n * + _playParams.bps * + _playParams.pchan); + if (sio_eof(_playHandle)) + { + res = false; + _playError = 1; + } + _playDelay += n; + _critSect.Leave(); + return res; +} + +bool AudioDeviceSndio::RecThreadProcess() +{ + int n, todo; + int8_t *data; + bool res; + + res = true; + CriticalSectionScoped lock(&_critSect); + data = _recordingBuffer; + todo = _recFrames * _recParams.bps * _recParams.rchan; + while (todo > 0) + { + n = sio_read(_recHandle, data, todo); + if (n == 0) + { + WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id, + "sio_read failed, device disconnected?"); + res = false; + _recError = 1; + break; + } + data += n; + todo -= n; + } + if (res) + { + _ptrAudioBuffer->SetVQEData( + _playDelay * 1000 / _playParams.rate, + _recDelay * 1000 / _recParams.rate, 0); + _ptrAudioBuffer->SetRecordedBuffer(_recordingBuffer, _recFrames); + _ptrAudioBuffer->DeliverRecordedData(); + } + _recDelay -= _recFrames; + return res; +} +} // namespace "webrtc" diff --git a/media/webrtc/trunk/webrtc/modules/audio_device/sndio/audio_device_sndio.h b/media/webrtc/trunk/webrtc/modules/audio_device/sndio/audio_device_sndio.h new file mode 100644 index 00000000000..6103183e61c --- /dev/null +++ b/media/webrtc/trunk/webrtc/modules/audio_device/sndio/audio_device_sndio.h @@ -0,0 +1,203 @@ +/* + * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +#ifndef WEBRTC_AUDIO_DEVICE_AUDIO_DEVICE_SNDIO_H +#define WEBRTC_AUDIO_DEVICE_AUDIO_DEVICE_SNDIO_H + +#include + +#include "webrtc/modules/audio_device/audio_device_generic.h" +#include "webrtc/system_wrappers/interface/critical_section_wrapper.h" +#include "webrtc/system_wrappers/interface/thread_wrapper.h" + +namespace webrtc +{ +class AudioDeviceSndio : public AudioDeviceGeneric +{ +public: + AudioDeviceSndio(const int32_t id); + virtual ~AudioDeviceSndio(); + + // Retrieve the currently utilized audio layer + virtual int32_t ActiveAudioLayer( + AudioDeviceModule::AudioLayer& audioLayer) const OVERRIDE; + + // Main initializaton and termination + virtual int32_t Init() OVERRIDE; + virtual int32_t Terminate() OVERRIDE; + virtual bool Initialized() const OVERRIDE; + + // Device enumeration + virtual int16_t PlayoutDevices() OVERRIDE; + virtual int16_t RecordingDevices() OVERRIDE; + virtual int32_t PlayoutDeviceName( + uint16_t index, + char name[kAdmMaxDeviceNameSize], + char guid[kAdmMaxGuidSize]) OVERRIDE; + virtual int32_t RecordingDeviceName( + uint16_t index, + char name[kAdmMaxDeviceNameSize], + char guid[kAdmMaxGuidSize]) OVERRIDE; + + // Device selection + virtual int32_t SetPlayoutDevice(uint16_t index) OVERRIDE; + virtual int32_t SetPlayoutDevice( + AudioDeviceModule::WindowsDeviceType device) OVERRIDE; + virtual int32_t SetRecordingDevice(uint16_t index) OVERRIDE; + virtual int32_t SetRecordingDevice( + AudioDeviceModule::WindowsDeviceType device) OVERRIDE; + + // Audio transport initialization + virtual int32_t PlayoutIsAvailable(bool& available) OVERRIDE; + virtual int32_t InitPlayout() OVERRIDE; + virtual bool PlayoutIsInitialized() const OVERRIDE; + virtual int32_t RecordingIsAvailable(bool& available) OVERRIDE; + virtual int32_t InitRecording() OVERRIDE; + virtual bool RecordingIsInitialized() const OVERRIDE; + + // Audio transport control + virtual int32_t StartPlayout() OVERRIDE; + virtual int32_t StopPlayout() OVERRIDE; + virtual bool Playing() const OVERRIDE; + virtual int32_t StartRecording() OVERRIDE; + virtual int32_t StopRecording() OVERRIDE; + virtual bool Recording() const OVERRIDE; + + // Microphone Automatic Gain Control (AGC) + virtual int32_t SetAGC(bool enable) OVERRIDE; + virtual bool AGC() const OVERRIDE; + + // Volume control based on the Windows Wave API (Windows only) + virtual int32_t SetWaveOutVolume(uint16_t volumeLeft, + uint16_t volumeRight) OVERRIDE; + virtual int32_t WaveOutVolume(uint16_t& volumeLeft, + uint16_t& volumeRight) const OVERRIDE; + + // Audio mixer initialization + virtual int32_t InitSpeaker() OVERRIDE; + virtual bool SpeakerIsInitialized() const OVERRIDE; + virtual int32_t InitMicrophone() OVERRIDE; + virtual bool MicrophoneIsInitialized() const OVERRIDE; + + // Speaker volume controls + virtual int32_t SpeakerVolumeIsAvailable(bool& available) OVERRIDE; + virtual int32_t SetSpeakerVolume(uint32_t volume) OVERRIDE; + virtual int32_t SpeakerVolume(uint32_t& volume) const OVERRIDE; + virtual int32_t MaxSpeakerVolume(uint32_t& maxVolume) const OVERRIDE; + virtual int32_t MinSpeakerVolume(uint32_t& minVolume) const OVERRIDE; + virtual int32_t SpeakerVolumeStepSize(uint16_t& stepSize) const OVERRIDE; + + // Microphone volume controls + virtual int32_t MicrophoneVolumeIsAvailable(bool& available) OVERRIDE; + virtual int32_t SetMicrophoneVolume(uint32_t volume) OVERRIDE; + virtual int32_t MicrophoneVolume(uint32_t& volume) const OVERRIDE; + virtual int32_t MaxMicrophoneVolume(uint32_t& maxVolume) const OVERRIDE; + virtual int32_t MinMicrophoneVolume(uint32_t& minVolume) const OVERRIDE; + virtual int32_t MicrophoneVolumeStepSize( + uint16_t& stepSize) const OVERRIDE; + + // Speaker mute control + virtual int32_t SpeakerMuteIsAvailable(bool& available) OVERRIDE; + virtual int32_t SetSpeakerMute(bool enable) OVERRIDE; + virtual int32_t SpeakerMute(bool& enabled) const OVERRIDE; + + // Microphone mute control + virtual int32_t MicrophoneMuteIsAvailable(bool& available) OVERRIDE; + virtual int32_t SetMicrophoneMute(bool enable) OVERRIDE; + virtual int32_t MicrophoneMute(bool& enabled) const OVERRIDE; + + // Microphone boost control + virtual int32_t MicrophoneBoostIsAvailable(bool& available) OVERRIDE; + virtual int32_t SetMicrophoneBoost(bool enable) OVERRIDE; + virtual int32_t MicrophoneBoost(bool& enabled) const OVERRIDE; + + // Stereo support + virtual int32_t StereoPlayoutIsAvailable(bool& available) OVERRIDE; + virtual int32_t SetStereoPlayout(bool enable) OVERRIDE; + virtual int32_t StereoPlayout(bool& enabled) const OVERRIDE; + virtual int32_t StereoRecordingIsAvailable(bool& available) OVERRIDE; + virtual int32_t SetStereoRecording(bool enable) OVERRIDE; + virtual int32_t StereoRecording(bool& enabled) const OVERRIDE; + + // Delay information and control + virtual int32_t SetPlayoutBuffer( + const AudioDeviceModule::BufferType type, + uint16_t sizeMS) OVERRIDE; + virtual int32_t PlayoutBuffer( + AudioDeviceModule::BufferType& type, + uint16_t& sizeMS) const OVERRIDE; + virtual int32_t PlayoutDelay(uint16_t& delayMS) const OVERRIDE; + virtual int32_t RecordingDelay(uint16_t& delayMS) const OVERRIDE; + + virtual int32_t CPULoad(uint16_t& load) const OVERRIDE; + +public: + virtual bool PlayoutWarning() const OVERRIDE; + virtual bool PlayoutError() const OVERRIDE; + virtual bool RecordingWarning() const OVERRIDE; + virtual bool RecordingError() const OVERRIDE; + virtual void ClearPlayoutWarning() OVERRIDE; + virtual void ClearPlayoutError() OVERRIDE; + virtual void ClearRecordingWarning() OVERRIDE; + virtual void ClearRecordingError() OVERRIDE; + + virtual void AttachAudioBuffer(AudioDeviceBuffer* audioBuffer) OVERRIDE; + + // needs to be public because playOnmove/recOnmove are extern "C" ? + int _recDelay, _playDelay; + + +private: + static bool RecThreadFunc(void *); + static bool PlayThreadFunc(void *); + bool RecThreadProcess(); + bool PlayThreadProcess(); + +private: + AudioDeviceBuffer* _ptrAudioBuffer; + + struct sio_hdl* _playHandle; + struct sio_hdl* _recHandle; + struct sio_par _playParams, _recParams; + + CriticalSectionWrapper& _critSect; + + ThreadWrapper* _ptrThreadRec; + ThreadWrapper* _ptrThreadPlay; + + int32_t _id; + + int8_t* _recordingBuffer; + int8_t* _playoutBuffer; + uint8_t _recChannels; + uint8_t _playChannels; + + unsigned int _recFrames; + unsigned int _playFrames; + + AudioDeviceModule::BufferType _playBufType; + + bool _initialized; + bool _recording; + bool _playing; + bool _AGC; + + uint16_t _playWarning; + uint16_t _playError; + uint16_t _recWarning; + uint16_t _recError; + + uint16_t _playBufDelay; // playback delay + uint16_t _playBufDelayFixed; // fixed playback delay +}; + +} + +#endif diff --git a/media/webrtc/trunk/webrtc/modules/audio_device/sndio/audio_device_utility_sndio.cc b/media/webrtc/trunk/webrtc/modules/audio_device/sndio/audio_device_utility_sndio.cc new file mode 100644 index 00000000000..f0e9f3b65c0 --- /dev/null +++ b/media/webrtc/trunk/webrtc/modules/audio_device/sndio/audio_device_utility_sndio.cc @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +#include "webrtc/modules/audio_device/sndio/audio_device_utility_sndio.h" +#include "webrtc/system_wrappers/interface/critical_section_wrapper.h" +#include "webrtc/system_wrappers/interface/trace.h" + +namespace webrtc +{ + +AudioDeviceUtilitySndio::AudioDeviceUtilitySndio(const int32_t id) : + _critSect(*CriticalSectionWrapper::CreateCriticalSection()), _id(id) +{ + WEBRTC_TRACE(kTraceMemory, kTraceAudioDevice, id, + "%s created", __FUNCTION__); +} + +AudioDeviceUtilitySndio::~AudioDeviceUtilitySndio() +{ + WEBRTC_TRACE(kTraceMemory, kTraceAudioDevice, _id, + "%s destroyed", __FUNCTION__); + { + CriticalSectionScoped lock(&_critSect); + + // XXX free stuff here... + } + + delete &_critSect; +} + +// ============================================================================ +// API +// ============================================================================ + + +int32_t AudioDeviceUtilitySndio::Init() +{ + + WEBRTC_TRACE(kTraceStateInfo, kTraceAudioDevice, _id, + " OS info: %s", "POSIX using sndio"); + + return 0; +} + + +} // namespace webrtc diff --git a/media/webrtc/trunk/webrtc/modules/audio_device/sndio/audio_device_utility_sndio.h b/media/webrtc/trunk/webrtc/modules/audio_device/sndio/audio_device_utility_sndio.h new file mode 100644 index 00000000000..1b702647ef3 --- /dev/null +++ b/media/webrtc/trunk/webrtc/modules/audio_device/sndio/audio_device_utility_sndio.h @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +#ifndef WEBRTC_AUDIO_DEVICE_AUDIO_DEVICE_UTILITY_SNDIO_H +#define WEBRTC_AUDIO_DEVICE_AUDIO_DEVICE_UTILITY_SNDIO_H + +#include "webrtc/modules/audio_device/audio_device_utility.h" +#include "webrtc/modules/audio_device/include/audio_device.h" + +namespace webrtc +{ +class CriticalSectionWrapper; + +class AudioDeviceUtilitySndio: public AudioDeviceUtility +{ +public: + AudioDeviceUtilitySndio(const int32_t id); + virtual ~AudioDeviceUtilitySndio(); + + virtual int32_t Init() OVERRIDE; + +private: + CriticalSectionWrapper& _critSect; + int32_t _id; +}; + +} // namespace webrtc + +#endif diff --git a/media/webrtc/trunk/webrtc/modules/audio_device/test/audio_device_test_api.cc b/media/webrtc/trunk/webrtc/modules/audio_device/test/audio_device_test_api.cc index 6e30f6d705c..db398b5e1b7 100644 --- a/media/webrtc/trunk/webrtc/modules/audio_device/test/audio_device_test_api.cc +++ b/media/webrtc/trunk/webrtc/modules/audio_device/test/audio_device_test_api.cc @@ -179,6 +179,8 @@ class AudioDeviceAPITest: public testing::Test { #if defined(_WIN32) EXPECT_TRUE((audio_device_ = AudioDeviceModuleImpl::Create( kId, AudioDeviceModule::kLinuxAlsaAudio)) == NULL); + EXPECT_TRUE((audio_device_ = AudioDeviceModuleImpl::Create( + kId, AudioDeviceModule::kSndioAudio)) == NULL); #if defined(WEBRTC_WINDOWS_CORE_AUDIO_BUILD) TEST_LOG("WEBRTC_WINDOWS_CORE_AUDIO_BUILD is defined!\n\n"); // create default implementation (=Core Audio) instance @@ -217,6 +219,8 @@ class AudioDeviceAPITest: public testing::Test { kId, AudioDeviceModule::kWindowsCoreAudio)) == NULL); EXPECT_TRUE((audio_device_ = AudioDeviceModuleImpl::Create( kId, AudioDeviceModule::kLinuxAlsaAudio)) == NULL); + EXPECT_TRUE((audio_device_ = AudioDeviceModuleImpl::Create( + kId, AudioDeviceModule::kSndioAudio)) == NULL); EXPECT_TRUE((audio_device_ = AudioDeviceModuleImpl::Create( kId, AudioDeviceModule::kLinuxPulseAudio)) == NULL); // Create default implementation instance @@ -248,6 +252,8 @@ class AudioDeviceAPITest: public testing::Test { kId, AudioDeviceModule::kLinuxAlsaAudio)) == NULL); EXPECT_TRUE((audio_device_ = AudioDeviceModuleImpl::Create( kId, AudioDeviceModule::kLinuxPulseAudio)) == NULL); + EXPECT_TRUE((audio_device_ = AudioDeviceModuleImpl::Create( + kId, AudioDeviceModule::kSndioAudio)) == NULL); // Create default implementation instance EXPECT_TRUE((audio_device_ = AudioDeviceModuleImpl::Create( kId, AudioDeviceModule::kPlatformDefaultAudio)) != NULL); diff --git a/media/webrtc/trunk/webrtc/modules/audio_device/test/func_test_manager.cc b/media/webrtc/trunk/webrtc/modules/audio_device/test/func_test_manager.cc index 975dea114a9..826a2232d61 100644 --- a/media/webrtc/trunk/webrtc/modules/audio_device/test/func_test_manager.cc +++ b/media/webrtc/trunk/webrtc/modules/audio_device/test/func_test_manager.cc @@ -736,6 +736,9 @@ int32_t FuncTestManager::TestAudioLayerSelection() } else if (audioLayer == AudioDeviceModule::kLinuxPulseAudio) { TEST_LOG("\nActiveAudioLayer: kLinuxPulseAudio\n \n"); + } else if (audioLayer == AudioDeviceModule::kSndioAudio) + { + TEST_LOG("\nActiveAudioLayer: kSndioAudio\n \n"); } else { TEST_LOG("\nActiveAudioLayer: INVALID\n \n"); diff --git a/media/webrtc/trunk/webrtc/voice_engine/voe_hardware_impl.cc b/media/webrtc/trunk/webrtc/voice_engine/voe_hardware_impl.cc index 896572f1086..921701b21f7 100644 --- a/media/webrtc/trunk/webrtc/voice_engine/voe_hardware_impl.cc +++ b/media/webrtc/trunk/webrtc/voice_engine/voe_hardware_impl.cc @@ -81,6 +81,9 @@ int VoEHardwareImpl::SetAudioDeviceLayer(AudioLayers audioLayer) case kAudioLinuxPulse: wantedLayer = AudioDeviceModule::kLinuxPulseAudio; break; + case kAudioSndio: + wantedLayer = AudioDeviceModule::kSndioAudio; + break; } // Save the audio device layer for Init() @@ -133,6 +136,9 @@ int VoEHardwareImpl::GetAudioDeviceLayer(AudioLayers& audioLayer) case AudioDeviceModule::kLinuxPulseAudio: audioLayer = kAudioLinuxPulse; break; + case AudioDeviceModule::kSndioAudio: + audioLayer = kAudioSndio; + break; default: _shared->SetLastError(VE_UNDEFINED_SC_ERR, kTraceError, " unknown audio layer"); From 1d9e6da57b927c19de0788be48b5b6d406b145db Mon Sep 17 00:00:00 2001 From: Matt Woodrow Date: Tue, 17 Nov 2015 11:36:38 +1300 Subject: [PATCH 08/55] Bug 1219230 - Use the valid region for determining buffer size instead of the visible region. r=mstange --- gfx/layers/client/SingleTiledContentClient.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gfx/layers/client/SingleTiledContentClient.cpp b/gfx/layers/client/SingleTiledContentClient.cpp index 17c136f9459..51f20ff007e 100644 --- a/gfx/layers/client/SingleTiledContentClient.cpp +++ b/gfx/layers/client/SingleTiledContentClient.cpp @@ -120,9 +120,9 @@ ClientSingleTiledLayerBuffer::PaintThebes(const nsIntRegion& aNewValidRegion, LayerManager::DrawPaintedLayerCallback aCallback, void* aCallbackData) { - // Compare layer visible region size to current backbuffer size, discard if not matching. - IntSize size = mPaintedLayer->GetVisibleRegion().GetBounds().Size(); - IntPoint origin = mPaintedLayer->GetVisibleRegion().GetBounds().TopLeft(); + // Compare layer valid region size to current backbuffer size, discard if not matching. + IntSize size = aNewValidRegion.GetBounds().Size(); + IntPoint origin = aNewValidRegion.GetBounds().TopLeft(); nsIntRegion paintRegion = aPaintRegion; if (mSize != size || mTilingOrigin != origin) { From 8013c9199c3ff100031dbded533d2303f8827b4e Mon Sep 17 00:00:00 2001 From: Matt Woodrow Date: Thu, 12 Nov 2015 15:23:11 +1300 Subject: [PATCH 09/55] Bug 1212823 - Use correct coordinate space for box-shadow native rect when doing themed drawing. r=roc --- layout/base/nsCSSRendering.cpp | 5 +++-- layout/reftests/box-shadow/1212823-1-ref.html | 7 +++++++ layout/reftests/box-shadow/1212823-1.html | 6 ++++++ layout/reftests/box-shadow/reftest.list | 1 + 4 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 layout/reftests/box-shadow/1212823-1-ref.html create mode 100644 layout/reftests/box-shadow/1212823-1.html diff --git a/layout/base/nsCSSRendering.cpp b/layout/base/nsCSSRendering.cpp index 55c364bcd05..c9b2b13bd23 100644 --- a/layout/base/nsCSSRendering.cpp +++ b/layout/base/nsCSSRendering.cpp @@ -1382,8 +1382,9 @@ nsCSSRendering::PaintBoxShadowOuter(nsPresContext* aPresContext, shadowContext->SetMatrix( shadowContext->CurrentMatrix().Translate(devPixelOffset)); - nsRect nativeRect; - nativeRect.IntersectRect(frameRect, aDirtyRect); + nsRect nativeRect = aDirtyRect; + nativeRect.MoveBy(-nsPoint(shadowItem->mXOffset, shadowItem->mYOffset)); + nativeRect.IntersectRect(frameRect, nativeRect); nsRenderingContext wrapperCtx(shadowContext); aPresContext->GetTheme()->DrawWidgetBackground(&wrapperCtx, aForFrame, styleDisplay->mAppearance, aFrameArea, nativeRect); diff --git a/layout/reftests/box-shadow/1212823-1-ref.html b/layout/reftests/box-shadow/1212823-1-ref.html new file mode 100644 index 00000000000..91cf26d3ccc --- /dev/null +++ b/layout/reftests/box-shadow/1212823-1-ref.html @@ -0,0 +1,7 @@ + + + +
+ + + diff --git a/layout/reftests/box-shadow/1212823-1.html b/layout/reftests/box-shadow/1212823-1.html new file mode 100644 index 00000000000..2337ddf75f1 --- /dev/null +++ b/layout/reftests/box-shadow/1212823-1.html @@ -0,0 +1,6 @@ + + + + + + diff --git a/layout/reftests/box-shadow/reftest.list b/layout/reftests/box-shadow/reftest.list index e6dabf77756..a5a57d1c32a 100644 --- a/layout/reftests/box-shadow/reftest.list +++ b/layout/reftests/box-shadow/reftest.list @@ -36,3 +36,4 @@ fuzzy-if(winWidget,5,30) == fieldset.html fieldset-ref.html # minor anti-aliasin fuzzy-if(winWidget,5,30) == fieldset-inset.html fieldset-inset-ref.html # minor anti-aliasing problem on Windows == 1178575.html 1178575-ref.html == 1178575-2.html 1178575-2-ref.html +fuzzy(159,2) fails-if(!d2d) == 1212823-1.html 1212823-1-ref.html From 2c2377c7bd06b0cb206f23d46db8a340a3d04596 Mon Sep 17 00:00:00 2001 From: Andrea Marchesini Date: Mon, 16 Nov 2015 22:41:03 +0000 Subject: [PATCH 10/55] Bug 1218433 - Use AsyncOpen2 in dom/workers/ScriptLoader.cpp - part 1, r=sicking --- dom/html/test/file_iframe_sandbox_g_if1.html | 9 +- .../general/frameStoragePrevented.html | 24 +- dom/workers/ScriptLoader.cpp | 211 +++++++++--------- dom/workers/test/test_loadError.html | 76 +++---- .../WorkerUtils/importScripts/004.html.ini | 5 - .../WorkerUtils/importScripts/006.html.ini | 6 - 6 files changed, 162 insertions(+), 169 deletions(-) delete mode 100644 testing/web-platform/meta/workers/interfaces/WorkerUtils/importScripts/004.html.ini delete mode 100644 testing/web-platform/meta/workers/interfaces/WorkerUtils/importScripts/006.html.ini diff --git a/dom/html/test/file_iframe_sandbox_g_if1.html b/dom/html/test/file_iframe_sandbox_g_if1.html index 90ca6074acf..9a985faf974 100644 --- a/dom/html/test/file_iframe_sandbox_g_if1.html +++ b/dom/html/test/file_iframe_sandbox_g_if1.html @@ -42,14 +42,9 @@ // test loading with relative url - this should fail since we are // sandboxed and have a null principal - try { - var worker_js = new Worker('file_iframe_sandbox_worker.js'); - } catch (e) { - ok(e.name === "SecurityError", "a worker in a sandboxed document should throw when loading from a relative URI"); - } - + var worker_js = new Worker('file_iframe_sandbox_worker.js'); worker_js.onerror = function(error) { - ok(false, "a worker in a sandboxed document should not tell the load error via error event"); + ok(true, "a worker in a sandboxed document should tell the load error via error event"); } worker_js.addEventListener('message', function(event) { diff --git a/dom/tests/mochitest/general/frameStoragePrevented.html b/dom/tests/mochitest/general/frameStoragePrevented.html index b29cf2c9d02..3554d6082c8 100644 --- a/dom/tests/mochitest/general/frameStoragePrevented.html +++ b/dom/tests/mochitest/general/frameStoragePrevented.html @@ -4,7 +4,7 @@ frame for storage prevented test - - - - - - - - - -

- - - - + + + NPAPI Cookie Tests + + + + + + + + + +

+ + + + diff --git a/dom/plugins/test/mochitest/test_instantiation.html b/dom/plugins/test/mochitest/test_instantiation.html index d84d39ebdd3..923a81469bb 100644 --- a/dom/plugins/test/mochitest/test_instantiation.html +++ b/dom/plugins/test/mochitest/test_instantiation.html @@ -1,33 +1,33 @@ - - Plugin instantiation - - - - - - - + + Plugin instantiation + + + + + + + diff --git a/dom/plugins/test/mochitest/test_npruntime_construct.html b/dom/plugins/test/mochitest/test_npruntime_construct.html index f481884f9f9..25f4f664cc8 100644 --- a/dom/plugins/test/mochitest/test_npruntime_construct.html +++ b/dom/plugins/test/mochitest/test_npruntime_construct.html @@ -1,32 +1,32 @@ - - - - Test whether windowless plugins receive correct visible/invisible notifications. - - - - - - - -

- - - - + + + + Test whether windowless plugins receive correct visible/invisible notifications. + + + + + + + +

+ + + + diff --git a/dom/plugins/test/mochitest/test_npruntime_identifiers.html b/dom/plugins/test/mochitest/test_npruntime_identifiers.html index 33b5d41b812..7fedcb02542 100644 --- a/dom/plugins/test/mochitest/test_npruntime_identifiers.html +++ b/dom/plugins/test/mochitest/test_npruntime_identifiers.html @@ -1,67 +1,67 @@ - - - NPN_Invoke Tests - - - - - -

- - - - - - - + + + NPN_Invoke Tests + + + + + +

+ + + + + + + diff --git a/dom/plugins/test/mochitest/test_pluginstream_src_dynamic.html b/dom/plugins/test/mochitest/test_pluginstream_src_dynamic.html index b679008a3dc..0abedcec17e 100644 --- a/dom/plugins/test/mochitest/test_pluginstream_src_dynamic.html +++ b/dom/plugins/test/mochitest/test_pluginstream_src_dynamic.html @@ -1,43 +1,43 @@ - - - NPAPI src="" NPStream Test - - - - - - - -

- - - - - - - - + + + NPAPI src="" NPStream Test + + + + + + + +

+ + + + + + + + diff --git a/dom/plugins/test/mochitest/test_positioning.html b/dom/plugins/test/mochitest/test_positioning.html index 666a841a73b..f288498521c 100644 --- a/dom/plugins/test/mochitest/test_positioning.html +++ b/dom/plugins/test/mochitest/test_positioning.html @@ -1,56 +1,56 @@ - - - - Test whether windowless plugins receive correct visible/invisible notifications. - - - - - - - -

- - - - + + + + Test whether windowless plugins receive correct visible/invisible notifications. + + + + + + + +

+ + + + diff --git a/dom/plugins/test/mochitest/test_twostreams.html b/dom/plugins/test/mochitest/test_twostreams.html index 1e69aa16550..6f31d0b15ac 100644 --- a/dom/plugins/test/mochitest/test_twostreams.html +++ b/dom/plugins/test/mochitest/test_twostreams.html @@ -1,46 +1,46 @@ - - - Dual NPAPI NP_ASFILEONLY NPStream Test - - - - - -

- - - - - - - - - + + + Dual NPAPI NP_ASFILEONLY NPStream Test + + + + + +

+ + + + + + + + + diff --git a/dom/plugins/test/mochitest/test_visibility.html b/dom/plugins/test/mochitest/test_visibility.html index 023e9844d76..9633a7b95fa 100644 --- a/dom/plugins/test/mochitest/test_visibility.html +++ b/dom/plugins/test/mochitest/test_visibility.html @@ -1,100 +1,100 @@ - - - - Test whether windowless plugins receive correct visible/invisible notifications. - - - - - - -

- - - - - - - + + + + Test whether windowless plugins receive correct visible/invisible notifications. + + + + + + +

+ + + + + + + diff --git a/dom/plugins/test/mochitest/test_xulbrowser_plugin_visibility.xul b/dom/plugins/test/mochitest/test_xulbrowser_plugin_visibility.xul index 3872eb0eb0b..e0c81c97edd 100644 --- a/dom/plugins/test/mochitest/test_xulbrowser_plugin_visibility.xul +++ b/dom/plugins/test/mochitest/test_xulbrowser_plugin_visibility.xul @@ -1,24 +1,24 @@ - - - - - - - - - - - + + + + + + + + + + + diff --git a/dom/plugins/test/mochitest/test_zero_opacity.html b/dom/plugins/test/mochitest/test_zero_opacity.html index 5c868e482e3..b31039f7509 100644 --- a/dom/plugins/test/mochitest/test_zero_opacity.html +++ b/dom/plugins/test/mochitest/test_zero_opacity.html @@ -1,44 +1,44 @@ - - - - Test whether windowed plugins with opacity:0 get their window set correctly - - - - - - - -

- + + + + Test whether windowed plugins with opacity:0 get their window set correctly + + + + + + + +

+ \ No newline at end of file diff --git a/dom/plugins/test/mochitest/xulbrowser_plugin_visibility.xul b/dom/plugins/test/mochitest/xulbrowser_plugin_visibility.xul index a0e3fc4e107..3a4413ad658 100644 --- a/dom/plugins/test/mochitest/xulbrowser_plugin_visibility.xul +++ b/dom/plugins/test/mochitest/xulbrowser_plugin_visibility.xul @@ -1,139 +1,139 @@ - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + From eb6e5906ad561b7311d01eb924e9da6f60db5af9 Mon Sep 17 00:00:00 2001 From: Xidorn Quan Date: Tue, 17 Nov 2015 09:54:12 +1100 Subject: [PATCH 14/55] Bug 1213710 part 2 - Rename dom/plugins/test/mochitest/utils.js to plugin-utils.js. r=bsmedberg So that files outside this dir can also reference it without conflict. --- dom/plugins/test/mochitest/chrome.ini | 2 +- dom/plugins/test/mochitest/mochitest.ini | 2 +- dom/plugins/test/mochitest/{utils.js => plugin-utils.js} | 0 dom/plugins/test/mochitest/test_CrashService_crash.html | 2 +- dom/plugins/test/mochitest/test_CrashService_hang.html | 2 +- dom/plugins/test/mochitest/test_GCrace.html | 2 +- dom/plugins/test/mochitest/test_NPNVdocumentOrigin.html | 2 +- .../test/mochitest/test_NPPVpluginWantsAllNetworkStreams.html | 2 +- dom/plugins/test/mochitest/test_bug1092842.html | 2 +- dom/plugins/test/mochitest/test_bug1165981.html | 2 +- dom/plugins/test/mochitest/test_bug406541.html | 2 +- dom/plugins/test/mochitest/test_bug479979.xul | 2 +- dom/plugins/test/mochitest/test_bug532208.html | 2 +- dom/plugins/test/mochitest/test_bug539565-1.html | 2 +- dom/plugins/test/mochitest/test_bug539565-2.html | 2 +- dom/plugins/test/mochitest/test_bug738396.html | 2 +- dom/plugins/test/mochitest/test_bug751809.html | 2 +- dom/plugins/test/mochitest/test_bug771202.html | 2 +- dom/plugins/test/mochitest/test_bug777098.html | 2 +- dom/plugins/test/mochitest/test_bug784131.html | 2 +- dom/plugins/test/mochitest/test_bug813906.html | 2 +- dom/plugins/test/mochitest/test_bug852315.html | 2 +- dom/plugins/test/mochitest/test_bug854082.html | 2 +- dom/plugins/test/mochitest/test_bug863792.html | 2 +- dom/plugins/test/mochitest/test_bug967694.html | 2 +- dom/plugins/test/mochitest/test_bug985859.html | 2 +- dom/plugins/test/mochitest/test_bug986930.html | 2 +- dom/plugins/test/mochitest/test_busy_hang.xul | 2 +- dom/plugins/test/mochitest/test_clear_site_data.html | 2 +- dom/plugins/test/mochitest/test_cocoa_focus.html | 2 +- dom/plugins/test/mochitest/test_cocoa_window_focus.html | 2 +- dom/plugins/test/mochitest/test_convertpoint.xul | 2 +- dom/plugins/test/mochitest/test_cookies.html | 2 +- dom/plugins/test/mochitest/test_copyText.html | 2 +- dom/plugins/test/mochitest/test_crash_nested_loop.html | 2 +- dom/plugins/test/mochitest/test_crash_notify.xul | 2 +- dom/plugins/test/mochitest/test_crash_notify_no_report.xul | 2 +- dom/plugins/test/mochitest/test_crash_submit.xul | 2 +- dom/plugins/test/mochitest/test_crashing.html | 2 +- dom/plugins/test/mochitest/test_crashing2.html | 2 +- dom/plugins/test/mochitest/test_defaultValue.html | 2 +- dom/plugins/test/mochitest/test_enumerate.html | 2 +- dom/plugins/test/mochitest/test_fullpage.html | 2 +- dom/plugins/test/mochitest/test_getauthenticationinfo.html | 2 +- dom/plugins/test/mochitest/test_hang_submit.xul | 2 +- dom/plugins/test/mochitest/test_hanging.html | 2 +- dom/plugins/test/mochitest/test_hangui.xul | 2 +- dom/plugins/test/mochitest/test_idle_hang.xul | 2 +- dom/plugins/test/mochitest/test_instance_re-parent.html | 2 +- dom/plugins/test/mochitest/test_instance_unparent1.html | 2 +- dom/plugins/test/mochitest/test_instance_unparent2.html | 2 +- dom/plugins/test/mochitest/test_instance_unparent3.html | 2 +- dom/plugins/test/mochitest/test_instantiation.html | 2 +- dom/plugins/test/mochitest/test_mixed_case_mime.html | 2 +- dom/plugins/test/mochitest/test_multipleinstanceobjects.html | 2 +- dom/plugins/test/mochitest/test_newstreamondestroy.html | 2 +- dom/plugins/test/mochitest/test_npn_asynccall.html | 2 +- dom/plugins/test/mochitest/test_npn_timers.html | 2 +- dom/plugins/test/mochitest/test_npobject_getters.html | 2 +- dom/plugins/test/mochitest/test_npruntime.xul | 2 +- dom/plugins/test/mochitest/test_npruntime_construct.html | 2 +- dom/plugins/test/mochitest/test_npruntime_identifiers.html | 2 +- dom/plugins/test/mochitest/test_npruntime_npnevaluate.html | 2 +- dom/plugins/test/mochitest/test_npruntime_npninvoke.html | 2 +- dom/plugins/test/mochitest/test_npruntime_npninvokedefault.html | 2 +- dom/plugins/test/mochitest/test_painting.html | 2 +- dom/plugins/test/mochitest/test_plugin_scroll_painting.html | 2 +- dom/plugins/test/mochitest/test_plugin_tag_clicktoplay.html | 2 +- dom/plugins/test/mochitest/test_pluginstream_asfile.html | 2 +- dom/plugins/test/mochitest/test_pluginstream_asfileonly.html | 2 +- dom/plugins/test/mochitest/test_pluginstream_err.html | 2 +- dom/plugins/test/mochitest/test_pluginstream_geturl.html | 2 +- dom/plugins/test/mochitest/test_pluginstream_geturlnotify.html | 2 +- dom/plugins/test/mochitest/test_pluginstream_newstream.html | 2 +- dom/plugins/test/mochitest/test_pluginstream_post.html | 2 +- dom/plugins/test/mochitest/test_pluginstream_poststream.html | 2 +- dom/plugins/test/mochitest/test_pluginstream_referer.html | 2 +- dom/plugins/test/mochitest/test_pluginstream_seek.html | 2 +- dom/plugins/test/mochitest/test_pluginstream_seek_close.html | 2 +- dom/plugins/test/mochitest/test_pluginstream_src.html | 2 +- dom/plugins/test/mochitest/test_pluginstream_src_dynamic.html | 2 +- dom/plugins/test/mochitest/test_pluginstream_src_referer.html | 2 +- dom/plugins/test/mochitest/test_positioning.html | 2 +- dom/plugins/test/mochitest/test_privatemode_perwindowpb.xul | 2 +- dom/plugins/test/mochitest/test_propertyAndMethod.html | 2 +- dom/plugins/test/mochitest/test_queryContentsScaleFactor.html | 2 +- dom/plugins/test/mochitest/test_redirect_handling.html | 2 +- dom/plugins/test/mochitest/test_refresh_navigator_plugins.html | 2 +- dom/plugins/test/mochitest/test_secondPlugin.html | 2 +- dom/plugins/test/mochitest/test_src_url_change.html | 2 +- dom/plugins/test/mochitest/test_streamNotify.html | 2 +- dom/plugins/test/mochitest/test_streamatclose.html | 2 +- dom/plugins/test/mochitest/test_stringHandling.html | 2 +- dom/plugins/test/mochitest/test_twostreams.html | 2 +- dom/plugins/test/mochitest/test_visibility.html | 2 +- dom/plugins/test/mochitest/test_windowed_invalidate.html | 2 +- dom/plugins/test/mochitest/test_wmode.xul | 2 +- .../test/mochitest/test_xulbrowser_plugin_visibility.xul | 2 +- dom/plugins/test/mochitest/test_zero_opacity.html | 2 +- dom/plugins/test/mochitest/xulbrowser_plugin_visibility.xul | 2 +- 100 files changed, 99 insertions(+), 99 deletions(-) rename dom/plugins/test/mochitest/{utils.js => plugin-utils.js} (100%) diff --git a/dom/plugins/test/mochitest/chrome.ini b/dom/plugins/test/mochitest/chrome.ini index f4068f90c40..5a6d8378663 100644 --- a/dom/plugins/test/mochitest/chrome.ini +++ b/dom/plugins/test/mochitest/chrome.ini @@ -3,7 +3,7 @@ skip-if = (buildapp == 'b2g' || buildapp == 'mulet') support-files = hang_test.js privatemode_perwindowpb.xul - utils.js + plugin-utils.js [test_bug479979.xul] [test_bug751809.html] diff --git a/dom/plugins/test/mochitest/mochitest.ini b/dom/plugins/test/mochitest/mochitest.ini index 98811fdc7f1..6494bc7ac9b 100644 --- a/dom/plugins/test/mochitest/mochitest.ini +++ b/dom/plugins/test/mochitest/mochitest.ini @@ -20,7 +20,7 @@ support-files = plugin_window.html pluginstream.js post.sjs - utils.js + plugin-utils.js [test_GCrace.html] [test_NPNVdocumentOrigin.html] diff --git a/dom/plugins/test/mochitest/utils.js b/dom/plugins/test/mochitest/plugin-utils.js similarity index 100% rename from dom/plugins/test/mochitest/utils.js rename to dom/plugins/test/mochitest/plugin-utils.js diff --git a/dom/plugins/test/mochitest/test_CrashService_crash.html b/dom/plugins/test/mochitest/test_CrashService_crash.html index 1e9d19dc7e2..65cf7273125 100644 --- a/dom/plugins/test/mochitest/test_CrashService_crash.html +++ b/dom/plugins/test/mochitest/test_CrashService_crash.html @@ -1,7 +1,7 @@ nsICrashService plugin crash - + - + - + diff --git a/dom/plugins/test/mochitest/test_NPNVdocumentOrigin.html b/dom/plugins/test/mochitest/test_NPNVdocumentOrigin.html index 21902e6899f..75ec66e1389 100644 --- a/dom/plugins/test/mochitest/test_NPNVdocumentOrigin.html +++ b/dom/plugins/test/mochitest/test_NPNVdocumentOrigin.html @@ -2,7 +2,7 @@ Test NPNVdocumentOrigin - + - + - + diff --git a/dom/plugins/test/mochitest/test_bug1165981.html b/dom/plugins/test/mochitest/test_bug1165981.html index 853e602c9a5..c585e8cb65e 100644 --- a/dom/plugins/test/mochitest/test_bug1165981.html +++ b/dom/plugins/test/mochitest/test_bug1165981.html @@ -3,7 +3,7 @@ Bug 1165981 Test - + diff --git a/dom/plugins/test/mochitest/test_bug406541.html b/dom/plugins/test/mochitest/test_bug406541.html index 0a386bce5e5..6ce9d4554f9 100644 --- a/dom/plugins/test/mochitest/test_bug406541.html +++ b/dom/plugins/test/mochitest/test_bug406541.html @@ -3,7 +3,7 @@ Test for Bug 406541 - + diff --git a/dom/plugins/test/mochitest/test_bug479979.xul b/dom/plugins/test/mochitest/test_bug479979.xul index c669b21dcdc..1f295cbeb5c 100644 --- a/dom/plugins/test/mochitest/test_bug479979.xul +++ b/dom/plugins/test/mochitest/test_bug479979.xul @@ -6,7 +6,7 @@ xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> + - + diff --git a/dom/plugins/test/mochitest/test_bug539565-1.html b/dom/plugins/test/mochitest/test_bug539565-1.html index 72574172408..022b8cfc61e 100644 --- a/dom/plugins/test/mochitest/test_bug539565-1.html +++ b/dom/plugins/test/mochitest/test_bug539565-1.html @@ -7,7 +7,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=539565 Test #1 for Bug 539565 - + - + - + diff --git a/dom/plugins/test/mochitest/test_bug751809.html b/dom/plugins/test/mochitest/test_bug751809.html index 509ecb163d9..4fc3baacee6 100644 --- a/dom/plugins/test/mochitest/test_bug751809.html +++ b/dom/plugins/test/mochitest/test_bug751809.html @@ -4,7 +4,7 @@ - + - + diff --git a/dom/plugins/test/mochitest/test_bug777098.html b/dom/plugins/test/mochitest/test_bug777098.html index 79a2559ff06..77ba9ed316f 100644 --- a/dom/plugins/test/mochitest/test_bug777098.html +++ b/dom/plugins/test/mochitest/test_bug777098.html @@ -7,7 +7,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=777098 Test for Bug 777098 - + diff --git a/dom/plugins/test/mochitest/test_bug784131.html b/dom/plugins/test/mochitest/test_bug784131.html index eac426bb628..ff2dd19c17d 100644 --- a/dom/plugins/test/mochitest/test_bug784131.html +++ b/dom/plugins/test/mochitest/test_bug784131.html @@ -3,7 +3,7 @@ Test for Bug 784131 - + diff --git a/dom/plugins/test/mochitest/test_bug813906.html b/dom/plugins/test/mochitest/test_bug813906.html index 4ee9d08a567..04c34daafe8 100644 --- a/dom/plugins/test/mochitest/test_bug813906.html +++ b/dom/plugins/test/mochitest/test_bug813906.html @@ -3,7 +3,7 @@ Test for Bug 813906 - + diff --git a/dom/plugins/test/mochitest/test_bug852315.html b/dom/plugins/test/mochitest/test_bug852315.html index 5649912a286..cbbc3d34a8d 100644 --- a/dom/plugins/test/mochitest/test_bug852315.html +++ b/dom/plugins/test/mochitest/test_bug852315.html @@ -3,7 +3,7 @@ Test for Bug 852315 - + diff --git a/dom/plugins/test/mochitest/test_bug854082.html b/dom/plugins/test/mochitest/test_bug854082.html index b6537289ecb..ff3d1e1e860 100644 --- a/dom/plugins/test/mochitest/test_bug854082.html +++ b/dom/plugins/test/mochitest/test_bug854082.html @@ -3,7 +3,7 @@ Test for Bug 854082 - + diff --git a/dom/plugins/test/mochitest/test_bug863792.html b/dom/plugins/test/mochitest/test_bug863792.html index 0bb60f89e74..ccd0fc83c9a 100644 --- a/dom/plugins/test/mochitest/test_bug863792.html +++ b/dom/plugins/test/mochitest/test_bug863792.html @@ -3,7 +3,7 @@ Test for Bug 863792 - + diff --git a/dom/plugins/test/mochitest/test_bug967694.html b/dom/plugins/test/mochitest/test_bug967694.html index eae26419f04..8a7602134df 100644 --- a/dom/plugins/test/mochitest/test_bug967694.html +++ b/dom/plugins/test/mochitest/test_bug967694.html @@ -3,7 +3,7 @@ Test for Bug 967694 - + diff --git a/dom/plugins/test/mochitest/test_bug985859.html b/dom/plugins/test/mochitest/test_bug985859.html index 695b4dfb4b1..1a4329ab4a7 100644 --- a/dom/plugins/test/mochitest/test_bug985859.html +++ b/dom/plugins/test/mochitest/test_bug985859.html @@ -3,7 +3,7 @@ Test for Bug 985859 - + diff --git a/dom/plugins/test/mochitest/test_bug986930.html b/dom/plugins/test/mochitest/test_bug986930.html index 620f93913fc..f86539e58f3 100644 --- a/dom/plugins/test/mochitest/test_bug986930.html +++ b/dom/plugins/test/mochitest/test_bug986930.html @@ -5,7 +5,7 @@ Test for Bug 986930 - + + diff --git a/dom/plugins/test/mochitest/test_clear_site_data.html b/dom/plugins/test/mochitest/test_clear_site_data.html index 770254f2a9f..5aeb887c32c 100644 --- a/dom/plugins/test/mochitest/test_clear_site_data.html +++ b/dom/plugins/test/mochitest/test_clear_site_data.html @@ -3,7 +3,7 @@ NPAPI ClearSiteData/GetSitesWithData Functionality - + - + diff --git a/dom/plugins/test/mochitest/test_cocoa_window_focus.html b/dom/plugins/test/mochitest/test_cocoa_window_focus.html index c94f25a6f1d..3458c24eb9c 100644 --- a/dom/plugins/test/mochitest/test_cocoa_window_focus.html +++ b/dom/plugins/test/mochitest/test_cocoa_window_focus.html @@ -2,7 +2,7 @@ NPCocoaEventWindowFocusChanged Tests - + diff --git a/dom/plugins/test/mochitest/test_convertpoint.xul b/dom/plugins/test/mochitest/test_convertpoint.xul index c121cf4d1d3..5db01a253ee 100644 --- a/dom/plugins/test/mochitest/test_convertpoint.xul +++ b/dom/plugins/test/mochitest/test_convertpoint.xul @@ -6,7 +6,7 @@ xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> + diff --git a/dom/plugins/test/mochitest/test_cookies.html b/dom/plugins/test/mochitest/test_cookies.html index 6e1934994fd..f5279677066 100644 --- a/dom/plugins/test/mochitest/test_cookies.html +++ b/dom/plugins/test/mochitest/test_cookies.html @@ -2,7 +2,7 @@ NPAPI Cookie Tests - + diff --git a/dom/plugins/test/mochitest/test_copyText.html b/dom/plugins/test/mochitest/test_copyText.html index c2f51f1a8d0..bed7db977d6 100644 --- a/dom/plugins/test/mochitest/test_copyText.html +++ b/dom/plugins/test/mochitest/test_copyText.html @@ -3,7 +3,7 @@ Test copying text from browser to plugin - + - + + diff --git a/dom/plugins/test/mochitest/test_crash_notify_no_report.xul b/dom/plugins/test/mochitest/test_crash_notify_no_report.xul index b304c82ef5d..a1344bf0f4f 100644 --- a/dom/plugins/test/mochitest/test_crash_notify_no_report.xul +++ b/dom/plugins/test/mochitest/test_crash_notify_no_report.xul @@ -6,7 +6,7 @@ xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> + diff --git a/dom/plugins/test/mochitest/test_crash_submit.xul b/dom/plugins/test/mochitest/test_crash_submit.xul index f6e10afc0ac..22f39384b5a 100644 --- a/dom/plugins/test/mochitest/test_crash_submit.xul +++ b/dom/plugins/test/mochitest/test_crash_submit.xul @@ -8,7 +8,7 @@ src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" /> + diff --git a/dom/plugins/test/mochitest/test_crashing.html b/dom/plugins/test/mochitest/test_crashing.html index 741e3660caa..eac6e42bef9 100644 --- a/dom/plugins/test/mochitest/test_crashing.html +++ b/dom/plugins/test/mochitest/test_crashing.html @@ -1,7 +1,7 @@ Plugin crashing - + - + diff --git a/dom/plugins/test/mochitest/test_defaultValue.html b/dom/plugins/test/mochitest/test_defaultValue.html index d886aed6d61..2cbe52efe0e 100644 --- a/dom/plugins/test/mochitest/test_defaultValue.html +++ b/dom/plugins/test/mochitest/test_defaultValue.html @@ -3,7 +3,7 @@ NPObject [[DefaultValue]] implementation - + diff --git a/dom/plugins/test/mochitest/test_enumerate.html b/dom/plugins/test/mochitest/test_enumerate.html index 74e7344786e..af8431c7cc8 100644 --- a/dom/plugins/test/mochitest/test_enumerate.html +++ b/dom/plugins/test/mochitest/test_enumerate.html @@ -2,7 +2,7 @@ NPAPI Cookie Tests - + diff --git a/dom/plugins/test/mochitest/test_fullpage.html b/dom/plugins/test/mochitest/test_fullpage.html index 18ef16380d9..680eb73a010 100644 --- a/dom/plugins/test/mochitest/test_fullpage.html +++ b/dom/plugins/test/mochitest/test_fullpage.html @@ -3,7 +3,7 @@ - + diff --git a/dom/plugins/test/mochitest/test_getauthenticationinfo.html b/dom/plugins/test/mochitest/test_getauthenticationinfo.html index 6735812112d..dfd2fbed382 100644 --- a/dom/plugins/test/mochitest/test_getauthenticationinfo.html +++ b/dom/plugins/test/mochitest/test_getauthenticationinfo.html @@ -3,7 +3,7 @@ Test for Login Manager - + diff --git a/dom/plugins/test/mochitest/test_hang_submit.xul b/dom/plugins/test/mochitest/test_hang_submit.xul index 2b9bef41017..6c037ecd49f 100644 --- a/dom/plugins/test/mochitest/test_hang_submit.xul +++ b/dom/plugins/test/mochitest/test_hang_submit.xul @@ -8,7 +8,7 @@ src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" /> + diff --git a/dom/plugins/test/mochitest/test_hanging.html b/dom/plugins/test/mochitest/test_hanging.html index c422371baf7..c8ea936cec7 100644 --- a/dom/plugins/test/mochitest/test_hanging.html +++ b/dom/plugins/test/mochitest/test_hanging.html @@ -1,7 +1,7 @@ Plugin hanging - + + diff --git a/dom/plugins/test/mochitest/test_instance_re-parent.html b/dom/plugins/test/mochitest/test_instance_re-parent.html index 30919b9095c..1ba87adb5b4 100644 --- a/dom/plugins/test/mochitest/test_instance_re-parent.html +++ b/dom/plugins/test/mochitest/test_instance_re-parent.html @@ -5,7 +5,7 @@ - + - + diff --git a/dom/plugins/test/mochitest/test_instance_unparent2.html b/dom/plugins/test/mochitest/test_instance_unparent2.html index df6c0ebfae1..eedbca8e4ed 100644 --- a/dom/plugins/test/mochitest/test_instance_unparent2.html +++ b/dom/plugins/test/mochitest/test_instance_unparent2.html @@ -4,7 +4,7 @@ Test removing an instance's DOM node - + diff --git a/dom/plugins/test/mochitest/test_instance_unparent3.html b/dom/plugins/test/mochitest/test_instance_unparent3.html index 9dcb0a5a8d7..9e55c7ed929 100644 --- a/dom/plugins/test/mochitest/test_instance_unparent3.html +++ b/dom/plugins/test/mochitest/test_instance_unparent3.html @@ -4,7 +4,7 @@ Test removing an instance's DOM node - + diff --git a/dom/plugins/test/mochitest/test_instantiation.html b/dom/plugins/test/mochitest/test_instantiation.html index 923a81469bb..e8fc0774591 100644 --- a/dom/plugins/test/mochitest/test_instantiation.html +++ b/dom/plugins/test/mochitest/test_instantiation.html @@ -1,7 +1,7 @@ Plugin instantiation - + diff --git a/dom/plugins/test/mochitest/test_mixed_case_mime.html b/dom/plugins/test/mochitest/test_mixed_case_mime.html index cb091a8cbb6..9258541bb77 100644 --- a/dom/plugins/test/mochitest/test_mixed_case_mime.html +++ b/dom/plugins/test/mochitest/test_mixed_case_mime.html @@ -2,7 +2,7 @@ Test mixed case mimetype for plugins - + - + - + diff --git a/dom/plugins/test/mochitest/test_npn_asynccall.html b/dom/plugins/test/mochitest/test_npn_asynccall.html index 14617aa5f27..4f007aacb05 100644 --- a/dom/plugins/test/mochitest/test_npn_asynccall.html +++ b/dom/plugins/test/mochitest/test_npn_asynccall.html @@ -3,7 +3,7 @@ NPN_AsyncCallback Tests - + diff --git a/dom/plugins/test/mochitest/test_npn_timers.html b/dom/plugins/test/mochitest/test_npn_timers.html index 076c04f0dac..64d5aebbda5 100644 --- a/dom/plugins/test/mochitest/test_npn_timers.html +++ b/dom/plugins/test/mochitest/test_npn_timers.html @@ -3,7 +3,7 @@ NPN_Timer Tests - + diff --git a/dom/plugins/test/mochitest/test_npobject_getters.html b/dom/plugins/test/mochitest/test_npobject_getters.html index 9287121ba39..5a9a47081ae 100644 --- a/dom/plugins/test/mochitest/test_npobject_getters.html +++ b/dom/plugins/test/mochitest/test_npobject_getters.html @@ -1,7 +1,7 @@ NPNV*NPObject accessibility tests - + + diff --git a/dom/plugins/test/mochitest/test_npruntime_construct.html b/dom/plugins/test/mochitest/test_npruntime_construct.html index 25f4f664cc8..bd85930a4f7 100644 --- a/dom/plugins/test/mochitest/test_npruntime_construct.html +++ b/dom/plugins/test/mochitest/test_npruntime_construct.html @@ -3,7 +3,7 @@ Test whether windowless plugins receive correct visible/invisible notifications. - + diff --git a/dom/plugins/test/mochitest/test_npruntime_identifiers.html b/dom/plugins/test/mochitest/test_npruntime_identifiers.html index 7fedcb02542..a19a59be52e 100644 --- a/dom/plugins/test/mochitest/test_npruntime_identifiers.html +++ b/dom/plugins/test/mochitest/test_npruntime_identifiers.html @@ -3,7 +3,7 @@ NPN_Invoke Tests - + diff --git a/dom/plugins/test/mochitest/test_npruntime_npnevaluate.html b/dom/plugins/test/mochitest/test_npruntime_npnevaluate.html index 6581b3984d8..4a1c22978ba 100644 --- a/dom/plugins/test/mochitest/test_npruntime_npnevaluate.html +++ b/dom/plugins/test/mochitest/test_npruntime_npnevaluate.html @@ -3,7 +3,7 @@ NPN_Evaluate Tests - + diff --git a/dom/plugins/test/mochitest/test_npruntime_npninvoke.html b/dom/plugins/test/mochitest/test_npruntime_npninvoke.html index 86eb04c2371..ff4c92a6d58 100644 --- a/dom/plugins/test/mochitest/test_npruntime_npninvoke.html +++ b/dom/plugins/test/mochitest/test_npruntime_npninvoke.html @@ -3,7 +3,7 @@ NPN_Invoke Tests - + diff --git a/dom/plugins/test/mochitest/test_npruntime_npninvokedefault.html b/dom/plugins/test/mochitest/test_npruntime_npninvokedefault.html index 597db0cc1c9..79a75e75512 100644 --- a/dom/plugins/test/mochitest/test_npruntime_npninvokedefault.html +++ b/dom/plugins/test/mochitest/test_npruntime_npninvokedefault.html @@ -3,7 +3,7 @@ NPN_Invoke_Default Tests - + diff --git a/dom/plugins/test/mochitest/test_painting.html b/dom/plugins/test/mochitest/test_painting.html index f79df0ce68d..08ebd467572 100644 --- a/dom/plugins/test/mochitest/test_painting.html +++ b/dom/plugins/test/mochitest/test_painting.html @@ -38,7 +38,7 @@ - + - + diff --git a/dom/plugins/test/mochitest/test_plugin_tag_clicktoplay.html b/dom/plugins/test/mochitest/test_plugin_tag_clicktoplay.html index fcc84fdd59e..f67a78bca57 100644 --- a/dom/plugins/test/mochitest/test_plugin_tag_clicktoplay.html +++ b/dom/plugins/test/mochitest/test_plugin_tag_clicktoplay.html @@ -5,7 +5,7 @@ Test Modifying Plugin click-to-play Flag - + - + diff --git a/dom/plugins/test/mochitest/test_pluginstream_asfileonly.html b/dom/plugins/test/mochitest/test_pluginstream_asfileonly.html index be49cc4601c..96c9b85dce2 100644 --- a/dom/plugins/test/mochitest/test_pluginstream_asfileonly.html +++ b/dom/plugins/test/mochitest/test_pluginstream_asfileonly.html @@ -5,7 +5,7 @@ src="/tests/SimpleTest/SimpleTest.js"> - + diff --git a/dom/plugins/test/mochitest/test_pluginstream_err.html b/dom/plugins/test/mochitest/test_pluginstream_err.html index f5e0101ab17..0ac2a5efc26 100644 --- a/dom/plugins/test/mochitest/test_pluginstream_err.html +++ b/dom/plugins/test/mochitest/test_pluginstream_err.html @@ -9,7 +9,7 @@ Tests for plugin stream error conditions. NPAPI Stream Error Tests - + diff --git a/dom/plugins/test/mochitest/test_pluginstream_geturl.html b/dom/plugins/test/mochitest/test_pluginstream_geturl.html index 12de91f70e3..fe69427a42d 100644 --- a/dom/plugins/test/mochitest/test_pluginstream_geturl.html +++ b/dom/plugins/test/mochitest/test_pluginstream_geturl.html @@ -5,7 +5,7 @@ src="/tests/SimpleTest/SimpleTest.js"> - + diff --git a/dom/plugins/test/mochitest/test_pluginstream_geturlnotify.html b/dom/plugins/test/mochitest/test_pluginstream_geturlnotify.html index 07a813d6f4b..ee4c2b119de 100644 --- a/dom/plugins/test/mochitest/test_pluginstream_geturlnotify.html +++ b/dom/plugins/test/mochitest/test_pluginstream_geturlnotify.html @@ -5,7 +5,7 @@ src="/tests/SimpleTest/SimpleTest.js"> - + diff --git a/dom/plugins/test/mochitest/test_pluginstream_newstream.html b/dom/plugins/test/mochitest/test_pluginstream_newstream.html index a499196f0d2..3972fd7ed4c 100644 --- a/dom/plugins/test/mochitest/test_pluginstream_newstream.html +++ b/dom/plugins/test/mochitest/test_pluginstream_newstream.html @@ -5,7 +5,7 @@ src="/tests/SimpleTest/SimpleTest.js"> - + diff --git a/dom/plugins/test/mochitest/test_pluginstream_post.html b/dom/plugins/test/mochitest/test_pluginstream_post.html index a74e0e6f425..da12ff3b0e9 100644 --- a/dom/plugins/test/mochitest/test_pluginstream_post.html +++ b/dom/plugins/test/mochitest/test_pluginstream_post.html @@ -5,7 +5,7 @@ src="/tests/SimpleTest/SimpleTest.js"> - + diff --git a/dom/plugins/test/mochitest/test_pluginstream_poststream.html b/dom/plugins/test/mochitest/test_pluginstream_poststream.html index f32ff7cf798..ed2e8ce2c72 100644 --- a/dom/plugins/test/mochitest/test_pluginstream_poststream.html +++ b/dom/plugins/test/mochitest/test_pluginstream_poststream.html @@ -5,7 +5,7 @@ src="/tests/SimpleTest/SimpleTest.js"> - + diff --git a/dom/plugins/test/mochitest/test_pluginstream_referer.html b/dom/plugins/test/mochitest/test_pluginstream_referer.html index e0b3409928d..e1b63fb959c 100644 --- a/dom/plugins/test/mochitest/test_pluginstream_referer.html +++ b/dom/plugins/test/mochitest/test_pluginstream_referer.html @@ -2,7 +2,7 @@ Do plugin stream requests send the Referer header correctly? - + diff --git a/dom/plugins/test/mochitest/test_pluginstream_seek.html b/dom/plugins/test/mochitest/test_pluginstream_seek.html index 984d43d3b01..6915a766e86 100644 --- a/dom/plugins/test/mochitest/test_pluginstream_seek.html +++ b/dom/plugins/test/mochitest/test_pluginstream_seek.html @@ -5,7 +5,7 @@ src="/tests/SimpleTest/SimpleTest.js"> - + diff --git a/dom/plugins/test/mochitest/test_pluginstream_seek_close.html b/dom/plugins/test/mochitest/test_pluginstream_seek_close.html index 07958ddd7b4..46fd3962abc 100644 --- a/dom/plugins/test/mochitest/test_pluginstream_seek_close.html +++ b/dom/plugins/test/mochitest/test_pluginstream_seek_close.html @@ -3,7 +3,7 @@ NPAPI Seekable NPStream Test - + - + diff --git a/dom/plugins/test/mochitest/test_pluginstream_src_dynamic.html b/dom/plugins/test/mochitest/test_pluginstream_src_dynamic.html index 0abedcec17e..2a7db9916d0 100644 --- a/dom/plugins/test/mochitest/test_pluginstream_src_dynamic.html +++ b/dom/plugins/test/mochitest/test_pluginstream_src_dynamic.html @@ -5,7 +5,7 @@ src="/tests/SimpleTest/SimpleTest.js"> - + diff --git a/dom/plugins/test/mochitest/test_pluginstream_src_referer.html b/dom/plugins/test/mochitest/test_pluginstream_src_referer.html index 9a191b82c6f..9e96016ff67 100644 --- a/dom/plugins/test/mochitest/test_pluginstream_src_referer.html +++ b/dom/plugins/test/mochitest/test_pluginstream_src_referer.html @@ -2,7 +2,7 @@ Do plugin stream src requests send the Referer header correctly? - + diff --git a/dom/plugins/test/mochitest/test_positioning.html b/dom/plugins/test/mochitest/test_positioning.html index f288498521c..4a4fc1d3d07 100644 --- a/dom/plugins/test/mochitest/test_positioning.html +++ b/dom/plugins/test/mochitest/test_positioning.html @@ -3,7 +3,7 @@ Test whether windowless plugins receive correct visible/invisible notifications. - +