sbCDDeviceMarshall.cpp
Go to the documentation of this file.
1 /*
2 //
3 // BEGIN SONGBIRD GPL
4 //
5 // This file is part of the Songbird web player.
6 //
7 // Copyright(c) 2005-2009 POTI, Inc.
8 // http://songbirdnest.com
9 //
10 // This file may be licensed under the terms of of the
11 // GNU General Public License Version 2 (the "GPL").
12 //
13 // Software distributed under the License is distributed
14 // on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
15 // express or implied. See the GPL for the specific language
16 // governing rights and limitations.
17 //
18 // You should have received a copy of the GPL along with this
19 // program. If not, go to http://www.gnu.org/licenses/gpl.html
20 // or write to the Free Software Foundation, Inc.,
21 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 //
23 // END SONGBIRD GPL
24 //
25 */
26 
27 #include "sbCDDeviceMarshall.h"
28 
29 #include "sbICDDevice.h"
30 #include "sbICDDeviceService.h"
31 
32 #include <sbIDevice.h>
33 #include <sbIDeviceController.h>
34 #include <sbIDeviceRegistrar.h>
35 #include <sbIDeviceControllerRegistrar.h>
36 #include <sbIDeviceManager.h>
37 #include <sbIDeviceEvent.h>
38 #include <sbIDeviceEventTarget.h>
39 #include <sbThreadUtils.h>
40 #include <sbVariantUtils.h>
41 
42 #include <nsComponentManagerUtils.h>
43 #include <nsIClassInfoImpl.h>
44 #include <nsIProgrammingLanguage.h>
45 #include <nsIPropertyBag2.h>
46 #include <nsISupportsPrimitives.h>
47 #include <nsIThreadManager.h>
48 #include <nsIThreadPool.h>
49 #include <nsServiceManagerUtils.h>
50 #include <nsMemory.h>
51 #include <prlog.h>
52 #include <sbDebugUtils.h>
53 
54 NS_DEFINE_STATIC_IID_ACCESSOR(sbCDDeviceMarshall, SB_CDDEVICE_MARSHALL_IID)
55 
61 NS_IMPL_CI_INTERFACE_GETTER2(sbCDDeviceMarshall,
62  sbIDeviceMarshall,
64 
65 // nsIClassInfo implementation.
66 NS_DECL_CLASSINFO(sbCDDeviceMarshall)
67 NS_IMPL_THREADSAFE_CI(sbCDDeviceMarshall)
68 
69 sbCDDeviceMarshall::sbCDDeviceMarshall()
71  , mKnownDevicesLock(nsAutoMonitor::NewMonitor("sbCDDeviceMarshall::mKnownDevicesLock"))
72 {
73  mKnownDevices.Init(8);
74 }
75 
77 {
78  nsAutoMonitor mon(mKnownDevicesLock);
79  mon.Exit();
80 
81  nsAutoMonitor::DestroyMonitor(mKnownDevicesLock);
82 }
83 
84 nsresult
86 {
87  nsresult rv;
88  nsCOMPtr<sbIDeviceManager2> deviceMgr =
89  do_GetService("@songbirdnest.com/Songbird/DeviceManager;2", &rv);
90  NS_ENSURE_SUCCESS(rv, rv);
91 
92  mCDDeviceService = nsnull;
93  PRInt32 selectedWeight = -1;
94 
95  // Enumerate the category manager for cdrip services
96  nsCOMPtr<nsICategoryManager> catman =
97  do_GetService(NS_CATEGORYMANAGER_CONTRACTID, &rv);
98  NS_ENSURE_SUCCESS(rv, rv);
99 
100  nsCOMPtr<nsISimpleEnumerator> categoryEnum;
101  rv = catman->EnumerateCategory("cdrip-engine", getter_AddRefs(categoryEnum));
102  NS_ENSURE_SUCCESS(rv, rv);
103  PRBool hasMore = PR_FALSE;
104  while (NS_SUCCEEDED(categoryEnum->HasMoreElements(&hasMore)) && hasMore) {
105  nsCOMPtr<nsISupports> ptr;
106  if (NS_SUCCEEDED(categoryEnum->GetNext(getter_AddRefs(ptr))) && ptr) {
107  nsCOMPtr<nsISupportsCString> stringValue(do_QueryInterface(ptr));
108  nsCString factoryName;
109  if (stringValue && NS_SUCCEEDED(stringValue->GetData(factoryName))) {
110  nsCString contractId;
111  rv = catman->GetCategoryEntry("cdrip-engine", factoryName.get(),
112  getter_Copies(contractId));
113  NS_ENSURE_SUCCESS(rv, rv);
114 
115  // Get this CD device service
116  nsCOMPtr<sbICDDeviceService> cdDevSvc =
117  do_GetService(contractId.get(), &rv);
118  NS_ENSURE_SUCCESS(rv, rv);
119 
120  PRInt32 currentWeight;
121  rv = cdDevSvc->GetWeight(&currentWeight);
122  NS_ENSURE_SUCCESS(rv, rv);
123 
124  // if we don't have a CD device service yet, or if this service has
125  // a higher voting weight than the current service, then choose this
126  // service as our selected CD device service
127  if (selectedWeight == -1 || currentWeight >= selectedWeight) {
128  mCDDeviceService = cdDevSvc;
129  selectedWeight = currentWeight;
130  }
131  }
132  }
133  }
134 
135  return NS_OK;
136 }
137 
138 nsresult
140 {
141  NS_ENSURE_ARG_POINTER(aCDDevice);
142 
143  nsresult rv;
144 
145  nsString deviceName;
146  rv = aCDDevice->GetName(deviceName);
147  NS_ENSURE_SUCCESS(rv, rv);
148 
149  // Don't bother watching this device if this marshall is already watching
150  // it in mKnownDevices.
151  PRBool hasDevice = PR_FALSE;
152  rv = GetHasDevice(deviceName, &hasDevice);
153  if (NS_FAILED(rv) || hasDevice) {
154  return NS_OK;
155  }
156 
157  // Fill out some properties for this device.
158  nsCOMPtr<nsIWritablePropertyBag> propBag =
159  do_CreateInstance("@mozilla.org/hash-property-bag;1", &rv);
160  NS_ENSURE_SUCCESS(rv, rv);
161 
162  nsCOMPtr<nsIWritableVariant> deviceType =
163  do_CreateInstance("@songbirdnest.com/Songbird/Variant;1", &rv);
164  NS_ENSURE_SUCCESS(rv, rv);
165 
166  rv = deviceType->SetAsAString(NS_LITERAL_STRING("CD"));
167  NS_ENSURE_SUCCESS(rv, rv);
168 
169  rv = propBag->SetProperty(NS_LITERAL_STRING("DeviceType"),
170  deviceType);
171  NS_ENSURE_SUCCESS(rv, rv);
172 
173  nsCOMPtr<sbIDeviceController> controller = FindCompatibleControllers(propBag);
174  NS_ENSURE_TRUE(controller, NS_ERROR_UNEXPECTED);
175 
176  // Stash the device with the property bag.
177  nsCOMPtr<nsIWritableVariant> deviceVar =
178  do_CreateInstance("@songbirdnest.com/Songbird/Variant;1", &rv);
179  NS_ENSURE_SUCCESS(rv, rv);
180 
181  rv = deviceVar->SetAsISupports(aCDDevice);
182  NS_ENSURE_SUCCESS(rv, rv);
183 
184  rv = propBag->SetProperty(NS_LITERAL_STRING("sbICDDevice"), deviceVar);
185  NS_ENSURE_SUCCESS(rv, rv);
186 
187  // Have the controller create the device for us.
188  nsCOMPtr<sbIDevice> sbDevice;
189  rv = controller->CreateDevice(propBag, getter_AddRefs(sbDevice));
190  NS_ENSURE_SUCCESS(rv, rv);
191 
192  // Ensure that the device has media inserted into it.
193  PRBool hasDisc = PR_FALSE;
194  rv = aCDDevice->GetIsDiscInserted(&hasDisc);
195  if (NS_FAILED(rv) || !hasDisc) {
196  return NS_OK;
197  }
198 
199  // Ensure that the inserted disc is a media disc
200  PRUint32 discType;
201  rv = aCDDevice->GetDiscType(&discType);
202  if (NS_FAILED(rv) || discType != sbICDDevice::AUDIO_DISC_TYPE) {
203  return NS_OK;
204  }
205 
206  nsCOMPtr<sbIDeviceManager2> deviceManager =
207  do_GetService("@songbirdnest.com/Songbird/DeviceManager;2", &rv);
208  NS_ENSURE_SUCCESS(rv, rv);
209 
210  nsCOMPtr<sbIDeviceRegistrar> deviceRegistrar =
211  do_QueryInterface(deviceManager, &rv);
212  NS_ENSURE_SUCCESS(rv, rv);
213 
214  // Register this device with the device registrar.
215  rv = deviceRegistrar->RegisterDevice(sbDevice);
216  NS_ASSERTION(NS_SUCCEEDED(rv), "Failed to register device!");
217 
218  // Dispatch the added device event.
220  sbNewVariant(sbDevice),
221  static_cast<sbIDeviceMarshall *>(this));
222 
223  // Stash this device in the hash of known CD devices.
224  nsAutoMonitor mon(mKnownDevicesLock);
225  mKnownDevices.Put(deviceName, sbDevice);
226 
227  return NS_OK;
228 }
229 
230 nsresult
232  nsresult rv;
233 
234  // Get the device name.
235  nsString deviceName;
236  nsCOMPtr<nsIPropertyBag2> parameters;
237  nsCOMPtr<nsIVariant> var;
238  nsCOMPtr<nsISupports> supports;
239  rv = aDevice->GetParameters(getter_AddRefs(parameters));
240  NS_ENSURE_SUCCESS(rv, rv);
241  rv = parameters->GetProperty(NS_LITERAL_STRING("sbICDDevice"),
242  getter_AddRefs(var));
243  NS_ENSURE_SUCCESS(rv, rv);
244  rv = var->GetAsISupports(getter_AddRefs(supports));
245  NS_ENSURE_SUCCESS(rv, rv);
246  nsCOMPtr<sbICDDevice> cdDevice = do_QueryInterface(supports, &rv);
247  NS_ENSURE_SUCCESS(rv, rv);
248  rv = cdDevice->GetName(deviceName);
249  NS_ENSURE_SUCCESS(rv, rv);
250 
251  // Just return if device is not in the hash of known CD devices.
252  PRBool hasDevice;
253  rv = GetHasDevice(deviceName, &hasDevice);
254  NS_ENSURE_SUCCESS(rv, rv);
255  if (!hasDevice)
256  return NS_OK;
257 
258  // Remove device from hash of known CD devices.
259  {
260  nsAutoMonitor mon(mKnownDevicesLock);
261  mKnownDevices.Remove(deviceName);
262  }
263 
264  nsCOMPtr<sbIDeviceRegistrar> deviceRegistrar =
265  do_GetService("@songbirdnest.com/Songbird/DeviceManager;2", &rv);
266  NS_ENSURE_SUCCESS(rv, rv);
267 
268  nsCOMPtr<sbIDeviceControllerRegistrar> deviceControllerRegistrar =
269  do_GetService("@songbirdnest.com/Songbird/DeviceManager;2", &rv);
270  NS_ENSURE_SUCCESS(rv, rv);
271 
272  // Get the device controller for this device.
273  nsCOMPtr<sbIDeviceController> deviceController;
274  nsID *controllerId = nsnull;
275  rv = aDevice->GetControllerId(&controllerId);
276  if (NS_SUCCEEDED(rv)) {
277  rv = deviceControllerRegistrar->GetController(
278  controllerId,
279  getter_AddRefs(deviceController));
280  }
281 
282  if (NS_FAILED(rv)) {
283  NS_WARNING("Failed to get device controller.");
284  deviceController = nsnull;
285  }
286 
287  if (controllerId) {
288  NS_Free(controllerId);
289  }
290 
291  // Release the device from the controller
292  if (deviceController) {
293  rv = deviceController->ReleaseDevice(aDevice);
294  NS_WARN_IF_FALSE(NS_SUCCEEDED(rv), "Failed to release the device");
295  }
296 
297  // Unregister the device
298  rv = deviceRegistrar->UnregisterDevice(aDevice);
299  NS_WARN_IF_FALSE(NS_SUCCEEDED(rv), "Failed to unregister device");
300 
301  return NS_OK;
302 }
303 
304 nsresult
305 sbCDDeviceMarshall::RemoveDevice(nsAString const & aName)
306 {
307  nsresult rv;
308  // Only remove the device if it's stashed in the device hash.
309  nsCOMPtr<sbIDevice> device;
310  rv = GetDevice(aName, getter_AddRefs(device));
311  if (NS_FAILED(rv) || !device) {
312  return NS_OK;
313  }
314 
315  // Remove device.
316  rv = RemoveDevice(device);
317  NS_ENSURE_SUCCESS(rv, rv);
318 
319  return NS_OK;
320 }
321 
322 nsresult
323 sbCDDeviceMarshall::GetDevice(nsAString const & aName, sbIDevice **aOutDevice)
324 {
325  NS_ENSURE_ARG_POINTER(aOutDevice);
326 
327  nsresult rv;
328  nsCOMPtr<nsISupports> supports;
329  rv = mKnownDevices.Get(aName, getter_AddRefs(supports));
330  NS_ENSURE_SUCCESS(rv, rv);
331 
332  nsCOMPtr<sbIDevice> device = do_QueryInterface(supports, &rv);
333  if (NS_FAILED(rv) || !device) {
334  return NS_ERROR_FAILURE;
335  }
336 
337  device.forget(aOutDevice);
338  return NS_OK;
339 }
340 
341 nsresult
342 sbCDDeviceMarshall::GetHasDevice(nsAString const &aName, PRBool *aOutHasDevice)
343 {
344  NS_ENSURE_ARG_POINTER(aOutHasDevice);
345  *aOutHasDevice = PR_FALSE; // assume false
346 
347  // Operate under the known devices lock
348  nsAutoMonitor mon(mKnownDevicesLock);
349 
350  nsresult rv;
351  nsCOMPtr<sbIDevice> deviceRef;
352  rv = GetDevice(aName, getter_AddRefs(deviceRef));
353  if (NS_SUCCEEDED(rv) && deviceRef) {
354  *aOutHasDevice = PR_TRUE;
355  }
356 
357  return NS_OK;
358 }
359 
360 nsresult
362 {
363  // Iterate over the available CD devices and check to see if they have
364  // media currently inserted.
365  nsresult rv;
366 
367  NS_ENSURE_STATE(mCDDeviceService);
368 
369  nsCOMPtr<nsIThreadPool> threadPoolService =
370  do_GetService("@songbirdnest.com/Songbird/ThreadPoolService;1", &rv);
371  NS_ENSURE_SUCCESS(rv, rv);
372 
373  nsCOMPtr<nsIThreadManager> threadMgr =
374  do_GetService("@mozilla.org/thread-manager;1", &rv);
375  NS_ENSURE_SUCCESS(rv, rv);
376 
377  // Save the threading context for notifying the listeners on the current
378  // thread once the scan has ended.
379  rv = threadMgr->GetCurrentThread(getter_AddRefs(mOwnerContextThread));
380  NS_ENSURE_SUCCESS(rv, rv);
381 
382  nsCOMPtr<nsIRunnable> runnable =
383  NS_NEW_RUNNABLE_METHOD(sbCDDeviceMarshall, this, RunDiscoverDevices);
384  NS_ENSURE_TRUE(runnable, NS_ERROR_FAILURE);
385 
386  rv = threadPoolService->Dispatch(runnable, NS_DISPATCH_NORMAL);
387  NS_ENSURE_SUCCESS(rv, rv);
388 
389  return NS_OK;
390 }
391 
392 void
394 {
395  // Since the GW stuff is a little jacked, use the index getter
396  PRInt32 deviceCount = 0;
397  nsresult rv = mCDDeviceService->GetNbDevices(&deviceCount);
398  NS_ENSURE_SUCCESS(rv, /* void */);
399 
400  // Notify of scan start.
401  nsCOMPtr<nsIRunnable> runnable =
402  NS_NEW_RUNNABLE_METHOD(sbCDDeviceMarshall, this, RunNotifyDeviceStartScan);
403  NS_ENSURE_TRUE(runnable, /* void */);
404  rv = mOwnerContextThread->Dispatch(runnable, NS_DISPATCH_SYNC);
405  NS_WARN_IF_FALSE(NS_SUCCEEDED(rv),
406  "WARNING: Could not notify of device start scan!");
407 
408 
409  for (PRInt32 i = 0; i < deviceCount; i++) {
410  nsCOMPtr<sbICDDevice> curDevice;
411  rv = mCDDeviceService->GetDevice(i, getter_AddRefs(curDevice));
412  if (NS_FAILED(rv) || !curDevice) {
413  NS_WARNING("Could not get the current device!");
414  continue;
415  }
416 
417  // Add the device on the main thread.
418  rv = sbInvokeOnThread1(*this,
420  NS_ERROR_FAILURE,
421  curDevice.get(),
422  mOwnerContextThread);
423 
424  NS_WARN_IF_FALSE(NS_SUCCEEDED(rv), "Could not add a CD Device!");
425  }
426 
427 
428  // Notify of scan end.
429  runnable = NS_NEW_RUNNABLE_METHOD(sbCDDeviceMarshall,
430  this,
432  NS_ENSURE_TRUE(runnable, /* void */);
433  rv = mOwnerContextThread->Dispatch(runnable, NS_DISPATCH_SYNC);
434  NS_WARN_IF_FALSE(NS_SUCCEEDED(rv),
435  "WARNING: Could not notify of device start scan!");
436 }
437 
438 void
440 {
441  // Dispatch the scan start event.
443  nsnull,
444  static_cast<sbIDeviceMarshall *>(this));
445 }
446 
447 void
449 {
450  // Dispatch the scan end event.
452  nsnull,
453  static_cast<sbIDeviceMarshall *>(this));
454 }
455 
456 nsresult
458  nsIVariant *aData,
459  nsISupports *aOrigin,
460  PRBool aAsync)
461 {
462  nsresult rv;
463 
464  // Get the device manager.
465  nsCOMPtr<sbIDeviceManager2> manager =
466  do_GetService("@songbirdnest.com/Songbird/DeviceManager;2", &rv);
467  NS_ENSURE_SUCCESS(rv, rv);
468 
469  // Use the device manager as the event target.
470  nsCOMPtr<sbIDeviceEventTarget> eventTarget = do_QueryInterface(manager, &rv);
471  NS_ENSURE_SUCCESS(rv, rv);
472 
473  // Create the event.
474  nsCOMPtr<sbIDeviceEvent> event;
475  rv = manager->CreateEvent(aType,
476  aData,
477  aOrigin,
480  getter_AddRefs(event));
481  NS_ENSURE_SUCCESS(rv, rv);
482 
483  // Dispatch the event.
484  PRBool dispatched;
485  rv = eventTarget->DispatchEvent(event, aAsync, &dispatched);
486  NS_ENSURE_SUCCESS(rv, rv);
487 
488  return NS_OK;
489 }
490 
491 //------------------------------------------------------------------------------
492 // sbIDeviceMarshall
493 
494 NS_IMETHODIMP
495 sbCDDeviceMarshall::LoadControllers(sbIDeviceControllerRegistrar *aRegistrar)
496 {
497  NS_ENSURE_ARG_POINTER(aRegistrar);
498 
499  RegisterControllers(aRegistrar);
500 
501  return NS_OK;
502 }
503 
504 NS_IMETHODIMP
505 sbCDDeviceMarshall::BeginMonitoring()
506 {
507  nsresult rv;
508 
509  NS_ENSURE_STATE(mCDDeviceService);
510  NS_ASSERTION(IsMonitoring(), "BeginMonitoring() called after StopMonitoring()!");
511 
512  rv = mCDDeviceService->RegisterListener(this);
513  NS_ENSURE_SUCCESS(rv, rv);
514 
515  rv = DiscoverDevices();
516  NS_ENSURE_SUCCESS(rv, rv);
517 
518  return NS_OK;
519 }
520 
521 NS_IMETHODIMP
522 sbCDDeviceMarshall::StopMonitoring()
523 {
524  nsresult rv;
525 
526  if (mCDDeviceService) {
527  rv = mCDDeviceService->RemoveListener(this);
528  NS_ENSURE_SUCCESS(rv, rv);
529  }
531  return NS_OK;
532 }
533 
534 NS_IMETHODIMP
535 sbCDDeviceMarshall::GetId(nsID **aId)
536 {
537  NS_ENSURE_ARG_POINTER(aId);
538 
539  static nsID const id = SB_CDDEVICE_MARSHALL_CID;
540  *aId = static_cast<nsID *>(NS_Alloc(sizeof(nsID)));
541  **aId = id;
542 
543  return NS_OK;
544 }
545 
546 NS_IMETHODIMP
547 sbCDDeviceMarshall::GetName(nsAString & aName)
548 {
549  aName.Assign(NS_LITERAL_STRING(SB_CDDEVICE_MARSHALL_NAME));
550  return NS_OK;
551 }
552 
553 //------------------------------------------------------------------------------
554 // sbICDDeviceListener
555 
556 NS_IMETHODIMP
557 sbCDDeviceMarshall::OnDeviceRemoved(sbICDDevice *aDevice)
558 {
559  NS_ENSURE_ARG_POINTER(aDevice);
560 
561  nsresult rv;
562  nsString deviceName;
563  rv = aDevice->GetName(deviceName);
564  NS_ENSURE_SUCCESS(rv, rv);
565 
566  // Only remove the device if this marshall is currently monitoring it.
567  nsCOMPtr<sbIDevice> device;
568  rv = GetDevice(deviceName, getter_AddRefs(device));
569  if (NS_SUCCEEDED(rv) && device) {
570  rv = RemoveDevice(deviceName);
571  NS_ENSURE_SUCCESS(rv, rv);
572  }
573 
574  return NS_OK;
575 }
576 
577 NS_IMETHODIMP
578 sbCDDeviceMarshall::OnMediaInserted(sbICDDevice *aDevice)
579 {
580  NS_ENSURE_ARG_POINTER(aDevice);
581 
582  nsresult rv = AddDevice(aDevice);
583  NS_ENSURE_SUCCESS(rv, rv);
584 
585  return NS_OK;
586 }
587 
588 NS_IMETHODIMP
589 sbCDDeviceMarshall::OnMediaEjected(sbICDDevice *aDevice)
590 {
591  NS_ENSURE_ARG_POINTER(aDevice);
592 
593  nsresult rv;
594  nsString deviceName;
595  rv = aDevice->GetName(deviceName);
596  NS_ENSURE_SUCCESS(rv, rv);
597 
598  rv = RemoveDevice(deviceName);
599  NS_ENSURE_SUCCESS(rv, rv);
600 
601  return NS_OK;
602 }
603 
nsresult AddDevice(sbICDDevice *aCDDevice)
return NS_OK
nsresult GetHasDevice(nsAString const &aName, PRBool *aOutHasDevice)
NS_IMPL_QUERY_INTERFACE2_CI(sbCDDeviceMarshall, sbIDeviceMarshall, sbICDDeviceListener) NS_IMPL_CI_INTERFACE_GETTER2(sbCDDeviceMarshall
nsresult RemoveDevice(nsAString const &aName)
var event
const unsigned long EVENT_DEVICE_SCAN_END
NS_IMPL_THREADSAFE_CI(sbMediaListEnumeratorWrapper)
Songbird Variant Utility Definitions.
const unsigned long EVENT_DEVICE_ADDED
#define SB_CDDEVICE_MARSHALL_IID
NS_IMPL_THREADSAFE_RELEASE(sbRequestItem)
NS_IMPL_THREADSAFE_ADDREF(sbRequestItem)
PRBool IsMonitoring() const
sbIDeviceController * FindCompatibleControllers(nsIPropertyBag *deviceParams)
void RegisterControllers(sbIDeviceControllerRegistrar *registrar)
const unsigned long EVENT_DEVICE_SCAN_START
const unsigned long STATE_IDLE
Definition: sbIDevice.idl:220
#define SB_CDDEVICE_MARSHALL_NAME
Songbird Thread Utilities Definitions.
RT sbInvokeOnThread1(T &aObject, MT aMethod, RT aFailureReturnValue, A1 aArg1, TH aThread)
NS_DECL_ISUPPORTS NS_DECL_NSICLASSINFO NS_DECL_SBIDEVICEMARSHALL NS_DECL_SBICDDEVICELISTENER nsresult Init()
[UNIMPLEMENTED UNTIL AFTER 0.3]
_updateCookies aName
nsresult GetDevice(nsAString const &aName, sbIDevice **aOutDevice)
StringArrayEnumerator prototype hasMore
#define SB_CDDEVICE_MARSHALL_CID
sbIJobCancelable NS_DECL_CLASSINFO(sbGstreamerMediaInspector)
NS_IMPL_CI_INTERFACE_GETTER2(sbDataRemoteWrapper, sbIDataRemote, nsIClassInfo) sbDataRemoteWrapper
const unsigned long AUDIO_DISC_TYPE
#define SB_DEVICE_CONTROLLER_CATEGORY
readonly attribute nsIDPtr id
_getSelectedPageStyle s i
nsresult CreateAndDispatchDeviceManagerEvent(PRUint32 aType, nsIVariant *aData=nsnull, nsISupports *aOrigin=nsnull, PRBool aAsync=PR_FALSE)
_updateTextAndScrollDataForFrame aData