1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/netwerk/protocol/http/nsIHttpProtocolHandler.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,117 @@ 1.4 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#include "nsIProxiedProtocolHandler.idl" 1.10 + 1.11 +[scriptable, uuid(c48126d9-2ddd-485b-a51a-378e917e75f8)] 1.12 +interface nsIHttpProtocolHandler : nsIProxiedProtocolHandler 1.13 +{ 1.14 + /** 1.15 + * Get the HTTP advertised user agent string. 1.16 + */ 1.17 + readonly attribute ACString userAgent; 1.18 + 1.19 + /** 1.20 + * Get the application name. 1.21 + * 1.22 + * @return The name of this application (eg. "Mozilla"). 1.23 + */ 1.24 + readonly attribute ACString appName; 1.25 + 1.26 + /** 1.27 + * Get the application version string. 1.28 + * 1.29 + * @return The complete version (major and minor) string. (eg. "5.0") 1.30 + */ 1.31 + readonly attribute ACString appVersion; 1.32 + 1.33 + /** 1.34 + * Get the current platform. 1.35 + * 1.36 + * @return The platform this application is running on 1.37 + * (eg. "Windows", "Macintosh", "X11") 1.38 + */ 1.39 + readonly attribute ACString platform; 1.40 + 1.41 + /** 1.42 + * Get the current oscpu. 1.43 + * 1.44 + * @return The oscpu this application is running on 1.45 + */ 1.46 + readonly attribute ACString oscpu; 1.47 + 1.48 + /** 1.49 + * Get the application comment misc portion. 1.50 + */ 1.51 + readonly attribute ACString misc; 1.52 + 1.53 +}; 1.54 + 1.55 +%{C++ 1.56 +// ----------- Categories ----------- 1.57 +/** 1.58 + * At initialization time, the HTTP handler will initialize each service 1.59 + * registered under this category: 1.60 + */ 1.61 +#define NS_HTTP_STARTUP_CATEGORY "http-startup-category" 1.62 + 1.63 +// ----------- Observer topics ----------- 1.64 +/** 1.65 + * nsIObserver notification corresponding to startup category. Services 1.66 + * registered under the startup category will receive this observer topic at 1.67 + * startup if they implement nsIObserver. The "subject" of the notification 1.68 + * is the nsIHttpProtocolHandler instance. 1.69 + */ 1.70 +#define NS_HTTP_STARTUP_TOPIC "http-startup" 1.71 + 1.72 +/** 1.73 + * This observer topic is notified when an HTTP channel is opened. 1.74 + * It is similar to http-on-modify-request, except that 1.75 + * 1) The notification is guaranteed to occur before on-modify-request, during 1.76 + * the AsyncOpen call itself. 1.77 + * 2) It only occurs for the initial open of a channel, not for internal 1.78 + * asyncOpens that happen during redirects, etc. 1.79 + * 3) Some information (most notably nsIProxiedChannel.proxyInfo) may not be set 1.80 + * on the channel object yet. 1.81 + * 1.82 + * The "subject" of the notification is the nsIHttpChannel instance. 1.83 + * 1.84 + * Generally the 'http-on-modify-request' notification is preferred unless the 1.85 + * synchronous, during-asyncOpen behavior that this notification provides is 1.86 + * required. 1.87 + */ 1.88 +#define NS_HTTP_ON_OPENING_REQUEST_TOPIC "http-on-opening-request" 1.89 + 1.90 +/** 1.91 + * Before an HTTP request is sent to the server, this observer topic is 1.92 + * notified. The observer of this topic can then choose to set any additional 1.93 + * headers for this request before the request is actually sent to the server. 1.94 + * The "subject" of the notification is the nsIHttpChannel instance. 1.95 + */ 1.96 +#define NS_HTTP_ON_MODIFY_REQUEST_TOPIC "http-on-modify-request" 1.97 + 1.98 +/** 1.99 + * After an HTTP server response is received, this observer topic is notified. 1.100 + * The observer of this topic can interrogate the response. The "subject" of 1.101 + * the notification is the nsIHttpChannel instance. 1.102 + */ 1.103 +#define NS_HTTP_ON_EXAMINE_RESPONSE_TOPIC "http-on-examine-response" 1.104 + 1.105 +/** 1.106 + * The observer of this topic is notified after the received HTTP response 1.107 + * is merged with data from the browser cache. This means that, among other 1.108 + * things, the Content-Type header will be set correctly. 1.109 + */ 1.110 +#define NS_HTTP_ON_EXAMINE_MERGED_RESPONSE_TOPIC "http-on-examine-merged-response" 1.111 + 1.112 +/** 1.113 + * The observer of this topic is notified before data is read from the cache. 1.114 + * The notification is sent if and only if there is no network communication 1.115 + * at all. 1.116 + */ 1.117 +#define NS_HTTP_ON_EXAMINE_CACHED_RESPONSE_TOPIC "http-on-examine-cached-response" 1.118 + 1.119 + 1.120 +%}