nsSoundRequest::OnStreamComplete(nsIStreamLoader *aLoader,
nsMovieSoundRequest::OnStreamComplete(nsIStreamLoader *aLoader,
nsSoundRequest::OnStreamComplete(nsIStreamLoader *aLoader,                                        nsISupports *context,                                        nsresult aStatus,                                        PRUint32 stringLen,                                        const char *stringData){  NS_ENSURE_ARG(aLoader);    if (NS_FAILED(aStatus))    return NS_ERROR_FAILURE;  nsXPIDLCString  contentType;  nsCOMPtr<nsIRequest>    request;  aLoader->GetRequest(getter_AddRefs(request));  nsCOMPtr<nsIChannel>  channel = do_QueryInterface(request);  if (channel)    channel->GetContentType(getter_Copies(contentType));    // we could use a Pointer data handler type, and avoid this  // allocation/copy, in QuickTime 5 and above.  OSErr     err;  mDataHandle = ::TempNewHandle(stringLen, &err);  if (!mDataHandle) return NS_ERROR_OUT_OF_MEMORY;  ::BlockMoveData(stringData, *mDataHandle, stringLen);  NS_ASSERTION(mMovie == nsnull, "nsSoundRequest has a movie already");    err = ImportMovie(mDataHandle, stringLen, contentType);  if (err != noErr) {    Cleanup();    return NS_ERROR_FAILURE;  }  nsSound*    macSound = NS_REINTERPRET_CAST(nsSound*, mSound.get());  NS_ASSERTION(macSound, "Should have nsSound here");    // put it in the cache. Not vital that this succeeds.  // for the data size we just use the string data, since the movie simply wraps this  // (we have to keep the handle around until the movies are done playing)  nsresult rv = macSound->PutSoundInCache(channel, stringLen, NS_STATIC_CAST(nsIStreamLoaderObserver*, this));  NS_ASSERTION(NS_SUCCEEDED(rv), "Failed to put sound in cache");    return PlaySound();}