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
9679755a
Commit
9679755a
authored
Sep 12, 2016
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 14, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Use rb tree instead of list to map nsIDOMWindowProxy to HTMLOuterWindow.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
d29e59a1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
20 deletions
+23
-20
htmlwindow.c
dlls/mshtml/htmlwindow.c
+21
-19
mshtml_private.h
dlls/mshtml/mshtml_private.h
+2
-1
No files found.
dlls/mshtml/htmlwindow.c
View file @
9679755a
...
...
@@ -44,7 +44,22 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
mshtml
);
static
struct
list
window_list
=
LIST_INIT
(
window_list
);
static
int
window_map_compare
(
const
void
*
key
,
const
struct
wine_rb_entry
*
entry
)
{
HTMLOuterWindow
*
window
=
WINE_RB_ENTRY_VALUE
(
entry
,
HTMLOuterWindow
,
entry
);
if
(
window
->
window_proxy
==
key
)
return
0
;
return
(
void
*
)
window
->
window_proxy
>
key
?
-
1
:
1
;
}
static
struct
wine_rb_tree
window_map
=
{
window_map_compare
};
HTMLOuterWindow
*
mozwindow_to_window
(
const
mozIDOMWindowProxy
*
mozwindow
)
{
struct
wine_rb_entry
*
entry
=
wine_rb_get
(
&
window_map
,
mozwindow
);
return
entry
?
WINE_RB_ENTRY_VALUE
(
entry
,
HTMLOuterWindow
,
entry
)
:
NULL
;
}
static
inline
BOOL
is_outer_window
(
HTMLWindow
*
window
)
{
...
...
@@ -220,7 +235,7 @@ static void release_outer_window(HTMLOuterWindow *This)
if
(
This
->
window_proxy
)
mozIDOMWindowProxy_Release
(
This
->
window_proxy
);
list_remove
(
&
This
->
entry
);
wine_rb_remove
(
&
window_map
,
&
This
->
entry
);
heap_free
(
This
);
}
...
...
@@ -3052,6 +3067,10 @@ HRESULT HTMLOuterWindow_Create(HTMLDocumentObj *doc_obj, nsIDOMWindow *nswindow,
window
->
scriptmode
=
parent
?
parent
->
scriptmode
:
SCRIPTMODE_GECKO
;
window
->
readystate
=
READYSTATE_UNINITIALIZED
;
window
->
task_magic
=
get_task_target_magic
();
list_init
(
&
window
->
children
);
wine_rb_put
(
&
window_map
,
window
->
window_proxy
,
&
window
->
entry
);
hres
=
create_pending_window
(
window
,
NULL
);
if
(
SUCCEEDED
(
hres
))
...
...
@@ -3067,11 +3086,6 @@ HRESULT HTMLOuterWindow_Create(HTMLDocumentObj *doc_obj, nsIDOMWindow *nswindow,
return
hres
;
}
window
->
task_magic
=
get_task_target_magic
();
list_init
(
&
window
->
children
);
list_add_head
(
&
window_list
,
&
window
->
entry
);
if
(
parent
)
{
IHTMLWindow2_AddRef
(
&
window
->
base
.
IHTMLWindow2_iface
);
...
...
@@ -3174,15 +3188,3 @@ HRESULT update_window_doc(HTMLInnerWindow *window)
return
hres
;
}
HTMLOuterWindow
*
mozwindow_to_window
(
const
mozIDOMWindowProxy
*
mozwindow
)
{
HTMLOuterWindow
*
iter
;
LIST_FOR_EACH_ENTRY
(
iter
,
&
window_list
,
HTMLOuterWindow
,
entry
)
{
if
(
iter
->
window_proxy
==
mozwindow
)
return
iter
;
}
return
NULL
;
}
dlls/mshtml/mshtml_private.h
View file @
9679755a
...
...
@@ -31,6 +31,7 @@
#include "shdeprecated.h"
#include "wine/list.h"
#include "wine/rbtree.h"
#include "wine/unicode.h"
#ifdef INIT_GUID
...
...
@@ -466,7 +467,7 @@ struct HTMLOuterWindow {
struct
list
children
;
struct
list
sibling_entry
;
struct
list
entry
;
struct
wine_rb_entry
entry
;
};
struct
HTMLInnerWindow
{
...
...
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