[rygel] core: Merge two methods of HTTPRequestHandler



commit 714665fbf5b677337303eb9988a2cd9d0d2347d4
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Wed Sep 2 01:06:45 2009 +0300

    core: Merge two methods of HTTPRequestHandler
    
    Merge add_content_features_headers and add_response_headers of
    HTTPRequestHandler class.

 src/rygel/rygel-http-identity-handler.vala  |    3 ++-
 src/rygel/rygel-http-request-handler.vala   |   13 +++++--------
 src/rygel/rygel-http-transcode-handler.vala |    3 ++-
 3 files changed, 9 insertions(+), 10 deletions(-)
---
diff --git a/src/rygel/rygel-http-identity-handler.vala b/src/rygel/rygel-http-identity-handler.vala
index e2b027f..e473927 100644
--- a/src/rygel/rygel-http-identity-handler.vala
+++ b/src/rygel/rygel-http-identity-handler.vala
@@ -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)
diff --git a/src/rygel/rygel-http-request-handler.vala b/src/rygel/rygel-http-request-handler.vala
index 035a445..d52da38 100644
--- a/src/rygel/rygel-http-request-handler.vala
+++ b/src/rygel/rygel-http-request-handler.vala
@@ -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;
diff --git a/src/rygel/rygel-http-transcode-handler.vala b/src/rygel/rygel-http-transcode-handler.vala
index 3597daf..687c60b 100644
--- a/src/rygel/rygel-http-transcode-handler.vala
+++ b/src/rygel/rygel-http-transcode-handler.vala
@@ -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)



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