From: Jacek Caban Subject: [PATCH 1/2] mshtml: Added URI_ flags declaration and improved debug traces. Message-Id: <54C6599B.1030003@codeweavers.com> Date: Mon, 26 Jan 2015 16:13:31 +0100 --- dlls/mshtml/nsiface.idl | 21 +++++++++++++++++++++ dlls/mshtml/nsio.c | 36 +++++++++++++++++++++++++++++++++--- 2 files changed, 54 insertions(+), 3 deletions(-) diff --git a/dlls/mshtml/nsiface.idl b/dlls/mshtml/nsiface.idl index 1d8e263..551406c 100644 --- a/dlls/mshtml/nsiface.idl +++ b/dlls/mshtml/nsiface.idl @@ -2731,6 +2731,27 @@ interface nsIDirectoryServiceProvider2 : nsIDirectoryServiceProvider ] interface nsIProtocolHandler : nsISupports { + const unsigned long URI_STD = 0; + const unsigned long URI_NORELATIVE = (1<<0); + const unsigned long URI_NOAUTH = (1<<1); + const unsigned long ALLOWS_PROXY = (1<<2); + const unsigned long ALLOWS_PROXY_HTTP = (1<<3); + const unsigned long URI_INHERITS_SECURITY_CONTEXT = (1<<4); + const unsigned long URI_FORBIDS_AUTOMATIC_DOCUMENT_REPLACEMENT = (1<<5); + const unsigned long URI_LOADABLE_BY_ANYONE = (1<<6); + const unsigned long URI_DANGEROUS_TO_LOAD = (1<<7); + const unsigned long URI_IS_UI_RESOURCE = (1<<8); + const unsigned long URI_IS_LOCAL_FILE = (1<<9); + const unsigned long URI_LOADABLE_BY_SUBSUMERS = (1<<10); + const unsigned long URI_DOES_NOT_RETURN_DATA = (1<<11); + const unsigned long URI_IS_LOCAL_RESOURCE = (1<<12); + const unsigned long URI_OPENING_EXECUTES_SCRIPT = (1<<13); + const unsigned long URI_NON_PERSISTABLE = (1<<14); + const unsigned long URI_FORBIDS_COOKIE_ACCESS = (1<<15); + const unsigned long URI_CROSS_ORIGIN_NEEDS_WEBAPPS_PERM = (1<<16); + const unsigned long URI_SYNC_LOAD_IS_OK = (1<<17); + const unsigned long URI_SAFE_TO_LOAD_IN_SECURE_CONTEXT = (1<<18); + nsresult GetScheme(nsACString *aScheme); nsresult GetDefaultPort(int32_t *aDefaultPort); nsresult GetProtocolFlags(uint32_t *aProtocolFlags); diff --git a/dlls/mshtml/nsio.c b/dlls/mshtml/nsio.c index d8e1712..44662b5 100644 --- a/dlls/mshtml/nsio.c +++ b/dlls/mshtml/nsio.c @@ -3622,18 +3622,48 @@ static nsresult NSAPI nsNetUtil_ParseContentType(nsINetUtil *iface, const nsACSt return nsINetUtil_ParseContentType(net_util, aTypeHeader, aCharset, aHadCharset, aContentType); } +static const char *debugstr_protocol_flags(UINT32 flags) +{ + switch(flags) { +#define X(f) case f: return #f + X(URI_STD); + X(URI_NORELATIVE); + X(URI_NOAUTH); + X(ALLOWS_PROXY); + X(ALLOWS_PROXY_HTTP); + X(URI_INHERITS_SECURITY_CONTEXT); + X(URI_FORBIDS_AUTOMATIC_DOCUMENT_REPLACEMENT); + X(URI_LOADABLE_BY_ANYONE); + X(URI_DANGEROUS_TO_LOAD); + X(URI_IS_UI_RESOURCE); + X(URI_IS_LOCAL_FILE); + X(URI_LOADABLE_BY_SUBSUMERS); + X(URI_DOES_NOT_RETURN_DATA); + X(URI_IS_LOCAL_RESOURCE); + X(URI_OPENING_EXECUTES_SCRIPT); + X(URI_NON_PERSISTABLE); + X(URI_FORBIDS_COOKIE_ACCESS); + X(URI_CROSS_ORIGIN_NEEDS_WEBAPPS_PERM); + X(URI_SYNC_LOAD_IS_OK); + X(URI_SAFE_TO_LOAD_IN_SECURE_CONTEXT); +#undef X + default: + return wine_dbg_sprintf("%08x", flags); + } +} + static nsresult NSAPI nsNetUtil_ProtocolHasFlags(nsINetUtil *iface, nsIURI *aURI, UINT32 aFlags, cpp_bool *_retval) { - TRACE("()\n"); + TRACE("(%p %s %p)\n", aURI, debugstr_protocol_flags(aFlags), _retval); return nsINetUtil_ProtocolHasFlags(net_util, aURI, aFlags, _retval); } static nsresult NSAPI nsNetUtil_URIChainHasFlags(nsINetUtil *iface, nsIURI *aURI, UINT32 aFlags, cpp_bool *_retval) { - TRACE("(%p %08x %p)\n", aURI, aFlags, _retval); + TRACE("(%p %s %p)\n", aURI, debugstr_protocol_flags(aFlags), _retval); - if(aFlags == (1<<11)) { + if(aFlags == URI_DOES_NOT_RETURN_DATA) { *_retval = FALSE; return NS_OK; }