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
3d4dbd3c
Commit
3d4dbd3c
authored
Aug 03, 2016
by
Jacek Caban
Committed by
Alexandre Julliard
Aug 03, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Use correct principal to create in create_nsxhr.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
0ff1b0c3
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
63 deletions
+37
-63
nsembed.c
dlls/mshtml/nsembed.c
+27
-27
nsiface.idl
dlls/mshtml/nsiface.idl
+10
-36
No files found.
dlls/mshtml/nsembed.c
View file @
3d4dbd3c
...
...
@@ -49,7 +49,6 @@ WINE_DECLARE_DEBUG_CHANNEL(gecko);
#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
...
...
@@ -2159,34 +2158,33 @@ void NSContainer_Release(NSContainer *This)
nsIWebBrowserChrome_Release
(
&
This
->
nsIWebBrowserChrome_iface
);
}
/*
* FIXME: nsIScriptObjectPrincipal uses thiscall calling convention, so we need this hack on i386.
* This will be removed after the next Gecko update, that will change calling convention on Gecko side.
*/
#ifdef __i386__
extern
void
*
call_thiscall_func
;
__ASM_GLOBAL_FUNC
(
call_thiscall_func
,
"popl %eax
\n\t
"
"popl %edx
\n\t
"
"popl %ecx
\n\t
"
"pushl %eax
\n\t
"
"jmp *%edx
\n\t
"
)
#define nsIScriptObjectPrincipal_GetPrincipal(this) ((void* (WINAPI*)(void*,void*))&call_thiscall_func)((this)->lpVtbl->GetPrincipal,this)
#endif
nsIXMLHttpRequest
*
create_nsxhr
(
nsIDOMWindow
*
nswindow
)
{
nsIScriptObjectPrincipal
*
sop
;
mozIDOMWindow
*
inner_window
;
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_GetInnerWindow
(
nswindow
,
&
inner_window
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"Could not get inner window: %08x
\n
"
,
nsres
);
nsISupports_Release
(
nspri
);
return
NULL
;
}
...
...
@@ -2194,24 +2192,26 @@ nsIXMLHttpRequest *create_nsxhr(nsIDOMWindow *nswindow)
mozIDOMWindow_Release
(
inner_window
);
assert
(
nsres
==
NS_OK
);
nsres
=
nsIGlobalObject_QueryInterface
(
nsglo
,
&
IID_nsIScriptObjectPrincipal
,
(
void
**
)
&
sop
);
assert
(
nsres
==
NS_OK
);
nspri
=
nsIScriptObjectPrincipal_GetPrincipal
(
sop
);
nsIScriptObjectPrincipal_Release
(
sop
);
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
;
}
if
(
NS_SUCCEEDED
(
nsres
))
{
nsres
=
nsIXMLHttpRequest_Init
(
nsxhr
,
nspri
,
NULL
,
nsglo
,
NULL
,
NULL
);
if
(
NS_FAILED
(
nsres
))
nsIXMLHttpRequest_Release
(
nsxhr
);
}
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 @
3d4dbd3c
...
...
@@ -4146,6 +4146,16 @@ interface nsIGlobalObject : nsISupports
[
object
,
uuid
(
3
eedba38
-
8
d22
-
41
e1
-
817
a
-
0
e43e165b664
),
local
]
interface
nsIScriptObjectPrincipal
:
nsISupports
{
nsIPrincipal
*
/*
thiscall
*/
GetPrincipal
()
;
}
[
object
,
uuid
(
6
f54214c
-
7175
-498d-9
d2d
-
0429
e38c2869
),
local
]
...
...
@@ -4181,40 +4191,4 @@ interface nsIXMLHttpRequest : nsISupports
nsresult
GetMozSystem
(
bool
*
aMozSystem
)
;
}
[
object
,
uuid
(
b7ae2310
-576e-11
e5
-
a837
-
0800200
c9a66
),
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
)
;
bool
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
CreateCodebasePrincipal
(
nsIURI
*
uri
,
int
/*
JS
::
HandleValue
*/
originAttributes
,
JSContext
*
cx
,
nsIPrincipal
**
_retval
)
;
nsresult
CreateCodebasePrincipalFromOrigin
(
const
nsACString
*
origin
,
nsIPrincipal
**
_retval
)
;
nsresult
CreateNullPrincipal
(
int
/*
JS
::
HandleValue
*/
originAttributes
,
JSContext
*
cx
,
nsIPrincipal
**
_retval
)
;
nsresult
CreateExpandedPrincipal
(
nsIPrincipal
**
aPrincipalArray
,
uint32_t
aLength
,
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
ActivateDomainPolicyInternal
(
nsIDomainPolicy
**
_retval
)
;
void
CloneDomainPolicy
(
int
/*
mozilla
::
dom
::
DomainPolicyClone
*/
*
aClone
)
;
nsresult
PolicyAllowsScript
(
nsIURI
*
aDomain
,
bool
*
_retval
)
;
}
cpp_quote
(
"DEFINE_GUID(IID_nsCycleCollectionISupports, 0xc61eac14,0x5f7a,0x4481,0x96,0x5e,0x7e,0xaa,0x6e,0xff,0xa8,0x5f);"
)
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