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
f24be9fa
Commit
f24be9fa
authored
Apr 15, 2011
by
Jacek Caban
Committed by
Alexandre Julliard
Apr 18, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Moved nsChannel initialization to separated function.
parent
84d50f73
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
21 deletions
+36
-21
nsio.c
dlls/mshtml/nsio.c
+36
-21
No files found.
dlls/mshtml/nsio.c
View file @
f24be9fa
...
...
@@ -2532,6 +2532,37 @@ HRESULT create_doc_uri(HTMLWindow *window, WCHAR *url, nsWineURI **ret)
return
S_OK
;
}
static
nsresult
create_nschannel
(
nsWineURI
*
uri
,
nsChannel
**
ret
)
{
nsChannel
*
channel
;
HRESULT
hres
;
if
(
!
ensure_uri
(
uri
))
return
NS_ERROR_UNEXPECTED
;
channel
=
heap_alloc_zero
(
sizeof
(
nsChannel
));
if
(
!
channel
)
return
NS_ERROR_OUT_OF_MEMORY
;
channel
->
nsIHttpChannel_iface
.
lpVtbl
=
&
nsChannelVtbl
;
channel
->
nsIUploadChannel_iface
.
lpVtbl
=
&
nsUploadChannelVtbl
;
channel
->
nsIHttpChannelInternal_iface
.
lpVtbl
=
&
nsHttpChannelInternalVtbl
;
channel
->
ref
=
1
;
channel
->
request_method
=
METHOD_GET
;
list_init
(
&
channel
->
response_headers
);
list_init
(
&
channel
->
request_headers
);
nsIURL_AddRef
(
&
uri
->
nsIURL_iface
);
channel
->
uri
=
uri
;
hres
=
IUri_GetScheme
(
uri
->
uri
,
&
channel
->
url_scheme
);
if
(
FAILED
(
hres
))
channel
->
url_scheme
=
URL_SCHEME_UNKNOWN
;
*
ret
=
channel
;
return
NS_OK
;
}
typedef
struct
{
nsIProtocolHandler
nsIProtocolHandler_iface
;
...
...
@@ -2839,10 +2870,9 @@ static nsresult NSAPI nsIOService_NewFileURI(nsIIOService *iface, nsIFile *aFile
static
nsresult
NSAPI
nsIOService_NewChannelFromURI
(
nsIIOService
*
iface
,
nsIURI
*
aURI
,
nsIChannel
**
_retval
)
{
nsChannel
*
ret
;
nsWineURI
*
wine_uri
;
nsChannel
*
ret
;
nsresult
nsres
;
HRESULT
hres
;
TRACE
(
"(%p %p)
\n
"
,
aURI
,
_retval
);
...
...
@@ -2852,29 +2882,14 @@ static nsresult NSAPI nsIOService_NewChannelFromURI(nsIIOService *iface, nsIURI
return
nsIIOService_NewChannelFromURI
(
nsio
,
aURI
,
_retval
);
}
if
(
!
ensure_uri
(
wine_uri
))
{
nsIURI_Release
(
&
wine_uri
->
nsIURL_iface
);
return
NS_ERROR_UNEXPECTED
;
}
ret
=
heap_alloc_zero
(
sizeof
(
nsChannel
));
ret
->
nsIHttpChannel_iface
.
lpVtbl
=
&
nsChannelVtbl
;
ret
->
nsIUploadChannel_iface
.
lpVtbl
=
&
nsUploadChannelVtbl
;
ret
->
nsIHttpChannelInternal_iface
.
lpVtbl
=
&
nsHttpChannelInternalVtbl
;
ret
->
ref
=
1
;
ret
->
uri
=
wine_uri
;
ret
->
request_method
=
METHOD_GET
;
list_init
(
&
ret
->
response_headers
);
list_init
(
&
ret
->
request_headers
);
nsres
=
create_nschannel
(
wine_uri
,
&
ret
);
nsIURL_Release
(
&
wine_uri
->
nsIURL_iface
);
if
(
NS_FAILED
(
nsres
))
return
nsres
;
nsIURI_AddRef
(
aURI
);
ret
->
original_uri
=
aURI
;
hres
=
IUri_GetScheme
(
wine_uri
->
uri
,
&
ret
->
url_scheme
);
if
(
FAILED
(
hres
))
ret
->
url_scheme
=
URL_SCHEME_UNKNOWN
;
*
_retval
=
(
nsIChannel
*
)
&
ret
->
nsIHttpChannel_iface
;
return
NS_OK
;
}
...
...
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