32 #include <sbIMediaItem.h>
34 #include <nsAutoPtr.h>
35 #include <nsStringGlue.h>
53 "helper:hasMoreElements",
79 sbRemoteWrappingSimpleEnumerator::GetRemotePlayer(
sbIRemotePlayer * *aRemotePlayer)
81 NS_ENSURE_STATE(mRemotePlayer);
82 NS_ENSURE_ARG_POINTER(aRemotePlayer);
85 *aRemotePlayer = nsnull;
87 nsCOMPtr<sbIRemotePlayer> remotePlayer;
89 rv = mRemotePlayer->QueryInterface( NS_GET_IID(
sbIRemotePlayer ), getter_AddRefs( remotePlayer ) );
90 NS_ENSURE_SUCCESS( rv, rv );
92 remotePlayer.swap( *aRemotePlayer );
104 sbRemoteWrappingSimpleEnumerator::HasMoreElements(PRBool* _retval)
106 NS_ENSURE_ARG_POINTER(_retval);
108 return mWrapped->HasMoreElements(_retval);
112 sbRemoteWrappingSimpleEnumerator::GetNext(
nsISupports** _retval)
114 NS_ENSURE_ARG_POINTER(_retval);
116 nsCOMPtr<nsISupports> supports;
117 nsresult rv =
mWrapped->GetNext(getter_AddRefs(supports));
118 NS_ENSURE_SUCCESS(rv, rv);
120 nsCOMPtr<sbIIndexedMediaItem> item = do_QueryInterface(supports, &rv);
121 if (NS_SUCCEEDED(rv)) {
123 nsRefPtr<sbRemoteIndexedMediaItem> indexedMediaItem =
125 NS_ENSURE_TRUE(indexedMediaItem, NS_ERROR_OUT_OF_MEMORY);
127 rv = indexedMediaItem->Init();
128 NS_ENSURE_SUCCESS(rv, rv);
133 nsCOMPtr<sbIMediaItem> item = do_QueryInterface(supports, &rv);
134 if (NS_SUCCEEDED(rv)) {
135 nsCOMPtr<sbIMediaItem> remoteItem;
137 NS_ENSURE_SUCCESS(rv, rv);
#define SB_IMPL_SECURITYCHECKEDCOMP_INIT(_class)
nsRefPtr< sbRemotePlayer > mRemotePlayer
NS_IMPL_ISUPPORTS4(sbRemoteWrappingSimpleEnumerator, nsIClassInfo, nsISecurityCheckedComponent, sbISecurityAggregator, nsISimpleEnumerator) NS_IMPL_CI_INTERFACE_GETTER3(sbRemoteWrappingSimpleEnumerator
This interface is a composition of many of our other interfaces with the goal of exposing a more web-...
static const char * sPublicRProperties[]
static const char * sPublicMethods[]
A marker interface for objects that aggregate the security mixin.
nsISecurityCheckedComponent
static const char * sPublicWProperties[]
static nsresult SB_WrapMediaItem(sbRemotePlayer *aRemotePlayer, sbIMediaItem *aMediaItem, sbIMediaItem **aRemoteMediaItem)
#define SB_IMPL_CLASSINFO_INTERFACES_ONLY(_class)
nsCOMPtr< nsISimpleEnumerator > mWrapped