[rygel] core: Turn HTTPRequestHandler into abstract class
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [rygel] core: Turn HTTPRequestHandler into abstract class
- Date: Tue, 1 Sep 2009 22:40:14 +0000 (UTC)
commit 201aa988ef1c7ec3743b9d65902a574fc90c4eec
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date: Wed Sep 2 00:56:40 2009 +0300
core: Turn HTTPRequestHandler into abstract class
src/rygel/rygel-http-identity-handler.vala | 17 ++++++++---------
src/rygel/rygel-http-request-handler.vala | 2 +-
src/rygel/rygel-http-transcode-handler.vala | 16 ++++++++--------
3 files changed, 17 insertions(+), 18 deletions(-)
---
diff --git a/src/rygel/rygel-http-identity-handler.vala b/src/rygel/rygel-http-identity-handler.vala
index 1569573..e2b027f 100644
--- a/src/rygel/rygel-http-identity-handler.vala
+++ b/src/rygel/rygel-http-identity-handler.vala
@@ -24,13 +24,12 @@
using GUPnP;
// An HTTP request handler that passes the item content through as is.
-internal class Rygel.HTTPIdentityHandler : GLib.Object,
- Rygel.HTTPRequestHandler {
+internal class Rygel.HTTPIdentityHandler : Rygel.HTTPRequestHandler {
public HTTPIdentityHandler () {}
- public virtual void add_response_headers (HTTPRequest request)
- throws HTTPRequestError {
+ public override void add_response_headers (HTTPRequest request)
+ throws HTTPRequestError {
var item = request.item;
request.msg.response_headers.append ("Content-Type", item.mime_type);
@@ -51,8 +50,8 @@ internal class Rygel.HTTPIdentityHandler : GLib.Object,
this.add_content_features_headers (request);
}
- public virtual HTTPResponse render_body (HTTPRequest request)
- throws HTTPRequestError {
+ public override HTTPResponse render_body (HTTPRequest request)
+ throws HTTPRequestError {
var item = request.item;
if (item.should_stream ()) {
@@ -81,9 +80,9 @@ internal class Rygel.HTTPIdentityHandler : GLib.Object,
}
}
- protected DIDLLiteResource add_resource (DIDLLiteItem didl_item,
- HTTPRequest request)
- throws HTTPRequestError {
+ protected override DIDLLiteResource add_resource (DIDLLiteItem didl_item,
+ HTTPRequest request)
+ throws HTTPRequestError {
return request.item.add_resource (didl_item,
null,
request.http_server.get_protocol ());
diff --git a/src/rygel/rygel-http-request-handler.vala b/src/rygel/rygel-http-request-handler.vala
index 0054ea5..035a445 100644
--- a/src/rygel/rygel-http-request-handler.vala
+++ b/src/rygel/rygel-http-request-handler.vala
@@ -27,7 +27,7 @@ using GUPnP;
/**
* HTTP request handler interface.
*/
-internal interface Rygel.HTTPRequestHandler: GLib.Object {
+internal abstract class Rygel.HTTPRequestHandler: GLib.Object {
// Add response headers.
public abstract void add_response_headers (HTTPRequest request)
throws HTTPRequestError;
diff --git a/src/rygel/rygel-http-transcode-handler.vala b/src/rygel/rygel-http-transcode-handler.vala
index f8908e0..3597daf 100644
--- a/src/rygel/rygel-http-transcode-handler.vala
+++ b/src/rygel/rygel-http-transcode-handler.vala
@@ -27,15 +27,15 @@ using GUPnP;
/**
* The handler for HTTP transcoding requests.
*/
-internal class Rygel.HTTPTranscodeHandler : GLib.Object, HTTPRequestHandler {
+internal class Rygel.HTTPTranscodeHandler : HTTPRequestHandler {
private Transcoder transcoder;
public HTTPTranscodeHandler (Transcoder transcoder) {
this.transcoder = transcoder;
}
- public virtual void add_response_headers (HTTPRequest request)
- throws HTTPRequestError {
+ public override void add_response_headers (HTTPRequest request)
+ throws HTTPRequestError {
request.msg.response_headers.append ("Content-Type",
this.transcoder.mime_type);
if (request.time_range != null) {
@@ -45,8 +45,8 @@ internal class Rygel.HTTPTranscodeHandler : GLib.Object, HTTPRequestHandler {
this.add_content_features_headers (request);
}
- public virtual HTTPResponse render_body (HTTPRequest request)
- throws HTTPRequestError {
+ public override HTTPResponse render_body (HTTPRequest request)
+ throws HTTPRequestError {
var item = request.item;
var src = item.create_stream_source ();
if (src == null) {
@@ -62,9 +62,9 @@ internal class Rygel.HTTPTranscodeHandler : GLib.Object, HTTPRequestHandler {
request.time_range);
}
- protected DIDLLiteResource add_resource (DIDLLiteItem didl_item,
- HTTPRequest request)
- throws HTTPRequestError {
+ protected override DIDLLiteResource add_resource (DIDLLiteItem didl_item,
+ HTTPRequest request)
+ throws HTTPRequestError {
return this.transcoder.add_resource (didl_item,
request.item,
request.http_server);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]