[xpcom] Fix signal emission checks to actually iterate through the
[browser-dbus-bridge.git] / xpcom-dbusservice / DBusService.cpp
index cfc4e8f..51fef8c 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright © 2008 Movial Creative Technologies Inc
  *  Contact: Movial Creative Technologies Inc, <info@movial.com>
- *  Authors: Lauri Mylläri, <lauri.myllari@movial.fi>
+ *  Authors: Lauri Mylläri, <lauri.myllari@movial.com>
  *           Kalle Vahlman, <kalle.vahlman@movial.com>
  *
  * The contents of this file are subject to the Mozilla Public License
@@ -45,6 +45,7 @@
 #include "DBusService.h"
 #include "DBusMethod.h"
 #include "DBusSignal.h"
+#include "DBusDataCarrier.h"
 #include "DBusMarshaling.h"
 
 #include "bdb-debug.h"
@@ -66,7 +67,8 @@ DBusService::DBusService() :
     mSystemBus(nsnull),
     mSessionBus(nsnull),
     mSystemBusHasFilter(PR_FALSE),
-    mSessionBusHasFilter(PR_FALSE)
+    mSessionBusHasFilter(PR_FALSE),
+    mInsideEmit(PR_FALSE)
 {
     BDBLOG(("DBusService::DBusService()\n"));
     mSystemBusSignalObservers.Init();
@@ -358,14 +360,14 @@ DBusHandlerResult _signal_filter(DBusConnection *connection,
             if (!t.IsEmpty() && !t.Equals(dbus_message_get_sender(message)))
             {
                 BDBLOG(("    sender does not match\n"));
-                break;
+                continue;
             }
             signal->GetObjectPath(t);
             BDBLOG(("    object    : %s\n", PromiseFlatCString(t).get()));
             if (!t.IsEmpty() && !t.Equals(dbus_message_get_path(message)))
             {
                 BDBLOG(("    objectPath does not match\n"));
-                break;
+                continue;
             }
 
             /* do callback */
@@ -690,32 +692,36 @@ DBusService::GetSingleton()
 //
 
 NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(DBusService, DBusService::GetSingleton);
+NS_GENERIC_FACTORY_CONSTRUCTOR(DBusDataCarrier);
 
 static const nsModuleComponentInfo components[] =
 {
     {
         "DBus service",
         DBUSSERVICE_CID,
-        "@movial.fi/dbus/service;1",
+        "@movial.com/dbus/service;1",
         DBusServiceConstructor
     },
     {
         "DBus method",
         DBUSMETHOD_CID,
-        "@movial.fi/dbus/method;1",
+        "@movial.com/dbus/method;1",
         nsnull
     },
     {
         "DBus signal",
         DBUSSIGNAL_CID,
-        "@movial.fi/dbus/signal;1",
+        "@movial.com/dbus/signal;1",
         nsnull
+    },
+    {
+        "DBus data carrier",
+        DBUSDATACARRIER_CID,
+        "@movial.com/dbus/datacarrier;1",
+        DBusDataCarrierConstructor
     }
 };
 
 NS_IMPL_NSGETMODULE(nsDBusServiceModule, components);
 
-
-
-
 /* vim: set cindent ts=4 et sw=4: */