Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
deb884a6
Commit
deb884a6
authored
Jun 30, 2015
by
Zhenbo Li
Committed by
Alexandre Julliard
Jul 01, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Add IHTMLXMLHttpRequestFactory::create() method implementation.
parent
bfafef4e
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
159 additions
and
8 deletions
+159
-8
htmlwindow.c
dlls/mshtml/htmlwindow.c
+8
-6
mshtml_private.h
dlls/mshtml/mshtml_private.h
+4
-1
nsembed.c
dlls/mshtml/nsembed.c
+50
-0
nsiface.idl
dlls/mshtml/nsiface.idl
+85
-0
xmlhttprequest.c
dlls/mshtml/xmlhttprequest.c
+12
-1
No files found.
dlls/mshtml/htmlwindow.c
View file @
deb884a6
...
...
@@ -256,8 +256,9 @@ static void release_inner_window(HTMLInnerWindow *This)
IHTMLOptionElementFactory_Release
(
&
This
->
option_factory
->
IHTMLOptionElementFactory_iface
);
}
if
(
This
->
xml_factory
)
{
IHTMLXMLHttpRequestFactory_Release
(
&
This
->
xml_factory
->
IHTMLXMLHttpRequestFactory_iface
);
if
(
This
->
xhr_factory
)
{
This
->
xhr_factory
->
window
=
NULL
;
IHTMLXMLHttpRequestFactory_Release
(
&
This
->
xhr_factory
->
IHTMLXMLHttpRequestFactory_iface
);
}
if
(
This
->
screen
)
...
...
@@ -1973,16 +1974,17 @@ static HRESULT WINAPI HTMLWindow5_get_XMLHttpRequest(IHTMLWindow5 *iface, VARIAN
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
if
(
!
window
->
x
ml
_factory
)
{
if
(
!
window
->
x
hr
_factory
)
{
HRESULT
hres
;
hres
=
HTMLXMLHttpRequestFactory_Create
(
window
,
&
window
->
x
ml
_factory
);
if
(
FAILED
(
hres
))
hres
=
HTMLXMLHttpRequestFactory_Create
(
window
,
&
window
->
x
hr
_factory
);
if
(
FAILED
(
hres
))
{
return
hres
;
}
}
V_VT
(
p
)
=
VT_DISPATCH
;
V_DISPATCH
(
p
)
=
(
IDispatch
*
)
&
window
->
x
ml
_factory
->
IHTMLXMLHttpRequestFactory_iface
;
V_DISPATCH
(
p
)
=
(
IDispatch
*
)
&
window
->
x
hr
_factory
->
IHTMLXMLHttpRequestFactory_iface
;
IDispatch_AddRef
(
V_DISPATCH
(
p
));
return
S_OK
;
...
...
dlls/mshtml/mshtml_private.h
View file @
deb884a6
...
...
@@ -359,6 +359,8 @@ typedef struct {
IHTMLXMLHttpRequestFactory
IHTMLXMLHttpRequestFactory_iface
;
LONG
ref
;
HTMLInnerWindow
*
window
;
}
HTMLXMLHttpRequestFactory
;
struct
HTMLLocation
{
...
...
@@ -447,7 +449,7 @@ struct HTMLInnerWindow {
HTMLImageElementFactory
*
image_factory
;
HTMLOptionElementFactory
*
option_factory
;
HTMLXMLHttpRequestFactory
*
x
ml
_factory
;
HTMLXMLHttpRequestFactory
*
x
hr
_factory
;
IHTMLScreen
*
screen
;
OmHistory
*
history
;
IHTMLStorage
*
session_storage
;
...
...
@@ -876,6 +878,7 @@ HRESULT nsnode_to_nsstring(nsIDOMNode*,nsAString*) DECLSPEC_HIDDEN;
void
get_editor_controller
(
NSContainer
*
)
DECLSPEC_HIDDEN
;
nsresult
get_nsinterface
(
nsISupports
*
,
REFIID
,
void
**
)
DECLSPEC_HIDDEN
;
nsIWritableVariant
*
create_nsvariant
(
void
)
DECLSPEC_HIDDEN
;
nsIXMLHttpRequest
*
create_nsxhr
(
nsIDOMWindow
*
nswindow
)
DECLSPEC_HIDDEN
;
nsresult
create_nsfile
(
const
PRUnichar
*
,
nsIFile
**
)
DECLSPEC_HIDDEN
;
char
*
get_nscategory_entry
(
const
char
*
,
const
char
*
)
DECLSPEC_HIDDEN
;
...
...
dlls/mshtml/nsembed.c
View file @
deb884a6
...
...
@@ -48,6 +48,8 @@ WINE_DECLARE_DEBUG_CHANNEL(gecko);
#define NS_PREFERENCES_CONTRACTID "@mozilla.org/preferences;1"
#define NS_VARIANT_CONTRACTID "@mozilla.org/variant;1"
#define NS_CATEGORYMANAGER_CONTRACTID "@mozilla.org/categorymanager;1"
#define NS_XMLHTTPREQUEST_CONTRACTID "@mozilla.org/xmlextras/xmlhttprequest;1"
#define NS_SCRIPTSECURITYMANAGER_CONTRACTID "@mozilla.org/scriptsecuritymanager;1"
#define PR_UINT32_MAX 0xffffffff
...
...
@@ -2160,3 +2162,51 @@ void NSContainer_Release(NSContainer *This)
nsIWebBrowserChrome_Release
(
&
This
->
nsIWebBrowserChrome_iface
);
}
nsIXMLHttpRequest
*
create_nsxhr
(
nsIDOMWindow
*
nswindow
)
{
nsIScriptSecurityManager
*
secman
;
nsIPrincipal
*
nspri
;
nsIGlobalObject
*
nsglo
;
nsIXMLHttpRequest
*
nsxhr
;
nsresult
nsres
;
nsres
=
nsIServiceManager_GetServiceByContractID
(
pServMgr
,
NS_SCRIPTSECURITYMANAGER_CONTRACTID
,
&
IID_nsIScriptSecurityManager
,
(
void
**
)
&
secman
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"Could not get sec manager service: %08x
\n
"
,
nsres
);
return
NULL
;
}
nsres
=
nsIScriptSecurityManager_GetSystemPrincipal
(
secman
,
&
nspri
);
nsIScriptSecurityManager_Release
(
secman
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"GetSystemPrincipal failed: %08x
\n
"
,
nsres
);
return
NULL
;
}
nsres
=
nsIDOMWindow_QueryInterface
(
nswindow
,
&
IID_nsIGlobalObject
,
(
void
**
)
&
nsglo
);
assert
(
nsres
==
NS_OK
);
nsres
=
nsIComponentManager_CreateInstanceByContractID
(
pCompMgr
,
NS_XMLHTTPREQUEST_CONTRACTID
,
NULL
,
&
IID_nsIXMLHttpRequest
,
(
void
**
)
&
nsxhr
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"Could not get nsIXMLHttpRequest: %08x
\n
"
,
nsres
);
nsISupports_Release
(
nspri
);
nsIGlobalObject_Release
(
nsglo
);
return
NULL
;
}
nsres
=
nsIXMLHttpRequest_Init
(
nsxhr
,
nspri
,
NULL
,
nsglo
,
NULL
);
nsISupports_Release
(
nspri
);
nsIGlobalObject_Release
(
nsglo
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"nsIXMLHttpRequest_Init failed: %08x
\n
"
,
nsres
);
nsIXMLHttpRequest_Release
(
nsxhr
);
return
NULL
;
}
return
nsxhr
;
}
dlls/mshtml/nsiface.idl
View file @
deb884a6
...
...
@@ -196,6 +196,14 @@ typedef nsISupports nsIDOMPkcs11;
typedef nsISupports nsIDocShellTreeOwner;
typedef nsISupports nsIArray;
typedef nsISupports nsILoadInfo;
typedef nsISupports nsIContentSecurityPolicy;
typedef nsISupports nsIXMLHttpRequestUpload;
typedef nsISupports nsIClassInfo;
typedef nsISupports nsILoadContext;
typedef nsISupports nsIDomainPolicy;
typedef nsISupports nsIScriptContext;
typedef nsISupports nsIObjectInputStream;
typedef nsISupports nsIObjectOutputStream;
typedef void *JSContext;
typedef void *JSObject;
...
...
@@ -4015,4 +4023,81 @@ interface nsIPluginInstance : nsISupports
nsresult
GetDOMElement
(
nsIDOMElement
**
aDOMElement
)
;
}
[
object
,
uuid
(
e2538ded
-
13
ef
-
4
f4d
-
946b
-
65
d333b4f03c
),
local
]
interface
nsIGlobalObject
:
nsISupports
{
}
[
object
,
uuid
(
2
e91e088
-
e9fa
-
4b
a4
-
9887
-
2
a0b7cf27a3e
),
local
]
interface
nsIXMLHttpRequest
:
nsISupports
{
nsresult
GetChannel
(
nsIChannel
**
aChannel
)
;
nsresult
GetResponseXML
(
nsIDOMDocument
**
aResponseXML
)
;
nsresult
GetResponseText
(
nsAString
*
aResponseText
)
;
nsresult
GetResponseType
(
nsAString
*
aResponseType
)
;
nsresult
SetResponseType
(
const
nsAString
*
aResponseType
)
;
nsresult
GetResponse
(
JSContext
*
cx
,
int
/*
JS
::
MutableHandleValue
*/
aResponse
)
;
nsresult
GetStatus
(
uint32_t
*
aStatus
)
;
nsresult
GetStatusText
(
nsACString
*
aStatusText
)
;
nsresult
SlowAbort
()
;
nsresult
GetAllResponseHeaders
(
nsACString
*
_retval
)
;
nsresult
GetResponseHeader
(
const
nsACString
*
header
,
nsACString
*
_retval
)
;
nsresult
Open
(
const
nsACString
*
method
,
const
nsACString
*
url
,
bool
async
,
const
nsAString
*
user
,
const
nsAString
*
password
,
uint8_t
_argc
)
;
nsresult
Send
(
nsIVariant
*
body
)
;
nsresult
SendAsBinary
(
const
nsAString
*
body
)
;
nsresult
SetRequestHeader
(
const
nsACString
*
header
,
const
nsACString
*
value
)
;
nsresult
GetTimeout
(
uint32_t
*
aTimeout
)
;
nsresult
SetTimeout
(
uint32_t
aTimeout
)
;
nsresult
GetReadyState
(
uint16_t
*
aReadyState
)
;
nsresult
SlowOverrideMimeType
(
const
nsAString
*
mimetype
)
;
nsresult
GetMozBackgroundRequest
(
bool
*
aMozBackgroundRequest
)
;
nsresult
SetMozBackgroundRequest
(
bool
aMozBackgroundRequest
)
;
nsresult
GetWithCredentials
(
bool
*
aWithCredentials
)
;
nsresult
SetWithCredentials
(
bool
aWithCredentials
)
;
nsresult
Init
(
nsIPrincipal
*
principal
,
nsIScriptContext
*
scriptContext
,
nsIGlobalObject
*
globalObject
,
nsIURI
*
baseURI
)
;
nsresult
GetUpload
(
nsIXMLHttpRequestUpload
**
aUpload
)
;
nsresult
GetOnreadystatechange
(
JSContext
*
cx
,
int
/*
JS
::
MutableHandleValue
*/
aOnreadystatechange
)
;
nsresult
SetOnreadystatechange
(
JSContext
*
cx
,
int
/*
JS
::
HandleValue
*/
aOnreadystatechange
)
;
nsresult
GetMozAnon
(
bool
*
aMozAnon
)
;
nsresult
GetMozSystem
(
bool
*
aMozSystem
)
;
}
[
object
,
uuid
(
f649959d
-
dae3
-
4027
-
83
fd
-
5b7
f8c8a8815
),
local
]
interface
nsIScriptSecurityManager
:
nsISupports
{
nsresult
CanCreateWrapper
(
JSContext
*
aJSContext
,
const
nsIID
*
aIID
,
nsISupports
*
aObj
,
nsIClassInfo
*
aClassInfo
)
;
nsresult
CanCreateInstance
(
JSContext
*
aJSContext
,
const
nsCID
*
aCID
)
;
nsresult
CanGetService
(
JSContext
*
aJSContext
,
const
nsCID
*
aCID
)
;
nsresult
CheckLoadURIFromScript
(
JSContext
*
cx
,
nsIURI
*
uri
)
;
nsresult
CheckLoadURIWithPrincipal
(
nsIPrincipal
*
aPrincipal
,
nsIURI
*
uri
,
uint32_t
flags
)
;
nsresult
CheckLoadURIStrWithPrincipal
(
nsIPrincipal
*
aPrincipal
,
const
nsACString
*
uri
,
uint32_t
flags
)
;
nsresult
ScriptAllowed
(
JSObject
*
aGlobal
)
;
nsresult
GetSystemPrincipal
(
nsIPrincipal
**
_retval
)
;
nsresult
GetSimpleCodebasePrincipal
(
nsIURI
*
aURI
,
nsIPrincipal
**
_retval
)
;
nsresult
GetAppCodebasePrincipal
(
nsIURI
*
uri
,
uint32_t
appId
,
bool
inMozBrowser
,
nsIPrincipal
**
_retval
)
;
nsresult
GetLoadContextCodebasePrincipal
(
nsIURI
*
uri
,
nsILoadContext
*
loadContext
,
nsIPrincipal
**
_retval
)
;
nsresult
GetDocShellCodebasePrincipal
(
nsIURI
*
uri
,
nsIDocShell
*
docShell
,
nsIPrincipal
**
_retval
)
;
nsresult
GetNoAppCodebasePrincipal
(
nsIURI
*
uri
,
nsIPrincipal
**
_retval
)
;
nsresult
GetCodebasePrincipal
(
nsIURI
*
uri
,
nsIPrincipal
**
_retval
)
;
nsresult
CheckSameOriginURI
(
nsIURI
*
aSourceURI
,
nsIURI
*
aTargetURI
,
bool
reportError
)
;
nsresult
GetChannelResultPrincipal
(
nsIChannel
*
aChannel
,
nsIPrincipal
**
_retval
)
;
nsresult
GetChannelURIPrincipal
(
nsIChannel
*
aChannel
,
nsIPrincipal
**
_retval
)
;
nsresult
IsSystemPrincipal
(
nsIPrincipal
*
aPrincipal
,
bool
*
_retval
)
;
nsresult
GetJarPrefix
(
uint32_t
appId
,
bool
inMozBrowser
,
nsACString
*
_retval
)
;
nsresult
ActivateDomainPolicy
(
nsIDomainPolicy
**
_retval
)
;
nsresult
GetDomainPolicyActive
(
bool
*
aDomainPolicyActive
)
;
nsresult
PolicyAllowsScript
(
nsIURI
*
aDomain
,
bool
*
_retval
)
;
}
cpp_quote
(
"DEFINE_GUID(IID_nsCycleCollectionISupports, 0xc61eac14,0x5f7a,0x4481,0x96,0x5e,0x7e,0xaa,0x6e,0xff,0xa8,0x5f);"
)
dlls/mshtml/xmlhttprequest.c
View file @
deb884a6
...
...
@@ -38,6 +38,7 @@ typedef struct {
EventTarget
event_target
;
IHTMLXMLHttpRequest
IHTMLXMLHttpRequest_iface
;
LONG
ref
;
nsIXMLHttpRequest
*
nsxhr
;
}
HTMLXMLHttpRequest
;
static
inline
HTMLXMLHttpRequest
*
impl_from_IHTMLXMLHttpRequest
(
IHTMLXMLHttpRequest
*
iface
)
...
...
@@ -88,6 +89,7 @@ static ULONG WINAPI HTMLXMLHttpRequest_Release(IHTMLXMLHttpRequest *iface)
if
(
!
ref
)
{
release_dispex
(
&
This
->
event_target
.
dispex
);
nsIXMLHttpRequest_Release
(
This
->
nsxhr
);
heap_free
(
This
);
}
...
...
@@ -378,12 +380,20 @@ static HRESULT WINAPI HTMLXMLHttpRequestFactory_create(IHTMLXMLHttpRequestFactor
{
HTMLXMLHttpRequestFactory
*
This
=
impl_from_IHTMLXMLHttpRequestFactory
(
iface
);
HTMLXMLHttpRequest
*
ret
;
nsIXMLHttpRequest
*
nsxhr
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
nsxhr
=
create_nsxhr
(
This
->
window
->
base
.
outer_window
->
nswindow
);
if
(
!
nsxhr
)
return
E_FAIL
;
ret
=
heap_alloc_zero
(
sizeof
(
*
ret
));
if
(
!
ret
)
if
(
!
ret
)
{
nsIXMLHttpRequest_Release
(
nsxhr
);
return
E_OUTOFMEMORY
;
}
ret
->
nsxhr
=
nsxhr
;
ret
->
IHTMLXMLHttpRequest_iface
.
lpVtbl
=
&
HTMLXMLHttpRequestVtbl
;
init_dispex
(
&
ret
->
event_target
.
dispex
,
(
IUnknown
*
)
&
ret
->
IHTMLXMLHttpRequest_iface
,
...
...
@@ -426,6 +436,7 @@ HRESULT HTMLXMLHttpRequestFactory_Create(HTMLInnerWindow* window, HTMLXMLHttpReq
ret
->
IHTMLXMLHttpRequestFactory_iface
.
lpVtbl
=
&
HTMLXMLHttpRequestFactoryVtbl
;
ret
->
ref
=
1
;
ret
->
window
=
window
;
init_dispex
(
&
ret
->
dispex
,
(
IUnknown
*
)
&
ret
->
IHTMLXMLHttpRequestFactory_iface
,
&
HTMLXMLHttpRequestFactory_dispex
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment