Bug 919296 - Minimize the #includes in netwerk/ IDL files; r=mcmanus
authorEhsan Akhgari <ehsan@mozilla.com>
Sun, 22 Sep 2013 23:35:05 -0400
changeset 148234 2b66295c3d202ba8a0260f6cf3ab744c893d8526
parent 148233 6c8fd184e4667a6e3cfd4fe75026d38a15a2b4ff
child 148235 aceb8d1e6ebaca94394da3f47fe27bb3fcf501a2
push id25331
push usercbook@mozilla.com
push dateMon, 23 Sep 2013 11:04:51 +0000
treeherdermozilla-central@4df586670d2a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmcmanus
bugs919296
milestone27.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 919296 - Minimize the #includes in netwerk/ IDL files; r=mcmanus
browser/components/feeds/src/nsFeedSniffer.cpp
content/base/src/nsContentAreaDragDrop.cpp
content/html/content/src/HTMLInputElement.cpp
dom/base/nsMimeTypeArray.cpp
embedding/components/webbrowserpersist/src/nsWebBrowserPersist.cpp
netwerk/base/public/nsIApplicationCacheChannel.idl
netwerk/base/public/nsIDashboard.idl
netwerk/base/public/nsIInputStreamChannel.idl
netwerk/base/public/nsILoadGroupChild.idl
netwerk/base/public/nsIPermissionManager.idl
netwerk/base/public/nsIServerSocket.idl
netwerk/base/public/nsISocketTransport.idl
netwerk/base/public/nsISocketTransportService.idl
netwerk/base/public/nsISystemProxySettings.idl
netwerk/base/public/nsIThreadRetargetableRequest.idl
netwerk/base/public/nsIUDPServerSocket.idl
netwerk/base/src/Dashboard.h
netwerk/base/src/nsServerSocket.cpp
netwerk/base/src/nsSocketTransportService2.cpp
netwerk/base/src/nsSocketTransportService2.h
netwerk/cache/nsICache.idl
netwerk/cookie/nsICookieManager.idl
netwerk/dns/nsIDNSRecord.idl
netwerk/dns/nsIDNSService.idl
netwerk/mime/nsIMIMEService.idl
netwerk/protocol/file/nsIFileChannel.idl
netwerk/protocol/http/nsIHttpAuthenticableChannel.idl
netwerk/protocol/http/nsIHttpChannelInternal.idl
netwerk/socket/nsISOCKSSocketInfo.idl
netwerk/socket/nsISSLSocketControl.idl
netwerk/streamconv/converters/nsFTPDirListingConv.cpp
netwerk/streamconv/public/mozITXTToHTMLConv.idl
netwerk/streamconv/public/nsIAppleFileDecoder.idl
netwerk/streamconv/public/nsIStreamConverter.idl
netwerk/streamconv/public/nsIStreamConverterService.idl
netwerk/streamconv/public/nsITXTToHTMLConv.idl
netwerk/test/TestUDPServerSocket.cpp
netwerk/wifi/nsIWifiListener.idl
netwerk/wifi/nsIWifiMonitor.idl
netwerk/wifi/nsWifiMonitor.h
--- a/browser/components/feeds/src/nsFeedSniffer.cpp
+++ b/browser/components/feeds/src/nsFeedSniffer.cpp
@@ -22,16 +22,17 @@
 #include "nsIStreamConverter.h"
 
 #include "nsIStreamListener.h"
 
 #include "nsIHttpChannel.h"
 #include "nsIMIMEHeaderParam.h"
 
 #include "nsMimeTypes.h"
+#include "nsIURI.h"
 #include <algorithm>
 
 #define TYPE_ATOM "application/atom+xml"
 #define TYPE_RSS "application/rss+xml"
 #define TYPE_MAYBE_FEED "application/vnd.mozilla.maybe.feed"
 
 #define NS_RDF "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
 #define NS_RSS "http://purl.org/rss/1.0/"
--- a/content/base/src/nsContentAreaDragDrop.cpp
+++ b/content/base/src/nsContentAreaDragDrop.cpp
@@ -46,16 +46,17 @@
 #include "nsIDocShellTreeItem.h"
 #include "nsIWebBrowserPersist.h"
 #include "nsEscape.h"
 #include "nsContentUtils.h"
 #include "nsIMIMEService.h"
 #include "imgIContainer.h"
 #include "imgIRequest.h"
 #include "nsDOMDataTransfer.h"
