sbThreadPoolServiceModule.cpp
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set sw=2 :miv */
3 /*
4 //
5 // BEGIN SONGBIRD GPL
6 //
7 // This file is part of the Songbird web player.
8 //
9 // Copyright(c) 2005-2008 POTI, Inc.
10 // http://songbirdnest.com
11 //
12 // This file may be licensed under the terms of of the
13 // GNU General Public License Version 2 (the "GPL").
14 //
15 // Software distributed under the License is distributed
16 // on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
17 // express or implied. See the GPL for the specific language
18 // governing rights and limitations.
19 //
20 // You should have received a copy of the GPL along with this
21 // program. If not, go to http://www.gnu.org/licenses/gpl.html
22 // or write to the Free Software Foundation, Inc.,
23 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 //
25 // END SONGBIRD GPL
26 //
27 */
28 
34 #include "sbThreadPoolService.h"
35 
36 #include <nsIAppStartupNotifier.h>
37 #include <nsICategoryManager.h>
38 #include <nsIGenericFactory.h>
39 
40 #include <nsCOMPtr.h>
41 #include <nsServiceManagerUtils.h>
42 #include <nsXPCOM.h>
43 
45 
46 static NS_METHOD
47 sbThreadPoolServiceRegisterSelf(nsIComponentManager* aCompMgr,
48  nsIFile* aPath,
49  const char* registryLocation,
50  const char* componentType,
51  const nsModuleComponentInfo* info)
52 {
53  nsresult rv;
54  nsCOMPtr<nsICategoryManager> categoryManager =
55  do_GetService(NS_CATEGORYMANAGER_CONTRACTID, &rv);
56  NS_ENSURE_SUCCESS(rv, rv);
57 
58  rv = categoryManager->
59  AddCategoryEntry(NS_XPCOM_STARTUP_CATEGORY,
62  PR_TRUE, PR_TRUE, nsnull);
63  return rv;
64 }
65 
66 static NS_METHOD
67 sbThreadPoolServiceUnregisterSelf(nsIComponentManager* aCompMgr,
68  nsIFile* aPath,
69  const char* registryLocation,
70  const nsModuleComponentInfo* info)
71 {
72  nsresult rv;
73  nsCOMPtr<nsICategoryManager> categoryManager =
74  do_GetService(NS_CATEGORYMANAGER_CONTRACTID, &rv);
75  NS_ENSURE_SUCCESS(rv, rv);
76 
77  rv = categoryManager->DeleteCategoryEntry(NS_XPCOM_STARTUP_CATEGORY,
79  PR_TRUE);
80 
81  return rv;
82 }
83 
84 // Module component information.
85 static const nsModuleComponentInfo components[] =
86 {
87  {
91  sbThreadPoolServiceConstructor,
94  }
95 };
96 
97 // NSGetModule
static NS_METHOD sbThreadPoolServiceUnregisterSelf(nsIComponentManager *aCompMgr, nsIFile *aPath, const char *registryLocation, const nsModuleComponentInfo *info)
#define SB_THREADPOOLSERVICE_CLASSNAME
#define SB_THREADPOOLSERVICE_CID
_updateCookies aPath
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(sbMockDeviceFirmwareHandler, Init)
#define SB_THREADPOOLSERVICE_CONTRACTID
static NS_METHOD sbThreadPoolServiceRegisterSelf(nsIComponentManager *aCompMgr, nsIFile *aPath, const char *registryLocation, const char *componentType, const nsModuleComponentInfo *info)
Songbird Thread Pool Service.
function Init()
static const nsModuleComponentInfo components[]
NS_IMPL_NSGETMODULE(SongbirdIdentityServiceComponent, sbIdentityServiceComponent)