Bug 919292 - Minimize the #includes in netwerk/streamconv; r=mcmanus

This commit is contained in:
Ehsan Akhgari 2013-09-22 23:34:09 -04:00
Родитель e8c48e7df8
Коммит 123240353c
22 изменённых файлов: 72 добавлений и 97 удалений

Просмотреть файл

@ -3,13 +3,13 @@
* 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 "ParseFTPList.h"
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include "plstr.h"
#include "nsDebug.h"
#include "ParseFTPList.h"
#include "prprf.h"
/* ==================================================================== */

Просмотреть файл

@ -2,7 +2,10 @@
/* 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 "nspr.h"
#include <stdint.h>
#include <string.h>
#include "prtime.h"
/* ParseFTPList() parses lines from an FTP LIST command.
**

Просмотреть файл

@ -4,13 +4,11 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "mozTXTToHTMLConv.h"
#include "nsIServiceManager.h"
#include "nsNetCID.h"
#include "nsNetUtil.h"
#include "nsReadableUtils.h"
#include "nsUnicharUtils.h"
#include "nsCRT.h"
#include "nsIExternalProtocolHandler.h"
#include "nsIIOService.h"
#ifdef DEBUG_BenB_Perf
#include "prtime.h"

Просмотреть файл

@ -11,10 +11,10 @@
#define _mozTXTToHTMLConv_h__
#include "mozITXTToHTMLConv.h"
#include "nsIIOService.h"
#include "nsString.h"
#include "nsCOMPtr.h"
class nsIIOService;
class mozTXTToHTMLConv : public mozITXTToHTMLConv
{

Просмотреть файл

@ -4,8 +4,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsDirIndex.h"
#include "nsReadableUtils.h"
#include "nsCRT.h"
#include "nsISupportsObsolete.h"
NS_IMPL_ISUPPORTS1(nsDirIndex,

Просмотреть файл

@ -10,17 +10,15 @@
#include "prprf.h"
#include "nsDirIndexParser.h"
#include "nsReadableUtils.h"
#include "nsDirIndex.h"
#include "nsEscape.h"
#include "nsIServiceManager.h"
#include "nsIInputStream.h"
#include "nsIChannel.h"
#include "nsIURI.h"
#include "nsCRT.h"
#include "nsIPrefService.h"
#include "nsIPrefBranch.h"
#include "nsIPrefLocalizedString.h"
#include "nsITextToSubURI.h"
#include "nsIDirIndex.h"
#include "nsServiceManagerUtils.h"
using namespace mozilla;

Просмотреть файл

@ -6,11 +6,12 @@
#ifndef __NSDIRINDEX_H_
#define __NSDIRINDEX_H_
#include "nsIDirIndex.h"
#include "nsString.h"
#include "nsCOMPtr.h"
#include "nsIDirIndexListener.h"
#include "nsITextToSubURI.h"
class nsIDirIndex;
class nsITextToSubURI;
/* CID: {a0d6ad32-1dd1-11b2-aa55-a40187b54036} */

Просмотреть файл

@ -7,19 +7,13 @@
#include "nsMemory.h"
#include "plstr.h"
#include "prlog.h"
#include "nsIServiceManager.h"
#include "nsXPIDLString.h"
#include "nsReadableUtils.h"
#include "nsCOMPtr.h"
#include "nsEscape.h"
#include "nsNetUtil.h"
#include "nsStringStream.h"
#include "nsIComponentManager.h"
#include "nsDateTimeFormatCID.h"
#include "nsIStreamListener.h"
#include "nsCRT.h"
#include "nsMimeTypes.h"
#include "nsAutoPtr.h"
#include "nsIChannel.h"
#include "ParseFTPList.h"
#include <algorithm>

Просмотреть файл

