sbBaseMediaItemDownloadJob.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  *=BEGIN SONGBIRD GPL
5  *
6  * This file is part of the Songbird web player.
7  *
8  * Copyright(c) 2005-2010 POTI, Inc.
9  * http://www.songbirdnest.com
10  *
11  * This file may be licensed under the terms of of the
12  * GNU General Public License Version 2 (the ``GPL'').
13  *
14  * Software distributed under the License is distributed
15  * on an ``AS IS'' basis, WITHOUT WARRANTY OF ANY KIND, either
16  * express or implied. See the GPL for the specific language
17  * governing rights and limitations.
18  *
19  * You should have received a copy of the GPL along with this
20  * program. If not, go to http://www.gnu.org/licenses/gpl.html
21  * or write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23  *
24  *=END SONGBIRD GPL
25  */
26 
27 //------------------------------------------------------------------------------
28 //------------------------------------------------------------------------------
29 //
30 // Base media item download job.
31 //
32 //------------------------------------------------------------------------------
33 //------------------------------------------------------------------------------
34 
40 //------------------------------------------------------------------------------
41 //
42 // Base media item download job imported services.
43 //
44 //------------------------------------------------------------------------------
45 
46 // Self imports.
48 
49 // Songbird imports.
50 #include <sbPropertiesCID.h>
52 #include <sbStringUtils.h>
54 
55 // Mozilla imports.
56 #include <nsAutoLock.h>
57 #include <nsIURI.h>
58 #include <nsIURL.h>
59 
60 
61 //------------------------------------------------------------------------------
62 //
63 // Base media item download job logging services.
64 //
65 //------------------------------------------------------------------------------
66 
74 #include "prlog.h"
75 #ifdef PR_LOGGING
76 static PRLogModuleInfo* gBaseMediaItemDownloadJobLog = nsnull;
77 #define TRACE(args) PR_LOG(gBaseMediaItemDownloadJobLog, PR_LOG_DEBUG, args)
78 #define LOG(args) PR_LOG(gBaseMediaItemDownloadJobLog, PR_LOG_WARN, args)
79 #ifdef __GNUC__
80 #define __FUNCTION__ __PRETTY_FUNCTION__
81 #endif /* __GNUC__ */
82 #else
83 #define TRACE(args) /* nothing */
84 #define LOG(args) /* nothing */
85 #endif /* PR_LOGGING */
86 
87 
88 //------------------------------------------------------------------------------
89 //
90 // Base media item download job nsISupports implementation.
91 //
92 //------------------------------------------------------------------------------
93 
99 
100 
101 //------------------------------------------------------------------------------
102 //
103 // Base media item download job sbIMediaItemDownloadJob implementation.
104 //
105 //------------------------------------------------------------------------------
106 
107 //-------------------------------------
108 //
109 // start
110 //
111 // \see sbIMediaItemDownloadJob
112 //
113 
114 NS_IMETHODIMP
116 {
117  TRACE(("%s[%.8x]", __FUNCTION__, this));
118 
119  // Function variables.
120  nsresult rv;
121 
122  // Get the download URI.
123  nsCOMPtr<nsIURI> downloadURI;
124  rv = GetDownloadURI(getter_AddRefs(downloadURI));
125  NS_ENSURE_SUCCESS(rv, rv);
126 
127  // Start downloading from the download URI.
128  rv = Start(downloadURI);
129  NS_ENSURE_SUCCESS(rv, rv);
130 
131  return NS_OK;
132 }
133 
134 
135 //
136 // Getters/setters.
137 //
138 
139 //-------------------------------------
140 //
141 // downloadedFile
142 //
143 // \see sbIMediaItemDownloadJob
144 //
145 
146 NS_IMETHODIMP
147 sbBaseMediaItemDownloadJob::GetDownloadedFile(nsIFile** aDownloadedFile)
148 {
149  TRACE(("%s[%.8x]", __FUNCTION__, this));
150  NS_ENSURE_ARG_POINTER(aDownloadedFile);
151 
152  // Get the file downloader under the lock.
153  nsCOMPtr<sbIFileDownloader> fileDownloader;
154  {
155  nsAutoLock autoLock(mLock);
156  fileDownloader = mFileDownloader;
157  }
158  NS_ENSURE_TRUE(fileDownloader, NS_ERROR_NOT_AVAILABLE);
159 
160  // Get the downloaded file.
161  nsresult rv = fileDownloader->GetDestinationFile(aDownloadedFile);
162  NS_ENSURE_SUCCESS(rv, rv);
163 
164  return NS_OK;
165 }
166 
167 
168 //-------------------------------------
169 //
170 // properties
171 //
172 // \see sbIMediaItemDownloadJob
173 //
174 
175 NS_IMETHODIMP
176 sbBaseMediaItemDownloadJob::GetProperties(sbIPropertyArray** aProperties)
177 {
178  NS_ENSURE_ARG_POINTER(aProperties);
179  nsCOMPtr<sbIMutablePropertyArray> properties;
180  {
181  nsAutoLock autoLock(mLock);
182  properties = mProperties;
183  }
184  return CallQueryInterface(properties, aProperties);
185 }
186 
187 
188 //-------------------------------------
189 //
190 // temporaryFileFactory
191 //
192 // \see sbIMediaItemDownloadJob
193 //
194 
195 NS_IMETHODIMP
196 sbBaseMediaItemDownloadJob::GetTemporaryFileFactory
197  (sbITemporaryFileFactory** aTemporaryFileFactory)
198 {
199  NS_ENSURE_ARG_POINTER(aTemporaryFileFactory);
200  nsAutoLock autoLock(mLock);
201  NS_IF_ADDREF(*aTemporaryFileFactory = mTemporaryFileFactory);
202  return NS_OK;
203 }
204 
205 NS_IMETHODIMP
206 sbBaseMediaItemDownloadJob::SetTemporaryFileFactory
207  (sbITemporaryFileFactory* aTemporaryFileFactory)
208 {
209  nsAutoLock autoLock(mLock);
210  mTemporaryFileFactory = aTemporaryFileFactory;
211  return NS_OK;
212 }
213 
214 
215 //------------------------------------------------------------------------------
216 //
217 // Base media item download job sbIJobProgress implementation.
218 //
219 //------------------------------------------------------------------------------
220 
221 //-------------------------------------
222 //
223 // addJobProgressListener
224 //
225 // \see sbIJobProgress
226 //
227 
228 NS_IMETHODIMP
229 sbBaseMediaItemDownloadJob::AddJobProgressListener
230  (sbIJobProgressListener* aListener)
231 {
232  TRACE(("%s[%.8x] 0x%08x", __FUNCTION__, this, aListener));
233  NS_ENSURE_ARG_POINTER(aListener);
234 
235  // Add the listener to the list of listeners.
236  nsAutoLock autoLock(mLock);
237  if (!mListenerList.Contains(aListener)) {
238  nsCOMPtr<sbIJobProgressListener>*
239  appendedElement = mListenerList.AppendElement(aListener);
240  NS_ENSURE_TRUE(appendedElement, NS_ERROR_OUT_OF_MEMORY);
241  }
242  else {
243  NS_WARNING("Listener already added");
244  }
245 
246  return NS_OK;
247 }
248 
249 
250 //-------------------------------------
251 //
252 // removeJobProgressListener
253 //
254 // \see sbIJobProgress
255 //
256 
257 NS_IMETHODIMP
258 sbBaseMediaItemDownloadJob::RemoveJobProgressListener
259  (sbIJobProgressListener* aListener)
260 {
261  TRACE(("%s[%.8x] 0x%08x", __FUNCTION__, this, aListener));
262  NS_ENSURE_ARG_POINTER(aListener);
263 
264  // Remove the listener from the list of listeners.
265  nsAutoLock autoLock(mLock);
266  if (mListenerList.Contains(aListener)) {
267  mListenerList.RemoveElement(aListener);
268  }
269  else {
270  NS_WARNING("Listener not present");
271  }
272 
273  return NS_OK;
274 }
275 
276 
277 //
278 // Getters/setters.
279 //
280 
281 //-------------------------------------
282 //
283 // status
284 //
285 // \see sbIJobProgress
286 //
287 
288 NS_IMETHODIMP
289 sbBaseMediaItemDownloadJob::GetStatus(PRUint16* aStatus)
290 {
291  NS_ENSURE_ARG_POINTER(aStatus);
292  nsAutoLock autoLock(mLock);
293  *aStatus = mStatus;
294  return NS_OK;
295 }
296 
297 
298 //-------------------------------------
299 //
300 // blocked
301 //
302 // \see sbIJobProgress
303 //
304 
305 NS_IMETHODIMP
306 sbBaseMediaItemDownloadJob::GetBlocked(PRBool* aBlocked)
307 {
308  NS_ENSURE_ARG_POINTER(aBlocked);
309  *aBlocked = PR_FALSE;
310  return NS_OK;
311 }
312 
313 
314 //-------------------------------------
315 //
316 // statusText
317 //
318 // \see sbIJobProgress
319 //
320 
321 NS_IMETHODIMP
322 sbBaseMediaItemDownloadJob::GetStatusText(nsAString& aStatusText)
323 {
324  NS_ASSERTION
325  (NS_IsMainThread(),
326  "sbBaseMediaItemDownloadJob::GetStatusText is main thread only!");
327  aStatusText.Assign(SBLocalizedString
328  ("media_item_downloader.job.status.downloading"));
329  return NS_OK;
330 }
331 
332 
333 //-------------------------------------
334 //
335 // titleText
336 //
337 // \see sbIJobProgress
338 //
339 
340 NS_IMETHODIMP
341 sbBaseMediaItemDownloadJob::GetTitleText(nsAString& aTitleText)
342 {
343  NS_ASSERTION
344  (NS_IsMainThread(),
345  "sbBaseMediaItemDownloadJob::GetTitleText is main thread only!");
346  aTitleText.Assign(SBLocalizedString("media_item_downloader.job.title"));
347  return NS_OK;
348 }
349 
350 
351 //-------------------------------------
352 //
353 // progress
354 //
355 // \see sbIJobProgress
356 //
357 
358 NS_IMETHODIMP
359 sbBaseMediaItemDownloadJob::GetProgress(PRUint32* aProgress)
360 {
361  // Validate arguments.
362  NS_ENSURE_ARG_POINTER(aProgress);
363 
364  // Function variables.
365  nsresult rv;
366 
367  // Get the file downloader progress.
368  PRUint64 progress = 0;
369  if (mFileDownloader) {
370  rv = mFileDownloader->GetBytesDownloaded(&progress);
371  NS_ENSURE_SUCCESS(rv, rv);
372  }
373 
374  // Return results.
375  *aProgress = static_cast<PRUint32>(progress & 0xFFFFFFFF);
376 
377  return NS_OK;
378 }
379 
380 
381 //-------------------------------------
382 //
383 // total
384 //
385 // \see sbIJobProgress
386 //
387 
388 NS_IMETHODIMP
389 sbBaseMediaItemDownloadJob::GetTotal(PRUint32* aTotal)
390 {
391  // Validate arguments.
392  NS_ENSURE_ARG_POINTER(aTotal);
393 
394  // Function variables.
395  nsresult rv;
396 
397  // Get the file downloader total bytes to download.
398  PRUint64 bytesToDownload = 0;
399  if (mFileDownloader) {
400  rv = mFileDownloader->GetBytesToDownload(&bytesToDownload);
401  NS_ENSURE_SUCCESS(rv, rv);
402  }
403 
404  // Return results.
405  *aTotal = static_cast<PRUint32>(bytesToDownload & 0xFFFFFFFF);
406 
407  return NS_OK;
408 }
409 
410 
411 //-------------------------------------
412 //
413 // errorCount
414 //
415 // \see sbIJobProgress
416 //
417 
418 NS_IMETHODIMP
419 sbBaseMediaItemDownloadJob::GetErrorCount(PRUint32* aErrorCount)
420 {
421  // Validate arguments.
422  NS_ENSURE_ARG_POINTER(aErrorCount);
423 
424  // Function variables.
425  PRUint32 errorCount = 0;
426  nsresult rv;
427 
428  // No errors if no downloader.
429  if (!mFileDownloader) {
430  *aErrorCount = 0;
431  return NS_OK;
432  }
433 
434  // Check if the file download is complete.
435  PRBool complete;
436  rv = mFileDownloader->GetComplete(&complete);
437  NS_ENSURE_SUCCESS(rv, rv);
438 
439  // Check for error.
440  if (complete) {
441  PRBool succeeded;
442  rv = mFileDownloader->GetSucceeded(&succeeded);
443  NS_ENSURE_SUCCESS(rv, rv);
444  if (complete && !succeeded)
445  errorCount++;
446  }
447 
448  // Return results.
449  *aErrorCount = errorCount;
450 
451  return NS_OK;
452 }
453 
454 
455 //-------------------------------------
456 //
457 // errorMessages
458 //
459 // \see sbIJobProgress
460 //
461 
462 NS_IMETHODIMP
463 sbBaseMediaItemDownloadJob::GetErrorMessages(nsIStringEnumerator** retval)
464 {
465  // Validate arguments and calling context.
466  NS_ENSURE_ARG_POINTER(retval);
467  NS_ASSERTION
468  (NS_IsMainThread(),
469  "sbBaseMediaItemDownloadJob::GetErrorMessages is main thread only!");
470 
471  // Function variables.
472  nsTArray<nsString> errorMessageList;
473  nsresult rv;
474 
475  // Get the error count.
476  PRUint32 errorCount;
477  rv = GetErrorCount(&errorCount);
478  NS_ENSURE_SUCCESS(rv, rv);
479 
480  // Add error message if an error occurred.
481  if (errorCount) {
482  errorMessageList.AppendElement
483  (SBLocalizedString("media_item_downloader.job.error"));
484  }
485 
486  // Return results.
487  nsCOMPtr<nsIStringEnumerator>
488  errorMessageEnum = new sbTArrayStringEnumerator(&errorMessageList);
489  NS_ENSURE_TRUE(errorMessageEnum, NS_ERROR_OUT_OF_MEMORY);
490  errorMessageEnum.forget(retval);
491 
492  return NS_OK;
493 }
494 
495 //-------------------------------------
496 //
497 // canCancel
498 //
499 // \see sbIJobCancelable
500 //
501 NS_IMETHODIMP
502 sbBaseMediaItemDownloadJob::GetCanCancel(PRBool *aCanCancel)
503 {
504  // Always cancelable.
505  *aCanCancel = PR_TRUE;
506 
507  return NS_OK;
508 }
509 
510 //-------------------------------------
511 //
512 // cancel
513 //
514 // \see sbIJobCancelable
515 //
516 NS_IMETHODIMP
517 sbBaseMediaItemDownloadJob::Cancel()
518 {
519  return Stop();
520 }
521 
522 //------------------------------------------------------------------------------
523 //
524 // Base media item download job sbIFileDownloadListener implementation.
525 //
526 //------------------------------------------------------------------------------
527 
528 //-------------------------------------
529 //
530 // onProgress
531 //
532 // \see sbIFileDownloadListener
533 //
534 
535 NS_IMETHODIMP
536 sbBaseMediaItemDownloadJob::OnProgress()
537 {
538  TRACE(("%s[%.8x]", __FUNCTION__, this));
539 
540  // Function variables.
541  nsresult rv;
542 
543  // Get the listeners under the lock.
544  nsTArray< nsCOMPtr<sbIJobProgressListener> > listenerList;
545  {
546  nsAutoLock autoLock(mLock);
547  listenerList = mListenerList;
548  }
549 
550  // Notify the listeners.
551  PRInt32 const listenerCount = listenerList.Length();
552  for (PRInt32 i = 0; i < listenerCount; ++i) {
553  rv = listenerList[i]->OnJobProgress(this);
554  NS_WARN_IF_FALSE(NS_SUCCEEDED(rv), "Listener error");
555  }
556 
557  return NS_OK;
558 }
559 
560 
561 //-------------------------------------
562 //
563 // onComplete
564 //
565 // \see sbIFileDownloadListener
566 //
567 
568 NS_IMETHODIMP
569 sbBaseMediaItemDownloadJob::OnComplete()
570 {
571  TRACE(("%s[%.8x]", __FUNCTION__, this));
572 
573  // Function variables.
574  nsresult rv;
575 
576  // Get the file downloader under the lock.
577  nsCOMPtr<sbIFileDownloader> fileDownloader;
578  {
579  nsAutoLock autoLock(mLock);
580  fileDownloader = mFileDownloader;
581  }
582  NS_ENSURE_TRUE(fileDownloader, NS_ERROR_NOT_AVAILABLE);
583 
584  // Clear file downloader listener.
585  rv = fileDownloader->SetListener(nsnull);
586  NS_ENSURE_SUCCESS(rv, rv);
587 
588  // Check if the file download succeeded.
589  PRBool succeeded;
590  rv = fileDownloader->GetSucceeded(&succeeded);
591  NS_ENSURE_SUCCESS(rv, rv);
592 
593  // Update status and get the listeners under the lock.
594  nsTArray< nsCOMPtr<sbIJobProgressListener> > listenerList;
595  {
596  nsAutoLock autoLock(mLock);
597 
598  // Update status.
599  if (succeeded)
601  else
603 
604  // Get the listeners.
605  listenerList = mListenerList;
606  }
607 
608  // Notify the listeners.
609  PRInt32 const listenerCount = listenerList.Length();
610  for (PRInt32 i = 0; i < listenerCount; ++i) {
611  rv = listenerList[i]->OnJobProgress(this);
612  NS_WARN_IF_FALSE(NS_SUCCEEDED(rv), "Listener error");
613  }
614 
615  return NS_OK;
616 }
617 
618 
619 //------------------------------------------------------------------------------
620 //
621 // Base media item download job public services.
622 //
623 //------------------------------------------------------------------------------
624 
625 //-------------------------------------
626 //
627 // ~sbBaseMediaItemDownloadJob
628 //
629 
631 {
632  TRACE(("%s[%.8x]", __FUNCTION__, this));
633 
634  // Dispose of the lock.
635  if (mLock)
636  nsAutoLock::DestroyLock(mLock);
637  mLock = nsnull;
638 }
639 
640 
641 //------------------------------------------------------------------------------
642 //
643 // Base media item download job protected services.
644 //
645 //------------------------------------------------------------------------------
646 
647 //-------------------------------------
648 //
649 // Start
650 //
651 
652 nsresult
654 {
655  // Validate arguments.
656  NS_ENSURE_ARG_POINTER(aURI);
657 
658  // Function variables.
659  nsresult rv;
660 
661  // Create a file downloader and set it up.
662  nsCOMPtr<sbIFileDownloader> fileDownloader =
663  do_ProxiedCreateInstance("@songbirdnest.com/Songbird/FileDownloader;1",
664  &rv);
665  NS_ENSURE_SUCCESS(rv, rv);
666  rv = fileDownloader->SetSourceURI(aURI);
667  NS_ENSURE_SUCCESS(rv, rv);
668  rv = fileDownloader->SetListener(this);
669  NS_ENSURE_SUCCESS(rv, rv);
670 
671  // Set the destination file extension.
672  nsCOMPtr<nsIURL> url = do_MainThreadQueryInterface(aURI, &rv);
673  if (NS_SUCCEEDED(rv)) {
674  nsCAutoString fileExtension;
675  rv = url->GetFileExtension(fileExtension);
676  NS_ENSURE_SUCCESS(rv, rv);
677  rv = fileDownloader->SetDestinationFileExtension
678  (NS_ConvertUTF8toUTF16(fileExtension));
679  NS_ENSURE_SUCCESS(rv, rv);
680  }
681 
682  // Set the file downloader temporary file factory.
683  nsCOMPtr<sbITemporaryFileFactory> temporaryFileFactory;
684  rv = GetTemporaryFileFactory(getter_AddRefs(temporaryFileFactory));
685  NS_ENSURE_SUCCESS(rv, rv);
686  if (temporaryFileFactory) {
687  rv = fileDownloader->SetTemporaryFileFactory(temporaryFileFactory);
688  NS_ENSURE_SUCCESS(rv, rv);
689  }
690 
691  // Set the file downloader under the lock.
692  {
693  nsAutoLock autoLock(mLock);
694  mFileDownloader = fileDownloader;
695  }
696 
697  // Start downloading.
698  rv = fileDownloader->Start();
699  NS_ENSURE_SUCCESS(rv, rv);
700 
701  return NS_OK;
702 }
703 
704 //-------------------------------------
705 //
706 // Stop
707 //
708 nsresult
710 {
711  if (mFileDownloader) {
712  nsresult rv = mFileDownloader->Cancel();
713  NS_ENSURE_SUCCESS(rv, rv);
714  }
715 
716  return NS_OK;
717 }
718 
719 //-------------------------------------
720 //
721 // GetDownloadURI
722 //
723 
724 nsresult
726 {
727  // Validate arguments.
728  NS_ENSURE_ARG_POINTER(aURI);
729 
730  // Function variables.
731  nsresult rv;
732 
733  // Get the media item under the lock.
734  nsCOMPtr<sbIMediaItem> mediaItem;
735  {
736  nsAutoLock autoLock(mLock);
737  mediaItem = mMediaItem;
738  }
739 
740  // Get the media item content source URI.
741  rv = mediaItem->GetContentSrc(aURI);
742  NS_ENSURE_SUCCESS(rv, rv);
743 
744  return NS_OK;
745 }
746 
747 
748 //-------------------------------------
749 //
750 // Initialize
751 //
752 
753 nsresult
755 {
756  TRACE(("%s[%.8x]", __FUNCTION__, this));
757 
758  // Function variables.
759  nsresult rv;
760 
761  // Create the lock.
762  mLock = nsAutoLock::NewLock("sbBaseMediaItemDownloadJob::mLock");
763  NS_ENSURE_TRUE(mLock, NS_ERROR_OUT_OF_MEMORY);
764 
765  // Create the downloaded media item properties array.
766  mProperties = do_CreateInstance(SB_MUTABLEPROPERTYARRAY_CONTRACTID, &rv);
767  NS_ENSURE_SUCCESS(rv, rv);
768 
769  return NS_OK;
770 }
771 
772 
773 //-------------------------------------
774 //
775 // sbBaseMediaItemDownloadJob
776 //
777 
779  (sbIMediaItem* aMediaItem,
780  sbILibrary* aTargetLibrary) :
781  mMediaItem(aMediaItem),
782  mTargetLibrary(aTargetLibrary),
784 {
785  // Initialize logging.
786 #ifdef PR_LOGGING
787  if (!gBaseMediaItemDownloadJobLog) {
788  gBaseMediaItemDownloadJobLog =
789  PR_NewLogModule("sbBaseMediaItemDownloadJob");
790  }
791 #endif
792 
793  TRACE(("%s[%.8x]", __FUNCTION__, this));
794 }
795 
attribute sbITemporaryFileFactory temporaryFileFactory
return NS_OK
readonly attribute unsigned long errorCount
Number of errors that have been encountered.
function succeeded(ch, cx, status, data)
Generic interface for exposing long running jobs to the UI.
Base Media Item Download Job Definitions.
sbBaseMediaItemDownloadJob(sbIMediaItem *aMediaItem, sbILibrary *aTargetLibrary=nsnull)
readonly attribute sbIPropertyArray properties
#define SB_MUTABLEPROPERTYARRAY_CONTRACTID
const unsigned short STATUS_SUCCEEDED
Constant indicating that the job has completed.
const sbCreateProxiedComponent do_ProxiedCreateInstance(const nsCID &aCID, nsresult *error=0)
const unsigned short STATUS_RUNNING
Constant indicating that the job is active.
#define TRACE(args)
nsCOMPtr< sbIMutablePropertyArray > mProperties
virtual nsresult Start(nsIURI *aURI)
sbMainThreadQueryInterface do_MainThreadQueryInterface(nsISupports *aSupports, nsresult *aResult=nsnull)
nsCOMPtr< sbITemporaryFileFactory > mTemporaryFileFactory
virtual nsresult GetDownloadURI(nsIURI **aURI)
Media library abstraction.
Definition: sbILibrary.idl:82
nsTArray< nsCOMPtr< sbIJobProgressListener > > mListenerList
function url(spec)
nsCOMPtr< sbIMediaItem > mMediaItem
readonly attribute unsigned long progress
Number of work units completed.
NS_IMPL_THREADSAFE_ISUPPORTS4(sbBaseMediaItemDownloadJob, sbIMediaItemDownloadJob, sbIJobProgress, sbIJobCancelable, sbIFileDownloaderListener) NS_IMETHODIMP sbBaseMediaItemDownloadJob
NS_DECL_ISUPPORTS NS_DECL_SBIMEDIAITEMDOWNLOADJOB NS_DECL_SBIJOBPROGRESS NS_DECL_SBIJOBCANCELABLE virtual NS_DECL_SBIFILEDOWNLOADERLISTENER ~sbBaseMediaItemDownloadJob()
nsCOMPtr< sbIFileDownloader > mFileDownloader
Implemented to receive notifications from sbIJobProgress interfaces.
Interface that defines a single item of media in the system.
const unsigned short STATUS_FAILED
Constant indicating that the job has completed with errors.
An interface to carry around arrays of nsIProperty instances. Users of this interface should only QI ...
_getSelectedPageStyle s i