netwerk/protocol/http/nsIHttpProtocolHandler.idl

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

michael@0 1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
michael@0 2 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 5
michael@0 6 #include "nsIProxiedProtocolHandler.idl"
michael@0 7
michael@0 8 [scriptable, uuid(c48126d9-2ddd-485b-a51a-378e917e75f8)]
michael@0 9 interface nsIHttpProtocolHandler : nsIProxiedProtocolHandler
michael@0 10 {
michael@0 11 /**
michael@0 12 * Get the HTTP advertised user agent string.
michael@0 13 */
michael@0 14 readonly attribute ACString userAgent;
michael@0 15
michael@0 16 /**
michael@0 17 * Get the application name.
michael@0 18 *
michael@0 19 * @return The name of this application (eg. "Mozilla").
michael@0 20 */
michael@0 21 readonly attribute ACString appName;
michael@0 22
michael@0 23 /**
michael@0 24 * Get the application version string.
michael@0 25 *
michael@0 26 * @return The complete version (major and minor) string. (eg. "5.0")
michael@0 27 */
michael@0 28 readonly attribute ACString appVersion;
michael@0 29
michael@0 30 /**
michael@0 31 * Get the current platform.
michael@0 32 *
michael@0 33 * @return The platform this application is running on
michael@0 34 * (eg. "Windows", "Macintosh", "X11")
michael@0 35 */
michael@0 36 readonly attribute ACString platform;
michael@0 37
michael@0 38 /**
michael@0 39 * Get the current oscpu.
michael@0 40 *
michael@0 41 * @return The oscpu this application is running on
michael@0 42 */
michael@0 43 readonly attribute ACString oscpu;
michael@0 44
michael@0 45 /**
michael@0 46 * Get the application comment misc portion.
michael@0 47 */
michael@0 48 readonly attribute ACString misc;
michael@0 49
michael@0 50 };
michael@0 51
michael@0 52 %{C++
michael@0 53 // ----------- Categories -----------
michael@0 54 /**
michael@0 55 * At initialization time, the HTTP handler will initialize each service
michael@0 56 * registered under this category:
michael@0 57 */
michael@0 58 #define NS_HTTP_STARTUP_CATEGORY "http-startup-category"
michael@0 59
michael@0 60 // ----------- Observer topics -----------
michael@0 61 /**
michael@0 62 * nsIObserver notification corresponding to startup category. Services
michael@0 63 * registered under the startup category will receive this observer topic at
michael@0 64 * startup if they implement nsIObserver. The "subject" of the notification
michael@0 65 * is the nsIHttpProtocolHandler instance.
michael@0 66 */
michael@0 67 #define NS_HTTP_STARTUP_TOPIC "http-startup"
michael@0 68
michael@0 69 /**
michael@0 70 * This observer topic is notified when an HTTP channel is opened.
michael@0 71 * It is similar to http-on-modify-request, except that
michael@0 72 * 1) The notification is guaranteed to occur before on-modify-request, during
michael@0 73 * the AsyncOpen call itself.
michael@0 74 * 2) It only occurs for the initial open of a channel, not for internal
michael@0 75 * asyncOpens that happen during redirects, etc.
michael@0 76 * 3) Some information (most notably nsIProxiedChannel.proxyInfo) may not be set
michael@0 77 * on the channel object yet.
michael@0 78 *
michael@0 79 * The "subject" of the notification is the nsIHttpChannel instance.
michael@0 80 *
michael@0 81 * Generally the 'http-on-modify-request' notification is preferred unless the
michael@0 82 * synchronous, during-asyncOpen behavior that this notification provides is
michael@0 83 * required.
michael@0 84 */
michael@0 85 #define NS_HTTP_ON_OPENING_REQUEST_TOPIC "http-on-opening-request"
michael@0 86
michael@0 87 /**
michael@0 88 * Before an HTTP request is sent to the server, this observer topic is
michael@0 89 * notified. The observer of this topic can then choose to set any additional
michael@0 90 * headers for this request before the request is actually sent to the server.
michael@0 91 * The "subject" of the notification is the nsIHttpChannel instance.
michael@0 92 */
michael@0 93 #define NS_HTTP_ON_MODIFY_REQUEST_TOPIC "http-on-modify-request"
michael@0 94
michael@0 95 /**
michael@0 96 * After an HTTP server response is received, this observer topic is notified.
michael@0 97 * The observer of this topic can interrogate the response. The "subject" of
michael@0 98 * the notification is the nsIHttpChannel instance.
michael@0 99 */
michael@0 100 #define NS_HTTP_ON_EXAMINE_RESPONSE_TOPIC "http-on-examine-response"
michael@0 101
michael@0 102 /**
michael@0 103 * The observer of this topic is notified after the received HTTP response
michael@0 104 * is merged with data from the browser cache. This means that, among other
michael@0 105 * things, the Content-Type header will be set correctly.
michael@0 106 */
michael@0 107 #define NS_HTTP_ON_EXAMINE_MERGED_RESPONSE_TOPIC "http-on-examine-merged-response"
michael@0 108
michael@0 109 /**
michael@0 110 * The observer of this topic is notified before data is read from the cache.
michael@0 111 * The notification is sent if and only if there is no network communication
michael@0 112 * at all.
michael@0 113 */
michael@0 114 #define NS_HTTP_ON_EXAMINE_CACHED_RESPONSE_TOPIC "http-on-examine-cached-response"
michael@0 115
michael@0 116
michael@0 117 %}

mercurial