rygel r534 - trunk/src/rygel



Author: zeeshanak
Date: Mon Feb  9 22:27:15 2009
New Revision: 534
URL: http://svn.gnome.org/viewvc/rygel?rev=534&view=rev

Log:
HTTPServer keeps a weak (for now) ref to ContentDir.

Modified:
   trunk/src/rygel/rygel-content-directory.vala
   trunk/src/rygel/rygel-http-server.vala

Modified: trunk/src/rygel/rygel-content-directory.vala
==============================================================================
--- trunk/src/rygel/rygel-content-directory.vala	(original)
+++ trunk/src/rygel/rygel-content-directory.vala	Mon Feb  9 22:27:15 2009
@@ -60,7 +60,7 @@
     }
 
     public override void constructed () {
-        this.http_server = new HTTPServer (context, this.get_type ().name ());
+        this.http_server = new HTTPServer (this, this.get_type ().name ());
         this.root_container = this.create_root_container ();
 
         this.browses = new ArrayList<Browse> ();

Modified: trunk/src/rygel/rygel-http-server.vala
==============================================================================
--- trunk/src/rygel/rygel-http-server.vala	(original)
+++ trunk/src/rygel/rygel-http-server.vala	Mon Feb  9 22:27:15 2009
@@ -23,6 +23,7 @@
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  */
 
+using Rygel;
 using Gst;
 using GUPnP;
 using Gee;
@@ -37,6 +38,8 @@
     private const string SERVER_PATH_PREFIX = "/RygelHTTPServer";
     private string path_root;
 
+    // Reference to associated ContentDirectory service
+    private unowned ContentDirectory content_dir;
     private GUPnP.Context context;
     private ArrayList<HTTPResponse> responses;
 
@@ -45,8 +48,10 @@
     public signal void item_requested (string item_id,
                                        out MediaItem item);
 
-    public HTTPServer (GUPnP.Context context, string name) {
-        this.context = context;
+    public HTTPServer (ContentDirectory content_dir,
+                       string           name) {
+        this.content_dir = content_dir;
+        this.context = content_dir.context;
         this.responses = new ArrayList<HTTPResponse> ();
 
         this.path_root = SERVER_PATH_PREFIX + "/" + name;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]