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
bdf2bf93
Commit
bdf2bf93
authored
Feb 13, 2007
by
Jacek Caban
Committed by
Alexandre Julliard
Feb 14, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Make load_gecko thread safe.
parent
92f67574
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
20 deletions
+48
-20
install.c
dlls/mshtml/install.c
+3
-1
mshtml_private.h
dlls/mshtml/mshtml_private.h
+1
-1
nsembed.c
dlls/mshtml/nsembed.c
+44
-18
No files found.
dlls/mshtml/install.c
View file @
bdf2bf93
...
...
@@ -358,7 +358,7 @@ static INT_PTR CALLBACK installer_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARA
return
FALSE
;
}
void
install_wine_gecko
(
void
)
BOOL
install_wine_gecko
(
void
)
{
HANDLE
hsem
;
...
...
@@ -374,4 +374,6 @@ void install_wine_gecko(void)
ReleaseSemaphore
(
hsem
,
1
,
NULL
);
CloseHandle
(
hsem
);
return
TRUE
;
}
dlls/mshtml/mshtml_private.h
View file @
bdf2bf93
...
...
@@ -370,7 +370,7 @@ HRESULT HTMLElement_QI(HTMLElement*,REFIID,void**);
HTMLDOMNode
*
get_node
(
HTMLDocument
*
,
nsIDOMNode
*
);
void
release_nodes
(
HTMLDocument
*
);
void
install_wine_gecko
(
void
);
BOOL
install_wine_gecko
(
void
);
/* editor */
void
handle_edit_event
(
HTMLDocument
*
,
nsIDOMEvent
*
);
...
...
dlls/mshtml/nsembed.c
View file @
bdf2bf93
...
...
@@ -321,30 +321,13 @@ static void set_profile(void)
nsIProfile_Release
(
profile
);
}
static
BOOL
load_gecko
(
void
)
static
BOOL
init_xpcom
(
PRUnichar
*
gre_path
)
{
nsresult
nsres
;
nsIObserver
*
pStartNotif
;
nsIComponentRegistrar
*
registrar
=
NULL
;
nsAString
path
;
nsIFile
*
gre_dir
;
PRUnichar
gre_path
[
MAX_PATH
];
static
BOOL
tried_load
=
FALSE
;
TRACE
(
"()
\n
"
);
if
(
tried_load
)
return
pCompMgr
!=
NULL
;
tried_load
=
TRUE
;
if
(
!
load_wine_gecko
(
gre_path
)
&&
!
load_mozctl
(
gre_path
)
&&
!
load_mozilla
(
gre_path
))
{
install_wine_gecko
();
if
(
!
load_wine_gecko
(
gre_path
))
{
MESSAGE
(
"Could not load Mozilla. HTML rendering will be disabled.
\n
"
);
return
FALSE
;
}
}
nsAString_Init
(
&
path
,
gre_path
);
nsres
=
NS_NewLocalFile
(
&
path
,
FALSE
,
&
gre_dir
);
...
...
@@ -408,6 +391,49 @@ static BOOL load_gecko(void)
return
TRUE
;
}
static
CRITICAL_SECTION
cs_load_gecko
;
static
CRITICAL_SECTION_DEBUG
cs_load_gecko_dbg
=
{
0
,
0
,
&
cs_load_gecko
,
{
&
cs_load_gecko_dbg
.
ProcessLocksList
,
&
cs_load_gecko_dbg
.
ProcessLocksList
},
0
,
0
,
{
(
DWORD_PTR
)(
__FILE__
": load_gecko"
)
}
};
static
CRITICAL_SECTION
cs_load_gecko
=
{
&
cs_load_gecko_dbg
,
-
1
,
0
,
0
,
0
,
0
};
static
BOOL
load_gecko
(
void
)
{
PRUnichar
gre_path
[
MAX_PATH
];
BOOL
ret
=
FALSE
;
static
LONG
loading_thread
;
TRACE
(
"()
\n
"
);
/* load_gecko may be called recursively */
if
(
loading_thread
==
GetCurrentThreadId
())
return
pCompMgr
!=
NULL
;
EnterCriticalSection
(
&
cs_load_gecko
);
if
(
!
loading_thread
)
{
loading_thread
=
GetCurrentThreadId
();
if
(
load_wine_gecko
(
gre_path
)
||
load_mozctl
(
gre_path
)
||
load_mozilla
(
gre_path
)
||
(
install_wine_gecko
()
&&
load_wine_gecko
(
gre_path
)))
ret
=
init_xpcom
(
gre_path
);
else
MESSAGE
(
"Could not load Mozilla. HTML rendering will be disabled.
\n
"
);
}
else
{
ret
=
pCompMgr
!=
NULL
;
}
LeaveCriticalSection
(
&
cs_load_gecko
);
return
ret
;
}
void
*
nsalloc
(
size_t
size
)
{
return
nsIMemory_Alloc
(
nsmem
,
size
);
...
...
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