+#include "nsIMIMEInfo.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/HTMLAreaElement.h"
 
 using mozilla::dom::HTMLAreaElement;
 
 class MOZ_STACK_CLASS DragDataProducer
 {
 public:
--- a/content/html/content/src/HTMLInputElement.cpp
+++ b/content/html/content/src/HTMLInputElement.cpp
@@ -97,16 +97,17 @@
 #include "nsIIDNService.h"
 
 #include <limits>
 
 #include "nsIColorPicker.h"
 #include "nsIStringEnumerator.h"
 #include "HTMLSplitOnSpacesTokenizer.h"
 #include "nsIController.h"
+#include "nsIMIMEInfo.h"
 
 // input type=date
 #include "js/Date.h"
 
 NS_IMPL_NS_NEW_HTML_ELEMENT_CHECK_PARSER(Input)
 
 // XXX align=left, hspace, vspace, border? other nav4 attrs
 
--- a/dom/base/nsMimeTypeArray.cpp
+++ b/dom/base/nsMimeTypeArray.cpp
@@ -8,16 +8,17 @@
 
 #include "mozilla/dom/MimeTypeArrayBinding.h"
 #include "mozilla/dom/MimeTypeBinding.h"
 #include "nsIDOMNavigator.h"
 #include "nsPluginArray.h"
 #include "nsIMIMEService.h"
 #include "nsIMIMEInfo.h"
 #include "Navigator.h"
+#include "nsServiceManagerUtils.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(nsMimeTypeArray)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(nsMimeTypeArray)
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsMimeTypeArray)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
--- a/embedding/components/webbrowserpersist/src/nsWebBrowserPersist.cpp
+++ b/embedding/components/webbrowserpersist/src/nsWebBrowserPersist.cpp
@@ -81,16 +81,17 @@
 #include "nsITransport.h"
 #include "nsISocketTransport.h"
 #include "nsIStringBundle.h"
 #include "nsIProtocolHandler.h"
 
 #include "nsWebBrowserPersist.h"
 
 #include "nsIContent.h"
+#include "nsIMIMEInfo.h"
 #include "mozilla/dom/HTMLInputElement.h"
 #include "mozilla/dom/HTMLSharedElement.h"
 #include "mozilla/dom/HTMLSharedObjectElement.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 // Buffer file writes in 32kb chunks
