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
6b213042
Commit
6b213042
authored
Nov 02, 2007
by
Jacek Caban
Committed by
Alexandre Julliard
Nov 05, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: AsyncOpen code clean up.
parent
cd07f728
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
78 additions
and
54 deletions
+78
-54
nsio.c
dlls/mshtml/nsio.c
+78
-54
No files found.
dlls/mshtml/nsio.c
View file @
6b213042
...
...
@@ -629,67 +629,62 @@ static HRESULT create_mon_for_nschannel(nsChannel *channel, IMoniker **mon)
return
hres
;
}
static
nsresult
NSAPI
nsChannel_AsyncOpen
(
nsIHttpChannel
*
iface
,
nsIStreamListener
*
aListe
ner
,
nsISupports
*
aContext
)
static
nsresult
async_open_doc_uri
(
nsChannel
*
This
,
NSContainer
*
contai
ner
,
nsIStreamListener
*
listener
,
nsISupports
*
context
,
BOOL
*
open
)
{
nsChannel
*
This
=
NSCHANNEL_THIS
(
iface
);
BSCallback
*
bscallback
;
IMoniker
*
mon
=
NULL
;
PRBool
is_doc_uri
;
nsresult
nsres
;
task_t
*
task
;
IMoniker
*
mon
;
HRESULT
hres
;
TRACE
(
"(%p)->(%p %p)
\n
"
,
This
,
aListener
,
aContext
)
;
*
open
=
FALSE
;
nsIWineURI_GetIsDocumentURI
(
This
->
uri
,
&
is_doc_uri
);
if
(
container
->
bscallback
)
{
nsIChannel_AddRef
(
NSCHANNEL
(
This
));
container
->
bscallback
->
nschannel
=
This
;
if
(
is_doc_uri
&&
(
This
->
load_flags
&
LOAD_INITIAL_DOCUMENT_URI
))
{
NSContainer
*
contai
ner
;
nsIStreamListener_AddRef
(
listener
);
container
->
bscallback
->
nslistener
=
liste
ner
;
nsIWineURI_GetNSContainer
(
This
->
uri
,
&
container
);
if
(
!
container
)
{
TRACE
(
"container = NULL
\n
"
);
return
nsIChannel_AsyncOpen
(
This
->
channel
,
aListener
,
aContext
);
if
(
context
)
{
nsISupports_AddRef
(
context
);
container
->
bscallback
->
nscontext
=
context
;
}
if
(
container
->
bscallback
)
{
nsIChannel_AddRef
(
NSCHANNEL
(
This
));
container
->
bscallback
->
nschannel
=
This
;
nsIStreamListener_AddRef
(
aListener
);
container
->
bscallback
->
nslistener
=
aListener
;
if
(
aContext
)
{
nsISupports_AddRef
(
aContext
);
container
->
bscallback
->
nscontext
=
aContext
;
}
nsIWebBrowserChrome_Release
(
NSWBCHROME
(
container
));
if
(
do_load_from_moniker_hack
(
This
))
return
WINE_NS_LOAD_FROM_MONIKER
;
}
else
{
BOOL
cont
=
before_async_open
(
This
,
container
);
nsIWebBrowserChrome_Release
(
NSWBCHROME
(
container
));
if
(
do_load_from_moniker_hack
(
This
))
return
WINE_NS_LOAD_FROM_MONIKER
;
}
else
{
BOOL
cont
=
before_async_open
(
This
,
container
);
if
(
!
cont
)
{
TRACE
(
"canceled
\n
"
);
return
NS_ERROR_UNEXPECTED
;
}
if
(
!
cont
)
{
TRACE
(
"canceled
\n
"
);
return
NS_ERROR_UNEXPECTED
;
}
if
(
!
container
->
doc
)
return
This
->
channel
?
nsIChannel_AsyncOpen
(
This
->
channel
,
aListener
,
aContext
)
:
NS_ERROR_UNEXPECTED
;
if
(
!
container
->
doc
)
{
return
This
->
channel
?
nsIChannel_AsyncOpen
(
This
->
channel
,
listener
,
context
)
:
NS_ERROR_UNEXPECTED
;
}
hres
=
create_mon_for_nschannel
(
This
,
&
mon
);
if
(
FAILED
(
hres
))
return
NS_ERROR_UNEXPECTED
;
set_current_mon
(
container
->
doc
,
mon
);
hres
=
create_mon_for_nschannel
(
This
,
&
mon
);
if
(
FAILED
(
hres
))
{
return
NS_ERROR_UNEXPECTED
;
}
set_current_mon
(
container
->
doc
,
mon
);
}
*
open
=
TRUE
;
return
NS_OK
;
}
static
nsresult
async_open
(
nsChannel
*
This
,
NSContainer
*
container
,
nsIStreamListener
*
listener
,
nsISupports
*
context
)
{
BSCallback
*
bscallback
;
IMoniker
*
mon
=
NULL
;
nsresult
nsres
;
task_t
*
task
;
HRESULT
hres
;
if
(
This
->
channel
)
{
if
(
This
->
post_data_stream
)
{
nsIUploadChannel
*
upload_channel
;
...
...
@@ -710,7 +705,7 @@ static nsresult NSAPI nsChannel_AsyncOpen(nsIHttpChannel *iface, nsIStreamListen
}
}
nsres
=
nsIChannel_AsyncOpen
(
This
->
channel
,
aListener
,
aC
ontext
);
nsres
=
nsIChannel_AsyncOpen
(
This
->
channel
,
listener
,
c
ontext
);
if
(
mon
)
IMoniker_Release
(
mon
);
...
...
@@ -732,17 +727,17 @@ static nsresult NSAPI nsChannel_AsyncOpen(nsIHttpChannel *iface, nsIStreamListen
nsIChannel_AddRef
(
NSCHANNEL
(
This
));
bscallback
->
nschannel
=
This
;
nsIStreamListener_AddRef
(
aL
istener
);
bscallback
->
nslistener
=
aL
istener
;
nsIStreamListener_AddRef
(
l
istener
);
bscallback
->
nslistener
=
l
istener
;
if
(
aC
ontext
)
{
nsISupports_AddRef
(
aC
ontext
);
bscallback
->
nscontext
=
aC
ontext
;
if
(
c
ontext
)
{
nsISupports_AddRef
(
c
ontext
);
bscallback
->
nscontext
=
c
ontext
;
}
task
=
mshtml_alloc
(
sizeof
(
task_t
));
task
->
doc
=
bscallback
->
doc
;
task
->
doc
=
container
->
doc
;
task
->
task_id
=
TASK_START_BINDING
;
task
->
next
=
NULL
;
task
->
bscallback
=
bscallback
;
...
...
@@ -752,6 +747,35 @@ static nsresult NSAPI nsChannel_AsyncOpen(nsIHttpChannel *iface, nsIStreamListen
return
NS_OK
;
}
static
nsresult
NSAPI
nsChannel_AsyncOpen
(
nsIHttpChannel
*
iface
,
nsIStreamListener
*
aListener
,
nsISupports
*
aContext
)
{
nsChannel
*
This
=
NSCHANNEL_THIS
(
iface
);
NSContainer
*
container
;
PRBool
is_doc_uri
;
BOOL
open
=
TRUE
;
nsresult
nsres
=
NS_OK
;
TRACE
(
"(%p)->(%p %p)
\n
"
,
This
,
aListener
,
aContext
);
nsIWineURI_GetNSContainer
(
This
->
uri
,
&
container
);
if
(
!
container
)
{
TRACE
(
"container = NULL
\n
"
);
return
nsIChannel_AsyncOpen
(
This
->
channel
,
aListener
,
aContext
);
}
nsIWineURI_GetIsDocumentURI
(
This
->
uri
,
&
is_doc_uri
);
if
(
is_doc_uri
&&
(
This
->
load_flags
&
LOAD_INITIAL_DOCUMENT_URI
))
nsres
=
async_open_doc_uri
(
This
,
container
,
aListener
,
aContext
,
&
open
);
if
(
open
)
nsres
=
async_open
(
This
,
container
,
aListener
,
aContext
);
nsIWebBrowserChrome_Release
(
NSWBCHROME
(
container
));
return
nsres
;
}
static
nsresult
NSAPI
nsChannel_GetRequestMethod
(
nsIHttpChannel
*
iface
,
nsACString
*
aRequestMethod
)
{
nsChannel
*
This
=
NSCHANNEL_THIS
(
iface
);
...
...
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