Bug 899135 - Drop buffers in ScriptProcessorNode instead of buffering them when the...
[gecko.git] / modules / libjar / nsJARFactory.cpp
blobe3eff26ced2e3391555a25ad53dcb73ae112a4ef
1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #include <string.h>
8 #include "nscore.h"
10 #include "nsIComponentManager.h"
11 #include "nsIServiceManager.h"
12 #include "nsCOMPtr.h"
13 #include "mozilla/ModuleUtils.h"
14 #include "nsIJARFactory.h"
15 #include "nsJARProtocolHandler.h"
16 #include "nsJARURI.h"
17 #include "nsJAR.h"
19 NS_GENERIC_FACTORY_CONSTRUCTOR(nsJAR)
20 NS_GENERIC_FACTORY_CONSTRUCTOR(nsZipReaderCache)
21 NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsJARProtocolHandler,
22 nsJARProtocolHandler::GetSingleton)
23 NS_GENERIC_FACTORY_CONSTRUCTOR(nsJARURI)
25 NS_DEFINE_NAMED_CID(NS_ZIPREADER_CID);
26 NS_DEFINE_NAMED_CID(NS_ZIPREADERCACHE_CID);
27 NS_DEFINE_NAMED_CID(NS_JARPROTOCOLHANDLER_CID);
28 NS_DEFINE_NAMED_CID(NS_JARURI_CID);
30 static const mozilla::Module::CIDEntry kJARCIDs[] = {
31 { &kNS_ZIPREADER_CID, false, NULL, nsJARConstructor },
32 { &kNS_ZIPREADERCACHE_CID, false, NULL, nsZipReaderCacheConstructor },
33 { &kNS_JARPROTOCOLHANDLER_CID, false, NULL, nsJARProtocolHandlerConstructor },
34 { &kNS_JARURI_CID, false, NULL, nsJARURIConstructor },
35 { NULL }
38 static const mozilla::Module::ContractIDEntry kJARContracts[] = {
39 { "@mozilla.org/libjar/zip-reader;1", &kNS_ZIPREADER_CID },
40 { "@mozilla.org/libjar/zip-reader-cache;1", &kNS_ZIPREADERCACHE_CID },
41 { NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "jar", &kNS_JARPROTOCOLHANDLER_CID },
42 { NULL }
45 // Jar module shutdown hook
46 static void nsJarShutdown()
48 NS_IF_RELEASE(gJarHandler);
51 static const mozilla::Module kJARModule = {
52 mozilla::Module::kVersion,
53 kJARCIDs,
54 kJARContracts,
55 NULL,
56 NULL,
57 NULL,
58 nsJarShutdown
61 NSMODULE_DEFN(nsJarModule) = &kJARModule;