summaryrefslogtreecommitdiffstats
path: root/extensions/universalchardet/src/xpcom/nsUniversalCharDetModule.cpp
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /extensions/universalchardet/src/xpcom/nsUniversalCharDetModule.cpp
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'extensions/universalchardet/src/xpcom/nsUniversalCharDetModule.cpp')
-rw-r--r--extensions/universalchardet/src/xpcom/nsUniversalCharDetModule.cpp52
1 files changed, 52 insertions, 0 deletions
diff --git a/extensions/universalchardet/src/xpcom/nsUniversalCharDetModule.cpp b/extensions/universalchardet/src/xpcom/nsUniversalCharDetModule.cpp
new file mode 100644
index 000000000..38e2e60bd
--- /dev/null
+++ b/extensions/universalchardet/src/xpcom/nsUniversalCharDetModule.cpp
@@ -0,0 +1,52 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* 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 "mozilla/ModuleUtils.h"
+
+#include "nsCOMPtr.h"
+
+#include "nspr.h"
+#include "nsString.h"
+#include "nsUniversalCharDetDll.h"
+#include "nsISupports.h"
+#include "nsICategoryManager.h"
+#include "nsIComponentManager.h"
+#include "nsIServiceManager.h"
+#include "nsICharsetDetector.h"
+#include "nsIStringCharsetDetector.h"
+
+#include "nsUniversalDetector.h"
+#include "nsUdetXPCOMWrapper.h"
+
+NS_GENERIC_FACTORY_CONSTRUCTOR(nsJAPSMDetector)
+NS_GENERIC_FACTORY_CONSTRUCTOR(nsJAStringPSMDetector)
+NS_DEFINE_NAMED_CID(NS_JA_PSMDETECTOR_CID);
+NS_DEFINE_NAMED_CID(NS_JA_STRING_PSMDETECTOR_CID);
+
+static const mozilla::Module::CIDEntry kChardetCIDs[] = {
+ { &kNS_JA_PSMDETECTOR_CID, false, nullptr, nsJAPSMDetectorConstructor },
+ { &kNS_JA_STRING_PSMDETECTOR_CID, false, nullptr, nsJAStringPSMDetectorConstructor },
+ { nullptr }
+};
+
+static const mozilla::Module::ContractIDEntry kChardetContracts[] = {
+ { NS_CHARSET_DETECTOR_CONTRACTID_BASE "ja_parallel_state_machine", &kNS_JA_PSMDETECTOR_CID },
+ { NS_STRCDETECTOR_CONTRACTID_BASE "ja_parallel_state_machine", &kNS_JA_STRING_PSMDETECTOR_CID },
+ { nullptr }
+};
+
+static const mozilla::Module::CategoryEntry kChardetCategories[] = {
+ { NS_CHARSET_DETECTOR_CATEGORY, "ja_parallel_state_machine", NS_CHARSET_DETECTOR_CONTRACTID_BASE "ja_parallel_state_machine" },
+ { nullptr }
+};
+
+static const mozilla::Module kChardetModule = {
+ mozilla::Module::kVersion,
+ kChardetCIDs,
+ kChardetContracts,
+ kChardetCategories
+};
+
+NSMODULE_DEFN(nsUniversalCharDetModule) = &kChardetModule;