From 709ef7fa388a0c1129a969405b7d5dee31b7e925 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Sun, 11 Feb 2018 13:01:08 +0100 Subject: Un-fold browsercomps.* from libxul This resolves %16. --- CLOBBER | 2 +- browser/components/build/moz.build | 22 +++++++++++++++++++-- .../components/dirprovider/DirectoryProvider.cpp | 2 +- browser/components/feeds/nsFeedSniffer.cpp | 15 ++++---------- browser/components/feeds/nsFeedSniffer.h | 2 +- .../components/migration/nsIEHistoryEnumerator.cpp | 5 ++--- browser/components/shell/nsGNOMEShellService.cpp | 23 +++++++++++----------- browser/components/shell/nsGNOMEShellService.h | 2 +- browser/components/shell/nsMacShellService.cpp | 2 +- browser/components/shell/nsWindowsShellService.cpp | 18 +++++++++-------- browser/components/shell/nsWindowsShellService.h | 2 +- browser/installer/package-manifest.in | 2 ++ widget/gtk/mozgtk/mozgtk.c | 1 - 13 files changed, 55 insertions(+), 43 deletions(-) diff --git a/CLOBBER b/CLOBBER index d4cdfaff3..5dd4ee07f 100644 --- a/CLOBBER +++ b/CLOBBER @@ -22,4 +22,4 @@ # changes to stick? As of bug 928195, this shouldn't be necessary! Please # don't change CLOBBER for WebIDL changes any more. -Merge day clobber \ No newline at end of file +Clobber for un-folding browsercomps \ No newline at end of file diff --git a/browser/components/build/moz.build b/browser/components/build/moz.build index 8c99b74dd..622cf449c 100644 --- a/browser/components/build/moz.build +++ b/browser/components/build/moz.build @@ -12,8 +12,7 @@ SOURCES += [ 'nsModule.cpp', ] -Library('browsercomps') -FINAL_LIBRARY = 'xul' +XPCOMBinaryComponent('browsercomps') LOCAL_INCLUDES += [ '../about', @@ -22,3 +21,22 @@ LOCAL_INCLUDES += [ '../migration', '../shell', ] + +if CONFIG['OS_ARCH'] == 'WINNT': + OS_LIBS += [ + 'esent', + 'netapi32', + 'ole32', + 'shell32', + 'shlwapi', + 'version', + ] + DELAYLOAD_DLLS += [ + 'esent.dll', + 'netapi32.dll', + ] + +# Mac: Need to link with CoreFoundation for Mac Migrators (PList reading code) +# GTK2: Need to link with glib for GNOME shell service +if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('cocoa', 'gtk2', 'gtk3'): + OS_LIBS += CONFIG['TK_LIBS'] diff --git a/browser/components/dirprovider/DirectoryProvider.cpp b/browser/components/dirprovider/DirectoryProvider.cpp index 7b4f81c7d..8b7c0b9e0 100644 --- a/browser/components/dirprovider/DirectoryProvider.cpp +++ b/browser/components/dirprovider/DirectoryProvider.cpp @@ -20,7 +20,7 @@ #include "nsDirectoryServiceUtils.h" #include "mozilla/ModuleUtils.h" #include "nsServiceManagerUtils.h" -#include "nsString.h" +#include "nsStringAPI.h" #include "nsXULAppAPI.h" #include "nsIPrefLocalizedString.h" diff --git a/browser/components/feeds/nsFeedSniffer.cpp b/browser/components/feeds/nsFeedSniffer.cpp index f2d0da776..f314d3d3b 100644 --- a/browser/components/feeds/nsFeedSniffer.cpp +++ b/browser/components/feeds/nsFeedSniffer.cpp @@ -185,15 +185,9 @@ IsDocumentElement(const char *start, const char* end) static bool ContainsTopLevelSubstring(nsACString& dataString, const char *substring) { - nsACString::const_iterator start, end; - dataString.BeginReading(start); - dataString.EndReading(end); - - if (!FindInReadable(nsCString(substring), start, end)){ + int32_t offset = dataString.Find(substring); + if (offset == -1) return false; - } - - auto offset = start.get() - dataString.Data(); const char *begin = dataString.BeginReading(); @@ -318,10 +312,9 @@ nsFeedSniffer::GetMIMETypeFromContent(nsIRequest* request, // RSS 1.0 if (!isFeed) { - bool foundNS_RDF = FindInReadable(NS_LITERAL_CSTRING(NS_RDF), dataString); - bool foundNS_RSS = FindInReadable(NS_LITERAL_CSTRING(NS_RSS), dataString); isFeed = ContainsTopLevelSubstring(dataString, "