32 #include <nsIAppStartupNotifier.h>
33 #include <nsICategoryManager.h>
34 #include <nsIGenericFactory.h>
35 #include <nsILocalFile.h>
36 #include <nsIObserver.h>
37 #include <nsIObserverService.h>
38 #include <nsIPrefBranch.h>
39 #include <nsIPrefService.h>
40 #include <nsIRDFDataSource.h>
41 #include <nsISimpleEnumerator.h>
42 #include <nsISupportsPrimitives.h>
43 #include <sbILibraryFactory.h>
44 #include <sbILibraryManagerListener.h>
46 #include <nsArrayEnumerator.h>
47 #include <nsAutoLock.h>
48 #include <nsCOMArray.h>
49 #include <nsComponentManagerUtils.h>
50 #include <nsEnumeratorUtils.h>
51 #include <nsServiceManagerUtils.h>
69 #define NS_PROFILE_STARTUP_OBSERVER_ID "profile-after-change"
70 #define NS_PROFILE_TEARDOWN_OBSERVER_ID "profile-change-teardown"
77 static nsString sString;
88 TRACE(
"sbLibraryManager[0x%x] - Created",
this);
91 sbLibraryManager::~sbLibraryManager()
96 nsAutoLock::DestroyLock(mLock);
99 TRACE(
"LibraryManager[0x%x] - Destroyed",
this);
106 const char* aLoaderStr,
108 const nsModuleComponentInfo *aInfo)
111 nsCOMPtr<nsICategoryManager> categoryManager =
112 do_GetService(NS_CATEGORYMANAGER_CONTRACTID, &rv);
113 NS_ENSURE_SUCCESS(rv, rv);
115 rv = categoryManager->AddCategoryEntry(APPSTARTUP_CATEGORY,
119 PR_TRUE, PR_TRUE, nsnull);
120 NS_ENSURE_SUCCESS(rv, rv);
131 TRACE(
"sbLibraryManager[0x%x] - Init",
this);
136 PRBool success = mLibraryTable.Init();
137 NS_ENSURE_TRUE(success, NS_ERROR_FAILURE);
139 success = mListeners.Init();
140 NS_ENSURE_TRUE(success, NS_ERROR_FAILURE);
142 mLock = nsAutoLock::NewLock(
"sbLibraryManager::mLock");
143 NS_ENSURE_TRUE(mLock, NS_ERROR_OUT_OF_MEMORY);
147 mThreadManager = do_GetService(
"@mozilla.org/thread-manager;1", &rv);
148 NS_ENSURE_SUCCESS(rv, rv);
151 do_GetService(NS_OBSERVERSERVICE_CONTRACTID, &rv);
152 NS_ENSURE_SUCCESS(rv, rv);
156 NS_ENSURE_SUCCESS(rv, rv);
160 NS_ENSURE_SUCCESS(rv, rv);
175 PLDHashOperator PR_CALLBACK
176 sbLibraryManager::AddLibrariesToCOMArrayCallback(nsStringHashKey::KeyType aKey,
177 sbLibraryInfo* aEntry,
180 NS_ASSERTION(aEntry,
"Null entry in hashtable!");
181 NS_ASSERTION(aEntry->library,
"Null library in hashtable!");
183 nsCOMArray<sbILibrary>*
array =
184 static_cast<nsCOMArray<sbILibrary>*
>(aUserData);
186 PRBool success = array->AppendObject(aEntry->library);
187 NS_ENSURE_TRUE(success, PL_DHASH_STOP);
189 return PL_DHASH_NEXT;
202 PLDHashOperator PR_CALLBACK
203 sbLibraryManager::AddStartupLibrariesToCOMArrayCallback(nsStringHashKey::KeyType aKey,
204 sbLibraryInfo* aEntry,
207 NS_ASSERTION(aEntry,
"Null entry in hashtable!");
208 NS_ASSERTION(aEntry->library,
"Null library in hashtable!");
210 nsCOMArray<sbILibrary>* array =
211 static_cast<nsCOMArray<sbILibrary>*
>(aUserData);
213 if (aEntry->loader && aEntry->loadAtStartup) {
214 PRBool success = array->AppendObject(aEntry->library);
215 NS_ENSURE_TRUE(success, PL_DHASH_STOP);
218 return PL_DHASH_NEXT;
231 PLDHashOperator PR_CALLBACK
232 sbLibraryManager::AddListenersToCOMArrayCallback(nsISupportsHashKey::KeyType aKey,
236 NS_ASSERTION(aKey,
"Null key in hashtable!");
237 NS_ASSERTION(aEntry,
"Null entry in hashtable!");
239 nsCOMArray<sbILibraryManagerListener>* array =
240 static_cast<nsCOMArray<sbILibraryManagerListener>*
>(aUserData);
242 PRBool success = array->AppendObject(aEntry);
243 NS_ENSURE_TRUE(success, PL_DHASH_STOP);
245 return PL_DHASH_NEXT;
259 PLDHashOperator PR_CALLBACK
260 sbLibraryManager::AssertAllLibrariesCallback(nsStringHashKey::KeyType aKey,
261 sbLibraryInfo* aEntry,
264 NS_ASSERTION(aEntry,
"Null entry in hashtable!");
265 NS_ASSERTION(aEntry->library,
"Null library in hashtable!");
267 nsCOMPtr<nsIRDFDataSource> ds =
static_cast<nsIRDFDataSource*
>(aUserData);
268 NS_ENSURE_TRUE(ds, PL_DHASH_STOP);
270 nsresult rv = AssertLibrary(ds, aEntry->library);
271 NS_ENSURE_SUCCESS(rv, PL_DHASH_STOP);
273 return PL_DHASH_NEXT;
285 sbLibraryManager::AssertLibrary(nsIRDFDataSource* aDataSource,
288 NS_NOTYETIMPLEMENTED(
"sbLibraryManager::AssertLibrary");
289 return NS_ERROR_NOT_IMPLEMENTED;
301 sbLibraryManager::UnassertLibrary(nsIRDFDataSource* aDataSource,
304 NS_NOTYETIMPLEMENTED(
"sbLibraryManager::UnassertLibrary");
305 return NS_ERROR_NOT_IMPLEMENTED;
315 sbLibraryManager::GenerateDataSource()
317 NS_ASSERTION(!mDataSource,
"GenerateDataSource called twice!");
320 mDataSource = do_CreateInstance(NS_RDF_DATASOURCE_CONTRACTID_PREFIX
321 "in-memory-datasource", &rv);
322 NS_ENSURE_SUCCESS(rv, rv);
324 PRUint32 libraryCount = mLibraryTable.Count();
330 mLibraryTable.EnumerateRead(AssertAllLibrariesCallback, mDataSource);
331 NS_ENSURE_TRUE(enumCount == libraryCount, NS_ERROR_FAILURE);
345 sbLibraryManager::NotifyListenersLibraryRegistered(
sbILibrary* aLibrary)
347 TRACE(
"sbLibraryManager[0x%x] - NotifyListenersLibraryRegistered",
this);
349 nsCOMArray<sbILibraryManagerListener> listeners;
351 nsAutoLock lock(mLock);
352 mListeners.EnumerateRead(AddListenersToCOMArrayCallback, &listeners);
355 PRInt32
count = listeners.Count();
356 for (PRInt32 index = 0; index <
count; index++) {
357 nsCOMPtr<sbILibraryManagerListener>
listener =
358 listeners.ObjectAt(index);
359 NS_ASSERTION(listener,
"Null listener!");
361 listener->OnLibraryRegistered(aLibrary);
374 sbLibraryManager::NotifyListenersLibraryUnregistered(
sbILibrary* aLibrary)
376 TRACE(
"sbLibraryManager[0x%x] - NotifyListenersLibraryUnregistered",
this);
378 nsCOMArray<sbILibraryManagerListener> listeners;
380 nsAutoLock lock(mLock);
381 mListeners.EnumerateRead(AddListenersToCOMArrayCallback, &listeners);
384 PRInt32 count = listeners.Count();
385 for (PRInt32 index = 0; index <
count; index++) {
386 nsCOMPtr<sbILibraryManagerListener> listener =
387 listeners.ObjectAt(index);
388 NS_ASSERTION(listener,
"Null listener!");
390 listener->OnLibraryUnregistered(aLibrary);
395 sbLibraryManager::InvokeLoaders()
397 TRACE(
"sbLibraryManager[0x%x] - InvokeLoaders",
this);
400 nsCOMArray<sbILibraryLoader> loaders = mLoaderCache.GetEntries();
401 PRInt32 count = loaders.Count();
402 for (PRInt32 index = 0; index <
count; index++) {
403 mCurrentLoader = loaders.ObjectAt(index);
404 NS_ASSERTION(mCurrentLoader,
"Null pointer!");
407 mCurrentLoader->OnRegisterStartupLibraries(
this);
408 NS_WARN_IF_FALSE(NS_SUCCEEDED(rv),
"OnRegisterStartupLibraries failed!");
410 mCurrentLoader = nsnull;
421 sbLibraryManager::SetLibraryLoadsAtStartupInternal(
sbILibrary* aLibrary,
422 PRBool aLoadAtStartup,
423 sbLibraryInfo** aInfo)
425 TRACE(
"sbLibraryManager[0x%x] - SetLibraryLoadsAtStartupInternal",
this);
427 nsresult rv = NS_ERROR_NOT_AVAILABLE;
429 nsAutoPtr<sbLibraryInfo> libraryInfo(*aInfo ? *aInfo :
new sbLibraryInfo());
430 NS_ENSURE_TRUE(libraryInfo, NS_ERROR_OUT_OF_MEMORY);
434 nsAutoString libraryGUID;
435 rv = aLibrary->GetGuid(libraryGUID);
436 NS_ENSURE_SUCCESS(rv, rv);
438 nsAutoLock lock(mLock);
440 sbLibraryInfo* tableLibraryInfo;
441 if (!mLibraryTable.Get(libraryGUID, &tableLibraryInfo)) {
442 NS_WARNING(
"Can't modify the startup of an unregistered library!");
443 return NS_ERROR_INVALID_ARG;
447 libraryInfo->loader = tableLibraryInfo->loader;
448 libraryInfo->library = tableLibraryInfo->library;
449 libraryInfo->loadAtStartup = tableLibraryInfo->loadAtStartup;
452 if (libraryInfo->loader) {
453 rv = libraryInfo->loader->OnLibraryStartupModified(aLibrary,
455 NS_ENSURE_SUCCESS(rv, rv);
457 libraryInfo->loadAtStartup = aLoadAtStartup;
462 nsCOMArray<sbILibraryLoader> loaders;
464 nsAutoLock lock(mLock);
465 nsCOMArray<sbILibraryLoader> cachedLoaders = mLoaderCache.GetEntries();
467 loaderCount = cachedLoaders.Count();
468 loaders.SetCapacity(loaderCount);
469 loaders.AppendObjects(cachedLoaders);
472 NS_ENSURE_TRUE(loaderCount > 0, NS_ERROR_NOT_AVAILABLE);
474 for (PRInt32 index = 0; index < loaderCount; index++) {
475 nsCOMPtr<sbILibraryLoader> cachedLoader = loaders.ObjectAt(index);
476 NS_ASSERTION(cachedLoader,
"Null pointer!");
478 rv = cachedLoader->OnLibraryStartupModified(aLibrary, aLoadAtStartup);
479 if (NS_SUCCEEDED(rv)) {
480 libraryInfo->loader = cachedLoader;
481 libraryInfo->loadAtStartup = aLoadAtStartup;
488 return NS_ERROR_NOT_AVAILABLE;
491 *aInfo = libraryInfo.forget();
502 nsCOMPtr<nsIPrefBranch> prefService =
504 NS_ENSURE_SUCCESS(rv, rv);
506 nsCOMPtr<nsISupportsString> supportsString;
509 getter_AddRefs(supportsString));
510 NS_ENSURE_SUCCESS(rv, rv);
512 nsAutoString mainLibraryGUID;
513 rv = supportsString->GetData(mainLibraryGUID);
514 NS_ENSURE_SUCCESS(rv, rv);
516 rv = GetLibrary(mainLibraryGUID, _retval);
517 NS_ENSURE_SUCCESS(rv, rv);
526 sbLibraryManager::GetDataSource(nsIRDFDataSource** aDataSource)
528 TRACE(
"sbLibraryManager[0x%x] - GetDataSource",
this);
529 NS_ENSURE_ARG_POINTER(aDataSource);
531 nsAutoLock lock(mLock);
534 nsresult rv = GenerateDataSource();
535 NS_ENSURE_SUCCESS(rv, rv);
538 NS_ADDREF(*aDataSource = mDataSource);
546 sbLibraryManager::GetLibrary(
const nsAString& aGuid,
549 TRACE(
"sbLibraryManager[0x%x] - GetLibrary",
this);
550 NS_ENSURE_ARG_POINTER(_retval);
552 nsCOMPtr<sbILibrary> library;
555 nsAutoLock lock(mLock);
557 sbLibraryInfo* libraryInfo;
558 PRBool exists = mLibraryTable.Get(aGuid, &libraryInfo);
559 NS_ENSURE_TRUE(exists, NS_ERROR_NOT_AVAILABLE);
561 NS_ASSERTION(libraryInfo->library,
"Null library in hash table!");
562 library = libraryInfo->library;
565 NS_ADDREF(*_retval = library);
575 TRACE(
"sbLibraryManager[0x%x] - GetLibraries",
this);
576 NS_ENSURE_ARG_POINTER(_retval);
578 nsCOMArray<sbILibrary> libraryArray;
581 nsAutoLock lock(mLock);
583 PRUint32 libraryCount = mLibraryTable.Count();
585 return NS_NewEmptyEnumerator(_retval);
588 libraryArray.SetCapacity(libraryCount);
591 mLibraryTable.EnumerateRead(AddLibrariesToCOMArrayCallback,
593 NS_ENSURE_TRUE(enumCount == libraryCount, NS_ERROR_FAILURE);
596 return NS_NewArrayEnumerator(_retval, libraryArray);
605 TRACE(
"sbLibraryManager[0x%x] - GetStartupLibraries",
this);
606 NS_ENSURE_ARG_POINTER(_retval);
608 nsCOMArray<sbILibrary> libraryArray;
611 nsAutoLock lock(mLock);
613 PRUint32 libraryCount = mLibraryTable.Count();
615 return NS_NewEmptyEnumerator(_retval);
618 libraryArray.SetCapacity(libraryCount);
621 mLibraryTable.EnumerateRead(AddStartupLibrariesToCOMArrayCallback,
623 NS_ENSURE_TRUE(enumCount == libraryCount, NS_ERROR_FAILURE);
626 return NS_NewArrayEnumerator(_retval, libraryArray);
633 sbLibraryManager::RegisterLibrary(
sbILibrary* aLibrary,
634 PRBool aLoadAtStartup)
636 TRACE(
"sbLibraryManager[0x%x] - RegisterLibrary",
this);
637 NS_ENSURE_ARG_POINTER(aLibrary);
639 nsAutoString libraryGUID;
640 nsresult rv = aLibrary->GetGuid(libraryGUID);
641 NS_ENSURE_SUCCESS(rv, rv);
644 nsAutoLock lock(mLock);
646 if (mLibraryTable.Get(libraryGUID, nsnull)) {
647 NS_WARNING(
"Registering a library that has already been registered!");
652 nsAutoPtr<sbLibraryInfo> newLibraryInfo(
new sbLibraryInfo());
653 NS_ENSURE_TRUE(newLibraryInfo, NS_ERROR_OUT_OF_MEMORY);
655 newLibraryInfo->library = aLibrary;
656 newLibraryInfo->loader = mCurrentLoader;
658 if (aLoadAtStartup) {
659 if (mCurrentLoader) {
660 newLibraryInfo->loadAtStartup = PR_TRUE;
663 sbLibraryInfo* libraryInfo = newLibraryInfo;
664 rv = SetLibraryLoadsAtStartupInternal(aLibrary, aLoadAtStartup,
667 NS_WARNING(
"No loader can add this library to its startup group.");
668 newLibraryInfo->loadAtStartup = PR_FALSE;
674 nsAutoLock lock(mLock);
676 PRBool success = mLibraryTable.Put(libraryGUID, newLibraryInfo);
677 NS_ENSURE_TRUE(success, NS_ERROR_FAILURE);
679 newLibraryInfo.forget();
684 rv = AssertLibrary(mDataSource, aLibrary);
685 NS_WARN_IF_FALSE(NS_SUCCEEDED(rv),
"Failed to update dataSource!");
689 if (!mCurrentLoader) {
690 NotifyListenersLibraryRegistered(aLibrary);
700 sbLibraryManager::UnregisterLibrary(
sbILibrary* aLibrary)
702 TRACE(
"sbLibraryManager[0x%x] - UnregisterLibrary",
this);
703 NS_ENSURE_ARG_POINTER(aLibrary);
705 NS_ASSERTION(!mCurrentLoader,
"Shouldn't call this within InvokeLoaders!");
707 nsAutoString libraryGUID;
708 nsresult rv = aLibrary->GetGuid(libraryGUID);
709 NS_ENSURE_SUCCESS(rv, rv);
712 nsAutoLock lock (mLock);
714 sbLibraryInfo* libInfo;
715 if (!mLibraryTable.Get(libraryGUID, &libInfo)) {
716 NS_WARNING(
"Unregistering a library that was never registered!");
720 mLibraryTable.Remove(libraryGUID);
724 if (!mCurrentLoader) {
725 NotifyListenersLibraryUnregistered(aLibrary);
729 rv = UnassertLibrary(mDataSource, aLibrary);
730 NS_WARN_IF_FALSE(NS_SUCCEEDED(rv),
"Failed to update dataSource!");
740 sbLibraryManager::SetLibraryLoadsAtStartup(
sbILibrary* aLibrary,
741 PRBool aLoadAtStartup)
743 TRACE(
"sbLibraryManager[0x%x] - SetLibraryLoadsAtStartup",
this);
744 NS_ENSURE_ARG_POINTER(aLibrary);
746 sbLibraryInfo* outLibInfo = nsnull;
747 nsresult rv = SetLibraryLoadsAtStartupInternal(aLibrary, aLoadAtStartup,
749 NS_ENSURE_SUCCESS(rv, rv);
752 nsAutoPtr<sbLibraryInfo> libraryInfo(outLibInfo);
766 nsAutoString libraryGUID;
767 rv = aLibrary->GetGuid(libraryGUID);
768 NS_ENSURE_SUCCESS(rv, rv);
770 nsAutoLock lock(mLock);
772 if (!mLibraryTable.Get(libraryGUID, nsnull)) {
773 NS_WARNING(
"Another thread unregistered the library you're trying to modify!");
774 return NS_ERROR_UNEXPECTED;
777 PRBool success = mLibraryTable.Put(libraryGUID, libraryInfo);
778 NS_ENSURE_TRUE(success, NS_ERROR_FAILURE);
780 libraryInfo.forget();
788 sbLibraryManager::GetLibraryLoadsAtStartup(
sbILibrary* aLibrary,
791 TRACE(
"sbLibraryManager[0x%x] - GetLibraryLoadsAtStartup",
this);
792 NS_ENSURE_ARG_POINTER(aLibrary);
793 NS_ENSURE_ARG_POINTER(_retval);
795 nsAutoString libraryGUID;
796 nsresult rv = aLibrary->GetGuid(libraryGUID);
797 NS_ENSURE_SUCCESS(rv, rv);
799 nsAutoLock lock(mLock);
801 sbLibraryInfo* libraryInfo;
802 if (!mLibraryTable.Get(libraryGUID, &libraryInfo)) {
803 NS_WARNING(
"Can't check the startup of an unregistered library!");
804 return NS_ERROR_INVALID_ARG;
807 *_retval = libraryInfo->loader && libraryInfo->loadAtStartup;
815 sbLibraryManager::HasLibrary(
sbILibrary* aLibrary,
818 TRACE(
"sbLibraryManager[0x%x] - HasLibrary",
this);
819 NS_ENSURE_ARG_POINTER(aLibrary);
820 NS_ENSURE_ARG_POINTER(_retval);
822 nsString libraryGUID;
823 nsresult rv = aLibrary->GetGuid(libraryGUID);
824 NS_ENSURE_SUCCESS(rv, rv);
826 nsAutoLock lock(mLock);
827 *_retval = mLibraryTable.Get(libraryGUID, nsnull);
837 TRACE(
"sbLibraryManager[0x%x] - AddListener",
this);
838 NS_ENSURE_ARG_POINTER(aListener);
841 nsAutoLock lock(mLock);
843 if (mListeners.Get(aListener, nsnull)) {
844 NS_WARNING(
"Trying to add a listener twice!");
851 nsCOMPtr<sbILibraryManagerListener> proxy;
855 NS_PROXY_SYNC | NS_PROXY_ALWAYS,
856 getter_AddRefs(proxy));
857 NS_ENSURE_SUCCESS(rv, rv);
859 nsAutoLock lock(mLock);
862 PRBool success = mListeners.Put(aListener, proxy);
863 NS_ENSURE_TRUE(success, NS_ERROR_OUT_OF_MEMORY);
874 TRACE(
"sbLibraryManager[0x%x] - RemoveListener",
this);
875 NS_ENSURE_ARG_POINTER(aListener);
877 nsAutoLock lock(mLock);
880 if (!mListeners.Get(aListener, nsnull)) {
881 NS_WARNING(
"Trying to remove a listener that was never added!");
884 mListeners.Remove(aListener);
893 sbLibraryManager::GetContentURI(nsIURI* aURI,
896 TRACE(
"sbLibraryManager[0x%x] - GetContentURI",
this);
897 NS_ENSURE_ARG_POINTER(aURI);
898 NS_ENSURE_ARG_POINTER(_retval);
907 sbLibraryManager::GetFileContentURI(nsIFile* aFile,
910 TRACE(
"sbLibraryManager[0x%x] - GetFileContentURI",
this);
911 NS_ENSURE_ARG_POINTER(aFile);
912 NS_ENSURE_ARG_POINTER(_retval);
922 sbLibraryManager::GetCanonicalPath(nsIFile *aFile, nsIFile **_retval)
925 nsCOMPtr<nsIFile> outFile;
926 NS_ENSURE_ARG_POINTER(aFile);
927 NS_ENSURE_ARG_POINTER(_retval);
930 nsString originalPath, canonicalizedLeafName;
931 rv = aFile->GetPath(originalPath);
932 NS_ENSURE_SUCCESS(rv, rv);
934 WIN32_FIND_DATA findData = {0};
935 HANDLE findResult = ::FindFirstFileEx(originalPath.BeginReading(),
938 FindExSearchNameMatch,
941 NS_ENSURE_FALSE(findResult == INVALID_HANDLE_VALUE, NS_ERROR_FAILURE);
942 canonicalizedLeafName.Assign(findData.cFileName);
943 ::FindClose(findResult);
944 rv = aFile->Clone(getter_AddRefs(outFile));
945 NS_ENSURE_SUCCESS(rv, rv);
946 rv = outFile->SetLeafName(canonicalizedLeafName);
947 NS_ENSURE_SUCCESS(rv, rv);
950 rv = aFile->Clone(getter_AddRefs(outFile));
951 NS_ENSURE_SUCCESS(rv, rv);
954 outFile.forget(_retval);
964 const PRUnichar*
aData)
966 TRACE(
"sbLibraryManager[0x%x] - Observe: %s",
this, aTopic);
970 do_GetService(NS_OBSERVERSERVICE_CONTRACTID, &rv);
972 if (strcmp(aTopic, APPSTARTUP_TOPIC) == 0) {
977 if (NS_SUCCEEDED(rv)) {
985 rv = observerService->NotifyObservers(NS_ISUPPORTS_CAST(
sbILibraryManager*,
this),
988 NS_ENSURE_SUCCESS(rv, rv);
995 if (NS_SUCCEEDED(rv)) {
1000 rv = observerService->NotifyObservers(NS_ISUPPORTS_CAST(
sbILibraryManager*,
this),
1003 NS_ENSURE_SUCCESS(rv, rv);
1006 rv = observerService->NotifyObservers(NS_ISUPPORTS_CAST(
sbILibraryManager*,
this),
1009 NS_ENSURE_SUCCESS(rv, rv);
1011 mLibraryTable.Clear();
1014 rv = observerService->NotifyObservers(NS_ISUPPORTS_CAST(
sbILibraryManager*,
this),
1017 NS_ENSURE_SUCCESS(rv, rv);
1022 NS_NOTREACHED(
"Observing a topic that wasn't handled!");
Manages the lifecycle of libraries in the system.
#define SB_PRLOG_SETUP(x)
const SB_LIBRARY_MANAGER_READY_TOPIC
static nsCOMPtr< nsIObserverService > observerService
#define SB_LIBRARY_MANAGER_SHUTDOWN_TOPIC
const NS_PREFSERVICE_CONTRACTID
static nsresult GetFileContentURI(nsIFile *aFile, nsIURI **_retval)
Return a library content URI for the file specified by aFile. Special processing is required to conve...
Songbird Library Manager Definition.
nsresult do_GetProxyForObject(nsIEventTarget *aTarget, REFNSIID aIID, nsISupports *aObj, PRInt32 aProxyType, void **aProxyObject)
static nsresult GetContentURI(nsIURI *aURI, nsIURI **_retval, nsIIOService *aIOService=nsnull)
Return a library content URI for the URI specified by aURI. A library content URI is a specially form...
#define SB_LIBRARY_MANAGER_AFTER_SHUTDOWN_TOPIC
nsresult Init()
Register with the Observer Service.
Manages the lifecycle of libraries in the system.
#define SB_LIBRARY_LOADER_CATEGORY
PRBool SB_IsMainThread(nsIThreadManager *aThreadManager)
#define NS_PROFILE_TEARDOWN_OBSERVER_ID
Songbird Thread Utilities Definitions.
Media library abstraction.
#define SB_PREF_MAIN_LIBRARY
static NS_METHOD RegisterSelf(nsIComponentManager *aCompMgr, nsIFile *aPath, const char *aLoaderStr, const char *aType, const nsModuleComponentInfo *aInfo)
nsresult GetMainLibrary(sbILibrary **aMainLibrary)
NS_IMPL_THREADSAFE_ISUPPORTS4(sbLibraryManager, nsIObserver, nsISupportsWeakReference, sbILibraryManager, sbILibraryUtils) static nsString sString
#define NS_PROFILE_STARTUP_OBSERVER_ID
#define SONGBIRD_LIBRARYMANAGER_DESCRIPTION
#define SONGBIRD_LIBRARYMANAGER_CONTRACTID
Set of library utilities.
#define SB_UNUSED_IN_RELEASE(decl)
const SB_LIBRARY_MANAGER_BEFORE_SHUTDOWN_TOPIC
_updateTextAndScrollDataForFrame aData