Bug 656826 part.2 Rename nsPrefService.cpp and move nsPrefService.h to public r=roc+bsmedberg
authorMasayuki Nakano <masayuki@d-toybox.com>
Mon, 23 May 2011 23:54:03 +0900
changeset 70106 0d754af939ec0c33130e8cc0d37baf903079558f
parent 70105 3c987837655070cdf3073ebe9da6cc6ab3afc7e6
child 70107 83eafb414d2b846134c75e49af5e465f31101401
push idunknown
push userunknown
push dateunknown
reviewersroc
bugs656826
milestone6.0a1
Bug 656826 part.2 Rename nsPrefService.cpp and move nsPrefService.h to public r=roc+bsmedberg
modules/libpref/public/Makefile.in
modules/libpref/public/Preferences.h
modules/libpref/src/Makefile.in
modules/libpref/src/Preferences.cpp
modules/libpref/src/nsPrefService.cpp
modules/libpref/src/nsPrefService.h
modules/libpref/src/nsPrefsFactory.cpp
--- a/modules/libpref/public/Makefile.in
+++ b/modules/libpref/public/Makefile.in
@@ -40,27 +40,33 @@ topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE		= pref
 GRE_MODULE	= 1
 
+EXPORTS_NAMESPACES = mozilla
+
 SDK_XPIDLSRCS   = \
               nsIPrefService.idl \
               nsIPrefBranch.idl \
               nsIPrefBranch2.idl \
               nsIPrefLocalizedString.idl \
               $(NULL)
 
 XPIDLSRCS	= \
               nsIPrefBranchInternal.idl \
               nsIRelativeFilePref.idl \
               $(NULL)
 
 EXPORTS     = \
               PPrefTuple.h \
-              PrefTuple.h
+              PrefTuple.h \
+              $(NULL)
+
+EXPORTS_mozilla = \
+              Preferences.h \
               $(NULL)
 
 include $(topsrcdir)/config/rules.mk
 
rename from modules/libpref/src/nsPrefService.h
rename to modules/libpref/public/Preferences.h
--- a/modules/libpref/src/nsPrefService.h
+++ b/modules/libpref/public/Preferences.h
@@ -32,18 +32,22 @@
  * use your version of this file under the terms of the MPL, indicate your
  * decision by deleting the provisions above and replace them with the notice
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
-#ifndef nsPrefService_h__
-#define nsPrefService_h__
+#ifndef mozilla_Preferences_h
+#define mozilla_Preferences_h
+
+#ifndef MOZILLA_INTERNAL_API
+#error "This header is only usable from within libxul (MOZILLA_INTERNAL_API)."
+#endif
 
 #include "nsIPrefService.h"
 #include "nsIPrefBranch.h"
 #include "nsIPrefBranchInternal.h"
 #include "nsIObserver.h"
 #include "nsCOMPtr.h"
 #include "nsWeakReference.h"
 
@@ -82,9 +86,9 @@ protected:
 
 private:
   nsCOMPtr<nsIPrefBranch2> mRootBranch;
   nsCOMPtr<nsIFile>        mCurrentFile;
 };
 
 } // namespace mozilla
 
-#endif // nsPrefService_h__
+#endif // mozilla_Preferences_h
--- a/modules/libpref/src/Makefile.in
+++ b/modules/libpref/src/Makefile.in
@@ -50,20 +50,20 @@ MODULE_NAME	= nsPrefModule
 ifeq ($(OS_ARCH)$(MOZ_ENABLE_LIBXUL),WINNT)
 LIBRARY_NAME	= xppref32
 endif
 GRE_MODULE	= 1
 LIBXUL_LIBRARY = 1
 
 CPPSRCS		= \
 			  nsPrefBranch.cpp	\
-			  nsPrefService.cpp	\
 			  nsPrefsFactory.cpp	\
 			  prefapi.cpp \
 			  prefread.cpp \
+			  Preferences.cpp	\
 			 $(NULL)
 
 DEFINES += -DOS_ARCH=$(OS_ARCH) \
            -DMOZ_WIDGET_TOOLKIT=$(MOZ_WIDGET_TOOLKIT) \
            $(NULL)
 
 # this comes from a system header; we should probably be using XP_WINCE or something
 ifdef WINCE
rename from modules/libpref/src/nsPrefService.cpp
rename to modules/libpref/src/Preferences.cpp
--- a/modules/libpref/src/nsPrefService.cpp
+++ b/modules/libpref/src/Preferences.cpp
@@ -35,17 +35,17 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "mozilla/dom/ContentChild.h"
 #include "nsXULAppAPI.h"
 
-#include "nsPrefService.h"
+#include "mozilla/Preferences.h"
 #include "nsAppDirectoryServiceDefs.h"
 #include "nsDirectoryServiceDefs.h"
 #include "nsICategoryManager.h"
 #include "nsCategoryManagerUtils.h"
 #include "nsNetUtil.h"
 #include "nsIFile.h"
 #include "nsIInputStream.h"
 #include "nsILocalFile.h"
--- a/modules/libpref/src/nsPrefsFactory.cpp
+++ b/modules/libpref/src/nsPrefsFactory.cpp
@@ -32,17 +32,17 @@
  * decision by deleting the provisions above and replace them with the notice
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "mozilla/ModuleUtils.h"
-#include "nsPrefService.h"
+#include "mozilla/Preferences.h"
 #include "nsPrefBranch.h"
 #include "prefapi.h"
 
 using namespace mozilla;
 
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(Preferences, Init)
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsPrefLocalizedString, Init)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsRelativeFilePref)