From e45706ca3acbb6530419433212becc61d5953a2d 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. --- 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 ++ 11 files changed, 54 insertions(+), 41 deletions(-) (limited to 'browser') diff --git a/browser/components/build/moz.build b/browser/components/build/moz.build index 8c99b74ddb..622cf449ce 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 7b4f81c7d2..8b7c0b9e0a 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 f2d0da7766..f314d3d3bd 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, "