core: Merge two methods of HTTPRequestHandler
authorZeeshan Ali (Khattak) <zeeshanak@gnome.org>
Tue, 1 Sep 2009 22:06:45 +0000 (01:06 +0300)
committerZeeshan Ali (Khattak) <zeeshanak@gnome.org>
Tue, 1 Sep 2009 22:06:45 +0000 (01:06 +0300)
Merge add_content_features_headers and add_response_headers of
HTTPRequestHandler class.

src/rygel/rygel-http-identity-handler.vala
src/rygel/rygel-http-request-handler.vala
src/rygel/rygel-http-transcode-handler.vala

index e2b027f..e473927 100644 (file)
@@ -47,7 +47,8 @@ internal class Rygel.HTTPIdentityHandler : Rygel.HTTPRequestHandler {
             }
         }
 
-        this.add_content_features_headers (request);
+        // Chain-up
+        base.add_response_headers (request);
     }
 
     public override HTTPResponse render_body (HTTPRequest request)
index 035a445..d52da38 100644 (file)
@@ -29,14 +29,7 @@ using GUPnP;
  */
 internal abstract class Rygel.HTTPRequestHandler: GLib.Object {
     // Add response headers.
-    public abstract void add_response_headers (HTTPRequest request)
-                                               throws HTTPRequestError;
-
-    // Create an HTTPResponse object that will render the body.
-    public abstract HTTPResponse render_body (HTTPRequest request)
-                                              throws HTTPRequestError;
-
-    public void add_content_features_headers (HTTPRequest request)
+    public virtual void add_response_headers (HTTPRequest request)
                                               throws HTTPRequestError {
         var didl_writer = new GUPnP.DIDLLiteWriter (null);
         var didl_item = didl_writer.add_item ();
@@ -48,6 +41,10 @@ internal abstract class Rygel.HTTPRequestHandler: GLib.Object {
                                              tokens[3]);
     }
 
+    // Create an HTTPResponse object that will render the body.
+    public abstract HTTPResponse render_body (HTTPRequest request)
+                                              throws HTTPRequestError;
+
     protected abstract DIDLLiteResource add_resource (DIDLLiteItem didl_item,
                                                       HTTPRequest  request)
                                                       throws HTTPRequestError;
index 3597daf..687c60b 100644 (file)
@@ -42,7 +42,8 @@ internal class Rygel.HTTPTranscodeHandler : HTTPRequestHandler {
             request.time_range.add_response_header (request.msg);
         }
 
-        this.add_content_features_headers (request);
+        // Chain-up
+        base.add_response_headers (request);
     }
 
     public override HTTPResponse render_body (HTTPRequest request)