--- a/netwerk/base/public/nsIApplicationCacheChannel.idl
+++ b/netwerk/base/public/nsIApplicationCacheChannel.idl
@@ -1,15 +1,14 @@
 /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  *
  * 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 "nsISupports.idl"
 #include "nsIApplicationCacheContainer.idl"
 
 /**
  * Interface implemented by channels that support application caches.
  */
 [scriptable, uuid(6FA816B1-6D5F-4380-9704-054D0908CFA3)]
 interface nsIApplicationCacheChannel : nsIApplicationCacheContainer
 {
--- a/netwerk/base/public/nsIDashboard.idl
+++ b/netwerk/base/public/nsIDashboard.idl
@@ -1,14 +1,13 @@
 /* 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 "nsISupports.idl"
-#include "nsIDashboardEventNotifier.idl"
 
 /* A JavaScript callback function that takes a JSON as its parameter.
  * The returned JSON contains arrays with data
  */
 [scriptable, function, uuid(19d7f24f-a95a-4fd9-87e2-d96e9e4b1f6d)]
 interface NetDashboardCallback : nsISupports
 {
     void onDashboardDataAvailable(in jsval data);
--- a/netwerk/base/public/nsIInputStreamChannel.idl
+++ b/netwerk/base/public/nsIInputStreamChannel.idl
@@ -1,15 +1,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#include "nsIChannel.idl"
+#include "nsISupports.idl"
 
 interface nsIInputStream;
+interface nsIURI;
 
 /**
  * nsIInputStreamChannel
  *
  * This interface provides methods to initialize an input stream channel.
  * The input stream channel serves as a data pump for an input stream.
  */
 [scriptable, uuid(A30E916F-B1DE-452A-BDD0-C59BB516D427)]
--- a/netwerk/base/public/nsILoadGroupChild.idl
+++ b/netwerk/base/public/nsILoadGroupChild.idl
@@ -1,14 +1,16 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* 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 "nsILoadGroup.idl"
+#include "nsISupports.idl"
+
+interface nsILoadGroup;
 
 /**
  * nsILoadGroupChild provides a hierarchy of load groups so that the
  * root load group can be used to conceptually tie a series of loading
  * operations into a logical whole while still leaving them separate
  * for the purposes of cancellation and status events.
  */
 
--- a/netwerk/base/public/nsIPermissionManager.idl
+++ b/netwerk/base/public/nsIPermissionManager.idl
@@ -24,23 +24,23 @@
  *          a permission was added. the subject is the added permission.
  *          "changed"
  *          a permission was changed. the subject is the new permission.
  *          "cleared"
  *          the entire permission list was cleared. the subject is null.
  */
 
 #include "nsISupports.idl"
-#include "nsISimpleEnumerator.idl"
 
 interface nsIURI;
 interface nsIObserver;
 interface nsIPrincipal;
 interface nsIDOMWindow;
 interface nsIPermission;
+interface nsISimpleEnumerator;
 
 [scriptable, uuid(c9fec678-f194-43c9-96b0-7bd9dbdd6bb0)]
 interface nsIPermissionManager : nsISupports
 {
   /**
    * Predefined return values for the testPermission method and for
    * the permission param of the add method
    * NOTE: UNKNOWN_ACTION (0) is reserved to represent the
--- a/netwerk/base/public/nsIServerSocket.idl
+++ b/netwerk/base/public/nsIServerSocket.idl
@@ -1,16 +1,16 @@
 /* vim:set ts=4 sw=4 et cindent: */
 /* 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 "nsISupports.idl"
-#include "nsIFile.idl"
 
+interface nsIFile;
 interface nsIServerSocketListener;
 interface nsISocketTransport;
 
 native PRNetAddr(union PRNetAddr);
 [ptr] native PRNetAddrPtr(union PRNetAddr);
 
 typedef unsigned long nsServerSocketFlag;
 
--- a/netwerk/base/public/nsISocketTransport.idl
+++ b/netwerk/base/public/nsISocketTransport.idl
@@ -1,20 +1,24 @@
 /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* 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 "nsITransport.idl"
-#include "nsINetAddr.idl"
 
 interface nsIInterfaceRequestor;
+interface nsINetAddr;
 
 %{ C++
-#include "mozilla/net/DNS.h"
+namespace mozilla {
+namespace net {
+union NetAddr;
+}
+}
 %}
 native NetAddr(mozilla::net::NetAddr);
 
 /**
  * nsISocketTransport
  *
  * NOTE: Connection setup is triggered by opening an input or output stream,
  * it does not start on its own. Completion of the connection setup is
--- a/netwerk/base/public/nsISocketTransportService.idl
+++ b/netwerk/base/public/nsISocketTransportService.idl
@@ -1,16 +1,16 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* 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 "nsISupports.idl"
-#include "nsIFile.idl"
 
+interface nsIFile;
 interface nsISocketTransport;
 interface nsIProxyInfo;
 interface nsIRunnable;
 
 %{C++
 class nsASocketHandler;
 struct PRFileDesc;
 %}
--- a/netwerk/base/public/nsISystemProxySettings.idl
+++ b/netwerk/base/public/nsISystemProxySettings.idl
@@ -1,15 +1,14 @@
 /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* 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 "nsISupports.idl"
-#include "nsIURI.idl"
 
 /** 
  * This interface allows the proxy code to use platform-specific proxy
  * settings when the proxy preference is set to "automatic discovery". This service
  * acts like a PAC parser to netwerk, but it will actually read the system settings and
  * either return the proper proxy data from the autoconfig URL specified in the system proxy,
  * or generate proxy data based on the system's manual proxy settings.
  */
--- a/netwerk/base/public/nsIThreadRetargetableRequest.idl
+++ b/netwerk/base/public/nsIThreadRetargetableRequest.idl
@@ -1,16 +1,17 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* 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 "nsISupports.idl"
-#include "nsIEventTarget.idl"
+
+interface nsIEventTarget;
 
 /**
  * nsIThreadRetargetableRequest
  *
  * Should be implemented by requests that support retargeting delivery of
  * OnDataAvailable off the main thread. Note, OnStopRequest will be delivered
  * back on the main thread.
  */
--- a/netwerk/base/public/nsIUDPServerSocket.idl
+++ b/netwerk/base/public/nsIUDPServerSocket.idl
@@ -1,23 +1,27 @@
 /* vim:set ts=4 sw=4 et cindent: */
 /* 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 "nsISupports.idl"
-#include "nsINetAddr.idl"
 
+interface nsINetAddr;
 interface nsIUDPServerSocketListener;
 interface nsIUDPMessage;
 interface nsISocketTransport;
 interface nsIOutputStream;
 
 %{ C++
-#include "mozilla/net/DNS.h"
+namespace mozilla {
+namespace net {
+union NetAddr;
+}
+}
 %}
 native NetAddr(mozilla::net::NetAddr);
 [ptr] native NetAddrPtr(mozilla::net::NetAddr);
 
 /**
  * nsIUDPServerSocket
  *
  * An interface to a server socket that can accept incoming connections.
--- a/netwerk/base/src/Dashboard.h
+++ b/netwerk/base/src/Dashboard.h
@@ -3,16 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsDashboard_h__
 #define nsDashboard_h__
 
 #include "mozilla/Mutex.h"
 #include "mozilla/net/DashboardTypes.h"
 #include "nsIDashboard.h"
+#include "nsIDashboardEventNotifier.h"
 #include "nsIDNSListener.h"
 #include "nsIServiceManager.h"
 #include "nsITimer.h"
 #include "nsITransport.h"
 
 class nsIDNSService;
 class nsISocketTransport;
 class nsIThread;
--- a/netwerk/base/src/nsServerSocket.cpp
+++ b/netwerk/base/src/nsServerSocket.cpp
@@ -9,16 +9,18 @@
 #include "nsAutoPtr.h"
 #include "nsError.h"
 #include "nsNetCID.h"
 #include "prnetdb.h"
 #include "prio.h"
 #include "nsThreadUtils.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/net/DNS.h"
+#include "nsServiceManagerUtils.h"
+#include "nsIFile.h"
 
 using namespace mozilla;
 using namespace mozilla::net;
 
 static NS_DEFINE_CID(kSocketTransportServiceCID, NS_SOCKETTRANSPORTSERVICE_CID);
 
 //-----------------------------------------------------------------------------
 
--- a/netwerk/base/src/nsSocketTransportService2.cpp
+++ b/netwerk/base/src/nsSocketTransportService2.cpp
@@ -17,16 +17,17 @@
 #include "nsServiceManagerUtils.h"
 #include "NetworkActivityMonitor.h"
 #include "nsIObserverService.h"
 #include "mozilla/Services.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/Likely.h"
 #include "mozilla/PublicSSL.h"
 #include "nsThreadUtils.h"
+#include "nsIFile.h"
 
 using namespace mozilla;
 using namespace mozilla::net;
 
 #if defined(PR_LOGGING)
 PRLogModuleInfo *gSocketTransportLog = nullptr;
 #endif
 
--- a/netwerk/base/src/nsSocketTransportService2.h
+++ b/netwerk/base/src/nsSocketTransportService2.h
@@ -14,16 +14,17 @@
 #include "prinrval.h"
 #include "prlog.h"
 #include "prinit.h"
 #include "nsIObserver.h"
 #include "mozilla/Mutex.h"
 #include "mozilla/net/DashboardTypes.h"
 
 class nsASocketHandler;
+struct PRPollDesc;
 
 //-----------------------------------------------------------------------------
 
 #if defined(PR_LOGGING)
 //
 // set NSPR_LOG_MODULES=nsSocketTransport:5
 //
 extern PRLogModuleInfo *gSocketTransportLog;
--- a/netwerk/cache/nsICache.idl
+++ b/netwerk/cache/nsICache.idl
@@ -135,11 +135,8 @@ interface nsICache
     const long BLOCKING     = 1;
 
     /**
      * Constant meaning no expiration time.
      */
     const unsigned long NO_EXPIRATION_TIME = 0xFFFFFFFF;
 };
 
-%{C++
-#include "nsError.h"
-%}
--- a/netwerk/cookie/nsICookieManager.idl
+++ b/netwerk/cookie/nsICookieManager.idl
@@ -1,16 +1,16 @@
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* 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 "nsISupports.idl"
-#include "nsISimpleEnumerator.idl"
 
+interface nsISimpleEnumerator;
 
 /** 
  * An optional interface for accessing or removing the cookies
  * that are in the cookie list
  */
 
 [scriptable, uuid(AAAB6710-0F2C-11d5-A53B-0010A401EB10)]
 interface nsICookieManager : nsISupports
--- a/netwerk/dns/nsIDNSRecord.idl
+++ b/netwerk/dns/nsIDNSRecord.idl
@@ -1,16 +1,20 @@
 /* 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 "nsISupports.idl"
 
 %{ C++
-#include "mozilla/net/DNS.h"
+namespace mozilla {
+namespace net {
+union NetAddr;
+}
+}
 %}
 native NetAddr(mozilla::net::NetAddr);
 interface nsINetAddr;
 
 /**
  * nsIDNSRecord
  *
  * this interface represents the result of a DNS lookup.  since a DNS
--- a/netwerk/dns/nsIDNSService.idl
+++ b/netwerk/dns/nsIDNSService.idl
@@ -5,18 +5,17 @@
 #include "nsISupports.idl"
 
 interface nsICancelable;
 interface nsIEventTarget;
 interface nsIDNSRecord;
 interface nsIDNSListener;
 
 %{C++
-#include "nsTArray.h"
-
+template<class T> class nsTArray;
 namespace mozilla { namespace net {
     struct DNSCacheEntries;
 } }
 %}
 
 [ptr] native EntriesArray(nsTArray<mozilla::net::DNSCacheEntries>);
 
 /**
--- a/netwerk/mime/nsIMIMEService.idl
+++ b/netwerk/mime/nsIMIMEService.idl
@@ -1,17 +1,18 @@
 /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* 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 "nsISupports.idl"
-#include "nsIMIMEInfo.idl"
-#include "nsIURI.idl"
-#include "nsIFile.idl"
+
+interface nsIFile;
+interface nsIMIMEInfo;
+interface nsIURI;
 
 %{C++
 #define NS_MIMESERVICE_CID                           \
 { /* 03af31da-3109-11d3-8cd0-0060b0fc14a3 */         \
     0x03af31da,                                      \
     0x3109,                                          \
     0x11d3,                                          \
     {0x8c, 0xd0, 0x00, 0x60, 0xb0, 0xfc, 0x14, 0xa3} \
--- a/netwerk/protocol/file/nsIFileChannel.idl
+++ b/netwerk/protocol/file/nsIFileChannel.idl
@@ -1,14 +1,14 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* 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 "nsIChannel.idl"
+#include "nsISupports.idl"
 
 interface nsIFile;
 
 /**
  * nsIFileChannel
  */
 [scriptable, uuid(06169120-136d-45a5-b535-498f1f755ab7)]
 interface nsIFileChannel : nsISupports
--- a/netwerk/protocol/http/nsIHttpAuthenticableChannel.idl
+++ b/netwerk/protocol/http/nsIHttpAuthenticableChannel.idl
@@ -1,19 +1,19 @@
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* 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 "nsIProxiedChannel.idl"
-#include "nsIChannel.idl"
 
 interface nsILoadGroup;
 interface nsIURI;
 interface nsIInterfaceRequestor;
+typedef unsigned long nsLoadFlags;
 
 [scriptable, uuid(701093ac-5c7f-429c-99e3-423b041fccb4)]
 interface nsIHttpAuthenticableChannel : nsIProxiedChannel
 {
     /**
      * If the channel being authenticated is using SSL.
      */
     readonly attribute boolean isSSL;
--- a/netwerk/protocol/http/nsIHttpChannelInternal.idl
+++ b/netwerk/protocol/http/nsIHttpChannelInternal.idl
@@ -1,19 +1,18 @@
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* 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 "nsISupports.idl"
 
 %{C++
-#include "nsTArray.h"
-#include "nsCOMArray.h"
-
+template<class T> class nsTArray;
+template<class T> class nsCOMArray;
 class nsCString;
 %}
 [ptr] native StringArray(nsTArray<nsCString>);
 [ref] native securityMessagesArray(nsCOMArray<nsISecurityConsoleMessage>);
 
 interface nsISocketTransport;
 interface nsIAsyncInputStream;
 interface nsIAsyncOutputStream;
--- a/netwerk/socket/nsISOCKSSocketInfo.idl
+++ b/netwerk/socket/nsISOCKSSocketInfo.idl
@@ -2,17 +2,21 @@
  *
  * 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 "nsISupports.idl"
 
 %{ C++
-#include "mozilla/net/DNS.h"
+namespace mozilla {
+namespace net {
+union NetAddr;
+}
+}
 %}
 [ptr] native NetAddrPtr(mozilla::net::NetAddr);
 
 [scriptable, uuid(D5C0D1F9-22D7-47DC-BF91-D9AC6E1251A6)]
 interface nsISOCKSSocketInfo : nsISupports
 {
     [noscript] attribute NetAddrPtr destinationAddr;
     [noscript] attribute NetAddrPtr externalProxyAddr;
--- a/netwerk/socket/nsISSLSocketControl.idl
+++ b/netwerk/socket/nsISSLSocketControl.idl
@@ -4,17 +4,17 @@
  * 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 "nsISupports.idl"
 
 interface nsIInterfaceRequestor;
 
 %{C++
-#include "nsTArray.h"
+template<class T> class nsTArray;
 class nsCString;
 %}
 [ref] native nsCStringTArrayRef(nsTArray<nsCString>);
 
 [scriptable, builtinclass, uuid(c5eb9af4-238c-4fc6-bdec-d5ab5e7dce68)]
 interface nsISSLSocketControl : nsISupports {
     attribute nsIInterfaceRequestor     notificationCallbacks;
 
--- a/netwerk/streamconv/converters/nsFTPDirListingConv.cpp
+++ b/netwerk/streamconv/converters/nsFTPDirListingConv.cpp
@@ -9,16 +9,17 @@
 #include "prlog.h"
 #include "nsCOMPtr.h"
 #include "nsEscape.h"
 #include "nsStringStream.h"
 #include "nsIStreamListener.h"
 #include "nsCRT.h"
 #include "nsAutoPtr.h"
 #include "nsIChannel.h"
+#include "nsIURI.h"
 
 #include "ParseFTPList.h"
 #include <algorithm>
 
 #if defined(PR_LOGGING)
 //
 // Log module for FTP dir listing stream converter logging...
 //
--- a/netwerk/streamconv/public/mozITXTToHTMLConv.idl
+++ b/netwerk/streamconv/public/mozITXTToHTMLConv.idl
@@ -7,17 +7,16 @@
   Description: Currently only functions to enhance plain text with HTML tags.
   <p>
   Wrapper class for various parsing routines, that convert plain text to HTML.
   They try to recognize cites, URLs, plain text formattting like *bold* etc.
   See <http://www.bucksch.org/1/projects/mozilla/16507/> for a description.
  */
 
 #include "nsIStreamConverter.idl"
-#include "nsrootidl.idl"
 
 %{C++
 // {77c0e42a-1dd2-11b2-8ebf-edc6606f2f4b}
 #define MOZITXTTOHTMLCONV_CID \
     { 0x77c0e42a, 0x1dd2, 0x11b2, \
     { 0x8e, 0xbf, 0xed, 0xc6, 0x60, 0x6f, 0x2f, 0x4b } }
 	
 #define MOZ_TXTTOHTMLCONV_CONTRACTID \
--- a/netwerk/streamconv/public/nsIAppleFileDecoder.idl
+++ b/netwerk/streamconv/public/nsIAppleFileDecoder.idl
@@ -1,16 +1,16 @@
 /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* 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 "nsIOutputStream.idl"
-#include "nsIFile.idl"
 
+interface nsIFile;
 
 %{C++
 #define NS_APPLEFILEDECODER_CID                      \
 { /* 3a2bb281-64b8-11d5-9daa-bb433143c53c */         \
     0x3a2bb281,                                      \
     0x64b8,                                          \
     0x11d5,                                          \
     {0x9d, 0xaa, 0xbb, 0x43, 0x31, 0x43, 0xc5, 0x3c} \
--- a/netwerk/streamconv/public/nsIStreamConverter.idl
+++ b/netwerk/streamconv/public/nsIStreamConverter.idl
@@ -1,16 +1,16 @@
 /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* 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 "nsIStreamListener.idl"
-#include "nsIInputStream.idl"
-#include "nsIURI.idl"
+
+interface nsIInputStream;
 
 /**
  * nsIStreamConverter provides an interface to implement when you have code
  * that converts data from one type to another.
  *
  * Suppose you had code that converted plain text into HTML. You could implement
  * this interface to allow everyone else to use your conversion logic using a 
  * standard api.
--- a/netwerk/streamconv/public/nsIStreamConverterService.idl
+++ b/netwerk/streamconv/public/nsIStreamConverterService.idl
@@ -1,15 +1,17 @@
 /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* 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 "nsIInputStream.idl"
-#include "nsIStreamListener.idl"
+#include "nsISupports.idl"
+
+interface nsIInputStream;
+interface nsIStreamListener;
 
 %{C++
 #define NS_ISTREAMCONVERTER_KEY         "@mozilla.org/streamconv;1"
 %}
 
 /**
  * The nsIStreamConverterService is a higher level stream converter factory
  * responsible for locating and creating stream converters
--- a/netwerk/streamconv/public/nsITXTToHTMLConv.idl
+++ b/netwerk/streamconv/public/nsITXTToHTMLConv.idl
@@ -1,15 +1,14 @@
 /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* 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 "nsIStreamConverter.idl"
-#include "nsrootidl.idl"
 
 [scriptable, uuid(933355f6-1dd2-11b2-a9b0-d335b9e35983)]
 interface nsITXTToHTMLConv : nsIStreamConverter {
   /**
    * @param text: Title to set for the HTML document.  Only applicable if
    *              preFormatHTML(true) is called.
    * @result      The given title will be used to form an HTML document
    *              from the plain text document.
--- a/netwerk/test/TestUDPServerSocket.cpp
+++ b/netwerk/test/TestUDPServerSocket.cpp
@@ -4,16 +4,17 @@
 
 #include "TestCommon.h"
 #include "TestHarness.h"
 #include "nsIUDPServerSocket.h"
 #include "nsISocketTransportService.h"
 #include "nsISocketTransport.h"
 #include "nsIOutputStream.h"
 #include "nsIInputStream.h"
+#include "nsINetAddr.h"
 
 #define UDP_PORT 1234
 #define REQUEST  0x68656c6f
 #define RESPONSE 0x6f6c6568
 
 #define EXPECT_SUCCESS(rv, ...) \
   PR_BEGIN_MACRO \
   if (NS_FAILED(rv)) { \
--- a/netwerk/wifi/nsIWifiListener.idl
+++ b/netwerk/wifi/nsIWifiListener.idl
@@ -1,16 +1,15 @@
 /* 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 "nsISupports.idl"
-#include "nsIArray.idl"
 
-#include "nsIWifiAccessPoint.idl"
+interface nsIWifiAccessPoint;
 
 [scriptable, uuid(BCD4BEDE-F4A5-4A62-9071-D7A60174E376)]
 interface nsIWifiListener : nsISupports
 {
   /*
    * Called when the list of access points changes.
    *
    * @param accessPoints An array of nsIWifiAccessPoint representing all
--- a/netwerk/wifi/nsIWifiMonitor.idl
+++ b/netwerk/wifi/nsIWifiMonitor.idl
@@ -1,14 +1,15 @@
 /* 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 "nsISupports.idl"
-#include "nsIWifiListener.idl"
+
+interface nsIWifiListener;
 
 [scriptable, uuid(F289701E-D9AF-4685-BC2F-E4226FF7C018)]
 interface nsIWifiMonitor : nsISupports
 {
 
   /*
    * startWatching
    * aListener will be called once, then each time the list of wifi access points change.
--- a/netwerk/wifi/nsWifiMonitor.h
+++ b/netwerk/wifi/nsWifiMonitor.h
@@ -7,17 +7,17 @@
 
 #include "nsIWifiMonitor.h"
 #include "nsCOMPtr.h"
 #include "nsAutoPtr.h"
 #include "nsProxyRelease.h"
 #include "nsIThread.h"
 #include "nsIRunnable.h"
 #include "nsCOMArray.h"
-#include "nsIWifiMonitor.h"
+#include "nsIWifiListener.h"
 #include "mozilla/ReentrantMonitor.h"
 #include "prlog.h"
 #include "nsIObserver.h"
 #include "nsTArray.h"
 #include "nsITimer.h"
 #include "mozilla/Attributes.h"
 #include "nsIInterfaceRequestor.h"