Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
17dc0be9
Commit
17dc0be9
authored
Aug 22, 2023
by
Gabriel Ivăncescu
Committed by
Alexandre Julliard
Aug 22, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Implement Cycle Collection for MutationObserver.
Signed-off-by:
Gabriel Ivăncescu
<
gabrielopcode@gmail.com
>
parent
de720483
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
8 deletions
+11
-8
mutation.c
dlls/mshtml/mutation.c
+11
-8
No files found.
dlls/mshtml/mutation.c
View file @
17dc0be9
...
...
@@ -1080,7 +1080,6 @@ void init_mutation(nsIComponentManager *component_manager)
struct
mutation_observer
{
IWineMSHTMLMutationObserver
IWineMSHTMLMutationObserver_iface
;
LONG
ref
;
DispatchEx
dispex
;
IDispatch
*
callback
;
};
...
...
@@ -1098,7 +1097,7 @@ static HRESULT WINAPI MutationObserver_QueryInterface(IWineMSHTMLMutationObserve
if
(
IsEqualGUID
(
&
IID_IUnknown
,
riid
)
||
IsEqualGUID
(
&
IID_IWineMSHTMLMutationObserver
,
riid
))
{
*
ppv
=
&
This
->
IWineMSHTMLMutationObserver_iface
;
}
else
if
(
dispex_query_interface
_no_cc
(
&
This
->
dispex
,
riid
,
ppv
))
{
}
else
if
(
dispex_query_interface
(
&
This
->
dispex
,
riid
,
ppv
))
{
return
*
ppv
?
S_OK
:
E_NOINTERFACE
;
}
else
{
WARN
(
"(%p)->(%s %p)
\n
"
,
This
,
debugstr_mshtml_guid
(
riid
),
ppv
);
...
...
@@ -1113,7 +1112,7 @@ static HRESULT WINAPI MutationObserver_QueryInterface(IWineMSHTMLMutationObserve
static
ULONG
WINAPI
MutationObserver_AddRef
(
IWineMSHTMLMutationObserver
*
iface
)
{
struct
mutation_observer
*
This
=
impl_from_IWineMSHTMLMutationObserver
(
iface
);
LONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
LONG
ref
=
dispex_ref_incr
(
&
This
->
dispex
);
TRACE
(
"(%p) ref=%ld
\n
"
,
This
,
ref
);
...
...
@@ -1123,13 +1122,10 @@ static ULONG WINAPI MutationObserver_AddRef(IWineMSHTMLMutationObserver *iface)
static
ULONG
WINAPI
MutationObserver_Release
(
IWineMSHTMLMutationObserver
*
iface
)
{
struct
mutation_observer
*
This
=
impl_from_IWineMSHTMLMutationObserver
(
iface
);
LONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
LONG
ref
=
dispex_ref_decr
(
&
This
->
dispex
);
TRACE
(
"(%p) ref=%ld
\n
"
,
This
,
ref
);
if
(
!
ref
)
release_dispex
(
&
This
->
dispex
);
return
ref
;
}
...
...
@@ -1215,6 +1211,13 @@ static inline struct mutation_observer *mutation_observer_from_DispatchEx(Dispat
return
CONTAINING_RECORD
(
iface
,
struct
mutation_observer
,
dispex
);
}
static
void
mutation_observer_traverse
(
DispatchEx
*
dispex
,
nsCycleCollectionTraversalCallback
*
cb
)
{
struct
mutation_observer
*
This
=
mutation_observer_from_DispatchEx
(
dispex
);
if
(
This
->
callback
)
note_cc_edge
((
nsISupports
*
)
This
->
callback
,
"callback"
,
cb
);
}
static
void
mutation_observer_unlink
(
DispatchEx
*
dispex
)
{
struct
mutation_observer
*
This
=
mutation_observer_from_DispatchEx
(
dispex
);
...
...
@@ -1229,6 +1232,7 @@ static void mutation_observer_destructor(DispatchEx *dispex)
static
const
dispex_static_data_vtbl_t
mutation_observer_dispex_vtbl
=
{
.
destructor
=
mutation_observer_destructor
,
.
traverse
=
mutation_observer_traverse
,
.
unlink
=
mutation_observer_unlink
};
...
...
@@ -1258,7 +1262,6 @@ static HRESULT create_mutation_observer(compat_mode_t compat_mode, IDispatch *ca
}
obj
->
IWineMSHTMLMutationObserver_iface
.
lpVtbl
=
&
WineMSHTMLMutationObserverVtbl
;
obj
->
ref
=
1
;
init_dispatch
(
&
obj
->
dispex
,
(
IUnknown
*
)
&
obj
->
IWineMSHTMLMutationObserver_iface
,
&
mutation_observer_dispex
,
compat_mode
);
...
...
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