Permalink
Browse files

In progress of refining interfaces.

  • Loading branch information...
1 parent 77d5d89 commit 4ad38695fd210cda8000be7fd7859fcd70a775e3 Soares Chen committed Feb 6, 2012
View
@@ -12,10 +12,12 @@ XPI_NAME = fireshell
XPIDLSRCS = \
+ hyIAsciiString.idl \
hyIChannelHandler.idl \
hyIChannelHandlerListener.idl \
hyIChannelToStreamConverter.idl \
hyIChannelToStreamConverterListener.idl \
+ hyICppStdString.idl \
hyIDataBuffer.idl \
hyIDataChannel.idl \
hyIDataChannelListener.idl \
@@ -25,18 +27,22 @@ XPIDLSRCS = \
hyIHttpHandlerListener.idl \
hyIHttpHandlerTable.idl \
hyIHttpHeaderFields.idl \
+ hyIHttpHeaderVisitor.idl \
hyIHttpRequestChannel.idl \
hyIHttpRequestChannelListener.idl \
hyIHttpRequest.idl \
hyIHttpResponseChannel.idl \
hyIHttpResponseChannelListener.idl \
hyIHttpResponse.idl \
+ hyIPipelineHttpHandler.idl \
hyISSLChannel.idl \
hyISSLChannelListener.idl \
hyITextChannel.idl \
hyITextChannelListener.idl \
hyIUnicodeString.idl \
hyIUnicodeStringIterator.idl \
+ hyIUnicodeTable.idl \
+ hyIUnicodeTableVisitor.idl \
hyIUploadDataChannel.idl \
hyIXmlChannel.idl \
hyIXmlChannelListener.idl \
@@ -0,0 +1,18 @@
+
+#include "nsISupports.idl"
+
+[scriptable, uuid(c0ba3a69-2a5c-4d59-acb4-406b4ad80e3d)]
+interface hyIAsciiString : nsISupports
+{
+ readonly attribute unsigned long long length;
+ readonly attribute string data;
+
+ /*
+ * This allows the string class to perform
+ * some optimization if both string objects
+ * are belong to the same implementation class,
+ * as determined by QueryInterface-ing the other
+ * string.
+ */
+ bool equalString(in hyIAsciiString aOther);
+};
@@ -0,0 +1,16 @@
+
+#include "hyIAsciiString.idl"
+
+[uuid(d8ec8a2c-479a-49d4-8a65-c30848963c1e)]
+interface hyICppStdString : hyIAsciiString
+{
+ /*
+ * Returns a void* pointer that to be manually
+ * static casted into std::string* and then
+ * dereferenced into const std::string&.
+ *
+ * The std::string object must not be modified
+ * even though it is allowed by the compiler.
+ */
+ voidPtr toCppStringPtr();
+};
@@ -5,8 +5,8 @@
[scriptable, uuid(09f57586-308b-4dbd-ae82-5dcf7ba5e3fa)]
interface hyIHttpHandler : nsISupports
{
- void acceptHttpRequestChannel(
- in hyIHttpRequestChannel aRequestChannel,
- in hyIHttpHandlerListener aListener,
- in nsISupports aContext);
+ void acceptHttpRequestChannel(
+ in hyIHttpRequestChannel aRequestChannel,
+ in hyIHttpHandlerListener aListener,
+ in nsISupports aContext);
};
@@ -3,5 +3,7 @@
[scriptable, uuid(cd2530da-d5f0-4fcf-af31-812d17a4d631)]
interface hyIHttpHandlerFactory : nsISupports {
- hyIHttpHandler createHttpHandler();
+ hyIHttpHandler createHttpHandler(
+ /* environment objects such as reactors
+ and configurations go here.*/ );
};
@@ -4,7 +4,7 @@
[scriptable, uuid(99aec805-d150-46b4-ac8a-d07435411d76)]
interface hyIHttpHandlerListener : nsISupports
{
- void onOutputHttpChannelReady(
+ void onHttpResponseChannelReady(
in hyIHttpResponseChannel aResponseChannel,
in nsISupports aContext);
};
@@ -6,6 +6,6 @@ interface hyIHttpHandlerTable : nsISupports {
hyIHttpHandlerFactory getHttpHandlerFactory(in ACString aPath);
void registerHttpHandlerFactory(
- in ACString aPath,
+ in string aPath,
in hyIHttpHandlerFactory aFactory);
};
@@ -1,9 +1,13 @@
#include "nsISupports.idl"
-#include "nsIHttpHeaderVisitor.idl"
+#include "hyIHttpHeaderVisitor.idl"
[scriptable, uuid(58baf11d-f41f-41ed-9c1c-8150962a1da4)]
-interface hyIHttpHeaderFields : nsIHttpHeaderVisitor
+interface hyIHttpHeaderFields : nsISupports
{
- ACString getValue(in ACString aKey);
- void acceptHeaderVisitor(in nsIHttpHeaderVisitor aVisitor);
+ /*
+ * Returns NULL if there is no such key.
+ */
+ hyIAsciiString getValue(in hyIAsciiString aKey);
+
+ void acceptHeaderVisitor(in hyIHttpHeaderVisitor aVisitor);
};
@@ -0,0 +1,10 @@
+#include "nsISupports.idl"
+#include "hyIAsciiString.idl"
+
+[scriptable, uuid(3f929378-67c1-4cea-bd87-3e193d0ee086)]
+interface hyIHttpHeaderVisitor : nsISupports
+{
+ void visitHeader(
+ in hyIAsciiString aHeader,
+ in hyIAsciiString aValue);
+};
@@ -1,13 +1,39 @@
#include "nsISupports.idl"
#include "nsIURI.idl"
#include "hyIHttpHeaderFields.idl"
+#include "hyIUnicodeTable.idl"
[scriptable, uuid(fa9f2917-2256-496c-9663-8aca31ce283c)]
interface hyIHttpRequest : nsISupports {
- readonly attribute ACString requestHttpVersion;
- readonly attribute nsIURI requestURI;
- readonly attribute ACString requestMethod;
- readonly attribute ACString requestHost;
- readonly attribute ACString requestContentType;
- readonly attribute hyIHttpHeaderFields requestHeaders;
+ readonly attribute hyIAsciiString requestHttpVersion;
+ readonly attribute hyIAsciiString requestPath;
+
+ /*
+ * The query string part of the HTTP request. The value must
+ * be URL-escaped according to the percent encoding and the
+ * string shall be interpreted in ASCII encoding.
+ */
+ readonly attribute hyIAsciiString requestQueryString;
+
+ /*
+ * A processed version of the decoded query string into
+ * table entries. If the query string is not yet processed
+ * then this may return NULL, and the caller would have to
+ * process the query string itself.
+ */
+ readonly attribute hyIUnicodeTable requestQueryParams;
+
+ /*
+ * Request method such as GET and POST encoded in ASCII C string.
+ */
+ readonly attribute hyIAsciiString requestMethod;
+
+ /*
+ * Hostname encoded in ASCII. This field should only be considered
+ * by top-level dispatcher handler. Application-level handlers
+ * should not rely on this field, as the domain might change to
+ * localhost during subrequest. Instead, use Hypershell-related
+ * HTTP headers to retrieve information about the server environment.
+ */
+ readonly attribute hyIAsciiString requestHost;
};
@@ -6,6 +6,8 @@
interface hyIHttpRequestChannelListener : nsISupports {
void onHttpRequestReady(
in hyIHttpRequest aRequest,
+
+ in hyIHttpHeaderFields aHeaders,
/*
* This carries the actual HTTP content other than
@@ -3,9 +3,7 @@
[scriptable, uuid(7f5612e4-1358-4f8c-a0e6-b4ddc5942b97)]
interface hyIHttpResponse {
- readonly attribute ACString responseHttpVersion;
+ readonly attribute hyIAsciiString responseHttpVersion;
readonly attribute unsigned long responseStatusCode;
- readonly attribute ACString responseStatusMessage;
- readonly attribute ACString responseContentType;
- readonly attribute hyIHttpHeaderFields responseHeaders;
+ readonly attribute hyIAsciiString responseStatusMessage;
};
@@ -6,6 +6,8 @@
interface hyIHttpResponseChannelListener {
void onHttpResponseReady(
in hyIHttpResponse aResponse,
+
+ in hyIHttpHeaderFields aHeaders,
/*
* This carries the actual HTTP content other than
@@ -0,0 +1,10 @@
+#include "hyIHttpHandler.idl"
+
+[scriptable, uuid(8a762cae-6771-4078-882d-6e0813629b47)]
+interface hyIPipelineHttpHandler : hyIHttpHandler
+{
+ void appendHttpHandler(
+ in hyIHttpHandler aHandler,
+ in hyIHttpRequest aRequest,
+ in hyIHttpHeaderFields aHeaders);
+};
@@ -1,13 +1,15 @@
#include "nsISupports.idl"
+#include "hyIAsciiString.idl"
#include "hyIUnicodeStringIterator.idl"
+#include "hyIDataBuffer.idl"
[scriptable, uuid(926822ca-d6c5-41cf-ab27-e369d2cda450)]
interface hyIUnicodeString : nsISupports
{
/*
* The number of code points the Unicode string has.
*/
- readonly attribute unsigned long long size;
+ readonly attribute unsigned long long length;
/*
* Creates an iterator that automatically decode and
@@ -18,15 +20,12 @@ interface hyIUnicodeString : nsISupports
/*
* Get the encoding name in the form of ASCII string.
*/
- readonly attribute string encoding;
+ readonly attribute hyIAsciiString encoding;
/*
- * Get the raw size of the string.
+ * Get the raw buffer that contains the encoded raw bytes.
*/
- readonly attribute unsigned long long byteSize;
+ readonly attribute hyIDataBuffer buffer;
- /*
- * get the raw byte content of the string.
- */
- readonly attribute string bytes;
+ bool equalCodepoint(in hyIUnicodeString aOther);
};
@@ -0,0 +1,14 @@
+
+#include "nsISupports.idl"
+#include "hyIUnicodeString.idl"
+#include "hyIUnicodeTableVisitor.idl"
+
+[scriptable, uuid(5af50a3c-e502-48d4-b468-604ea893b694)]
+interface hyIUnicodeTable : nsISupports {
+ /*
+ * Returns NULL of such key does not exist.
+ */
+ hyIUnicodeString getValue(in hyIUnicodeString aKey);
+
+ void acceptTableVisitor(in hyIUnicodeTableVisitor aVisitor);
+};
@@ -0,0 +1,10 @@
+
+#include "nsISupports.idl"
+#include "hyIUnicodeString.idl"
+
+[scriptable, uuid(87680a6f-85da-4ecb-bf2e-4079a62f3337)]
+interface hyIUnicodeTableVisitor : nsISupports {
+ void visitTableEntry(
+ in hyIUnicodeString aKey,
+ in hyIUnicodeString aValue);
+};
Oops, something went wrong.

0 comments on commit 4ad3869

Please sign in to comment.