@ -6,11 +6,9 @@
#define __nsftpdirlistingdconv__h__
#include "nsIStreamConverter.h"
#include "nsIChannel.h"
#include "nsIURI.h"
#include "nsString.h"
#include "nsIFactory.h"
class nsIURI;
#define NS_FTPDIRLISTINGCONVERTER_CID \
{ /* 14C0E880-623E-11d3-A178-0050041CAF44 */ \

Просмотреть файл

@ -7,10 +7,7 @@
#include "nsHTTPCompressConv.h"
#include "nsMemory.h"
#include "plstr.h"
#include "prlog.h"
#include "nsIChannel.h"
#include "nsCOMPtr.h"
#include "nsReadableUtils.h"
#include "nsError.h"
#include "nsStreamUtils.h"
#include "nsStringStream.h"

Просмотреть файл

@ -7,11 +7,12 @@
#define __nsHTTPCompressConv__h__ 1
#include "nsIStreamConverter.h"
#include "nsIStringStream.h"
#include "nsCOMPtr.h"
#include "zlib.h"
class nsIStringInputStream;
#define NS_HTTPCOMPRESSCONVERTER_CID \
{ \
/* 66230b2b-17fa-4bd3-abf4-07986151022d */ \

Просмотреть файл

@ -10,15 +10,18 @@
#include "nsIFileURL.h"
#include "nsEscape.h"
#include "nsIDirIndex.h"
#include "prtime.h"
#include "nsDateTimeFormatCID.h"
#include "nsURLHelper.h"
#include "nsCRT.h"
#include "nsIPlatformCharset.h"
#include "nsIPrefService.h"
#include "nsIPrefBranch.h"
#include "nsIPrefLocalizedString.h"
#include "nsIChromeRegistry.h"
#include "nsICharsetConverterManager.h"
#include "nsIDateTimeFormat.h"
#include "nsIStringBundle.h"
#include "nsITextToSubURI.h"
#include "nsXPIDLString.h"
#include <algorithm>
NS_IMPL_ISUPPORTS4(nsIndexedToHTML,

Просмотреть файл

@ -7,20 +7,17 @@
#define ____nsindexedtohtml___h___
#include "nsCOMPtr.h"
#include "nsIFactory.h"
#include "nsString.h"
#include "nsIStreamConverter.h"
#include "nsXPIDLString.h"
#include "nsIDirIndexListener.h"
#include "nsIDateTimeFormat.h"
#include "nsIStringBundle.h"
#include "nsIStringStream.h"
#include "nsITextToSubURI.h"
#include "nsICharsetConverterManager.h"
#define NS_NSINDEXEDTOHTMLCONVERTER_CID \
{ 0xcf0f71fd, 0xfafd, 0x4e2b, {0x9f, 0xdc, 0x13, 0x4d, 0x97, 0x2e, 0x16, 0xe2} }
class nsIDateTimeFormat;
class nsIStringBundle;
class nsITextToSubURI;
class nsIUnicodeEncoder;
class nsIndexedToHTML : public nsIStreamConverter,
public nsIDirIndexListener

Просмотреть файл

@ -4,14 +4,11 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsMultiMixedConv.h"
#include "nsMemory.h"
#include "plstr.h"
#include "nsIHttpChannel.h"
#include "nsIServiceManager.h"
#include "nsNetUtil.h"
#include "nsMimeTypes.h"
#include "nsIStringStream.h"
#include "nsReadableUtils.h"
#include "nsCRT.h"
#include "nsIHttpChannelInternal.h"
#include "nsURLHelper.h"

Просмотреть файл

@ -7,9 +7,7 @@
#include "nsIStreamConverter.h"
#include "nsIChannel.h"
#include "nsIURI.h"
#include "nsString.h"
#include "nsXPIDLString.h"
#include "nsCOMPtr.h"
#include "nsIByteRangeRequest.h"
#include "nsIMultiPartChannel.h"

Просмотреть файл

@ -4,10 +4,10 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsTXTToHTMLConv.h"
#include "nsNetUtil.h"
#include "nsEscape.h"
#include "nsStringStream.h"
#include "nsAutoPtr.h"
#include "nsIChannel.h"
#include <algorithm>
#define TOKEN_DELIMITERS NS_LITERAL_STRING("\t\r\n ").get()

Просмотреть файл

@ -9,8 +9,6 @@
#include "nsITXTToHTMLConv.h"
#include "nsCOMPtr.h"
#include "nsTArray.h"
#include "nsAutoPtr.h"
#include "nsIFactory.h"
#include "nsString.h"
#define NS_NSTXTTOHTMLCONVERTER_CID \
@ -27,7 +25,9 @@ typedef struct convToken {
nsString modText; // replacement text or href prepend text.
bool prepend; // flag indicating how the modText should be used.
} convToken;
template<class T> class nsAutoPtr;
/**
* Convert plain text to HTML.
*

Просмотреть файл

@ -4,19 +4,12 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsUnknownDecoder.h"
#include "nsIServiceManager.h"
#include "nsIStreamConverterService.h"
#include "nsIPipe.h"
#include "nsIInputStream.h"
#include "nsIOutputStream.h"
#include "nsMimeTypes.h"
#include "netCore.h"
#include "nsXPIDLString.h"
#include "nsIPrefService.h"
#include "nsIPrefBranch.h"
#include "nsICategoryManager.h"
#include "nsISupportsPrimitives.h"
#include "nsCRT.h"

Просмотреть файл

@ -7,7 +7,6 @@
#define nsUnknownDecoder_h__
#include "nsIStreamConverter.h"
#include "nsIChannel.h"
#include "nsIContentSniffer.h"
#include "nsCOMPtr.h"

Просмотреть файл

@ -19,20 +19,47 @@
*/
#include "nsStreamConverterService.h"
#include "nsIServiceManager.h"
#include "nsIComponentManager.h"
#include "nsIComponentRegistrar.h"
#include "nsString.h"
#include "nsReadableUtils.h"
#include "nsIAtom.h"
#include "nsDeque.h"
#include "nsIInputStream.h"
#include "nsIOutputStream.h"
#include "nsIStreamConverter.h"
#include "nsICategoryManager.h"
#include "nsXPCOM.h"
#include "nsISupportsPrimitives.h"
#include "nsXPIDLString.h"
#include "nsCOMArray.h"
#include "nsTArray.h"
#include "nsServiceManagerUtils.h"
#include "nsHashtable.h"
///////////////////////////////////////////////////////////////////
// Breadth-First-Search (BFS) algorithm state classes and types.
// used to establish discovered vertecies.
enum BFScolors {white, gray, black};
struct BFSState {
BFScolors color;
int32_t distance;
nsCStringKey *predecessor;
~BFSState() {
delete predecessor;
}
};
// adjacency list and BFS hashtable data class.
struct SCTableData {
nsCStringKey *key;
union _data {
BFSState *state;
nsCOMArray<nsIAtom> *edges;
} data;
SCTableData(nsCStringKey* aKey) : key(aKey) {
data.state = nullptr;
}
};
////////////////////////////////////////////////////////////
// nsISupports methods

Просмотреть файл

@ -7,11 +7,10 @@
#define __nsstreamconverterservice__h___
#include "nsIStreamConverterService.h"
#include "nsIStreamListener.h"
#include "nsHashtable.h"
#include "nsCOMArray.h"
#include "nsTArray.h"
#include "nsIAtom.h"
template<class T> class nsTArray;
class nsObjectHashtable;
class nsCString;
class nsStreamConverterService : public nsIStreamConverterService {
public:
@ -43,31 +42,4 @@ private:
nsObjectHashtable *mAdjacencyList;
};
///////////////////////////////////////////////////////////////////
// Breadth-First-Search (BFS) algorithm state classes and types.
// used to establish discovered vertecies.
enum BFScolors {white, gray, black};
struct BFSState {
BFScolors color;
int32_t distance;
nsCStringKey *predecessor;
~BFSState() {
delete predecessor;
}
};
// adjacency list and BFS hashtable data class.
struct SCTableData {
nsCStringKey *key;
union _data {
BFSState *state;
nsCOMArray<nsIAtom> *edges;
} data;
SCTableData(nsCStringKey* aKey) : key(aKey) {
data.state = nullptr;
}
};
#endif // __nsstreamconverterservice__h___

Просмотреть файл

@ -4,8 +4,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsIServiceManager.h"
#include "nsIComponentManager.h"
#include "nsIComponentRegistrar.h"
#include "nsIStreamConverterService.h"
#include "nsIStreamConverter.h"
#include "nsICategoryManager.h"
@ -13,11 +11,14 @@
#include "nsXULAppAPI.h"
#include "nsIStringStream.h"
#include "nsCOMPtr.h"
#include "nsNetUtil.h"
#include "nsThreadUtils.h"
#include "mozilla/Attributes.h"
#include "nsMemory.h"
#include "nsServiceManagerUtils.h"
#include "nsComponentManagerUtils.h"
#include "nsIRequest.h"
#include "nsNetCID.h"
#include "nspr.h"
#include <algorithm>
#define ASYNC_TEST // undefine this if you want to test sycnronous conversion.