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
8abf7a8c
Commit
8abf7a8c
authored
Mar 26, 2008
by
Jacek Caban
Committed by
Alexandre Julliard
Mar 26, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Rename nsChannel::content to content_type and clean up its handling.
parent
1caf73be
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
31 deletions
+40
-31
mshtml_private.h
dlls/mshtml/mshtml_private.h
+29
-1
navigate.c
dlls/mshtml/navigate.c
+5
-12
nsio.c
dlls/mshtml/nsio.c
+6
-18
No files found.
dlls/mshtml/mshtml_private.h
View file @
8abf7a8c
...
@@ -241,7 +241,7 @@ typedef struct {
...
@@ -241,7 +241,7 @@ typedef struct {
nsIInterfaceRequestor
*
notif_callback
;
nsIInterfaceRequestor
*
notif_callback
;
nsLoadFlags
load_flags
;
nsLoadFlags
load_flags
;
nsIURI
*
original_uri
;
nsIURI
*
original_uri
;
char
*
content
;
char
*
content
_type
;
char
*
charset
;
char
*
charset
;
}
nsChannel
;
}
nsChannel
;
...
@@ -568,6 +568,21 @@ static inline LPWSTR heap_strdupW(LPCWSTR str)
...
@@ -568,6 +568,21 @@ static inline LPWSTR heap_strdupW(LPCWSTR str)
return
ret
;
return
ret
;
}
}
static
inline
char
*
heap_strdupA
(
const
char
*
str
)
{
char
*
ret
=
NULL
;
if
(
str
)
{
DWORD
size
;
size
=
strlen
(
str
)
+
1
;
ret
=
heap_alloc
(
size
);
memcpy
(
ret
,
str
,
size
);
}
return
ret
;
}
static
inline
WCHAR
*
heap_strdupAtoW
(
const
char
*
str
)
static
inline
WCHAR
*
heap_strdupAtoW
(
const
char
*
str
)
{
{
LPWSTR
ret
=
NULL
;
LPWSTR
ret
=
NULL
;
...
@@ -583,6 +598,19 @@ static inline WCHAR *heap_strdupAtoW(const char *str)
...
@@ -583,6 +598,19 @@ static inline WCHAR *heap_strdupAtoW(const char *str)
return
ret
;
return
ret
;
}
}
static
inline
char
*
heap_strdupWtoA
(
LPCWSTR
str
)
{
char
*
ret
=
NULL
;
if
(
str
)
{
DWORD
size
=
WideCharToMultiByte
(
CP_ACP
,
0
,
str
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
ret
=
heap_alloc
(
size
);
WideCharToMultiByte
(
CP_ACP
,
0
,
str
,
-
1
,
ret
,
size
,
NULL
,
NULL
);
}
return
ret
;
}
HINSTANCE
get_shdoclc
(
void
);
HINSTANCE
get_shdoclc
(
void
);
extern
HINSTANCE
hInst
;
extern
HINSTANCE
hInst
;
dlls/mshtml/navigate.c
View file @
8abf7a8c
...
@@ -884,17 +884,12 @@ static HRESULT nsChannelBSC_on_progress(BSCallback *bsc, ULONG status_code, LPCW
...
@@ -884,17 +884,12 @@ static HRESULT nsChannelBSC_on_progress(BSCallback *bsc, ULONG status_code, LPCW
nsChannelBSC
*
This
=
NSCHANNELBSC_THIS
(
bsc
);
nsChannelBSC
*
This
=
NSCHANNELBSC_THIS
(
bsc
);
switch
(
status_code
)
{
switch
(
status_code
)
{
case
BINDSTATUS_MIMETYPEAVAILABLE
:
{
case
BINDSTATUS_MIMETYPEAVAILABLE
:
int
len
;
if
(
!
This
->
nschannel
)
if
(
!
This
->
nschannel
)
return
S_OK
;
return
S_OK
;
heap_free
(
This
->
nschannel
->
content
);
len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
status_text
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
heap_free
(
This
->
nschannel
->
content_type
);
This
->
nschannel
->
content
=
heap_alloc
(
len
*
sizeof
(
WCHAR
));
This
->
nschannel
->
content_type
=
heap_strdupWtoA
(
status_text
);
WideCharToMultiByte
(
CP_ACP
,
0
,
status_text
,
-
1
,
This
->
nschannel
->
content
,
-
1
,
NULL
,
NULL
);
}
}
}
return
S_OK
;
return
S_OK
;
...
@@ -958,10 +953,8 @@ HRESULT channelbsc_load_stream(nsChannelBSC *bscallback, IStream *stream)
...
@@ -958,10 +953,8 @@ HRESULT channelbsc_load_stream(nsChannelBSC *bscallback, IStream *stream)
add_nsrequest
(
bscallback
);
add_nsrequest
(
bscallback
);
if
(
bscallback
->
nschannel
)
{
if
(
bscallback
->
nschannel
)
bscallback
->
nschannel
->
content
=
heap_alloc
(
sizeof
(
text_html
));
bscallback
->
nschannel
->
content_type
=
heap_strdupA
(
text_html
);
memcpy
(
bscallback
->
nschannel
->
content
,
text_html
,
sizeof
(
text_html
));
}
hres
=
read_stream_data
(
bscallback
,
stream
);
hres
=
read_stream_data
(
bscallback
,
stream
);
IBindStatusCallback_OnStopBinding
(
STATUSCLB
(
&
bscallback
->
bsc
),
hres
,
ERROR_SUCCESS
);
IBindStatusCallback_OnStopBinding
(
STATUSCLB
(
&
bscallback
->
bsc
),
hres
,
ERROR_SUCCESS
);
...
...
dlls/mshtml/nsio.c
View file @
8abf7a8c
...
@@ -209,7 +209,7 @@ static nsrefcnt NSAPI nsChannel_Release(nsIHttpChannel *iface)
...
@@ -209,7 +209,7 @@ static nsrefcnt NSAPI nsChannel_Release(nsIHttpChannel *iface)
nsIInterfaceRequestor_Release
(
This
->
notif_callback
);
nsIInterfaceRequestor_Release
(
This
->
notif_callback
);
if
(
This
->
original_uri
)
if
(
This
->
original_uri
)
nsIURI_Release
(
This
->
original_uri
);
nsIURI_Release
(
This
->
original_uri
);
heap_free
(
This
->
content
);
heap_free
(
This
->
content
_type
);
heap_free
(
This
->
charset
);
heap_free
(
This
->
charset
);
heap_free
(
This
);
heap_free
(
This
);
}
}
...
@@ -468,8 +468,8 @@ static nsresult NSAPI nsChannel_GetContentType(nsIHttpChannel *iface, nsACString
...
@@ -468,8 +468,8 @@ static nsresult NSAPI nsChannel_GetContentType(nsIHttpChannel *iface, nsACString
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
aContentType
);
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
aContentType
);
if
(
This
->
content
)
{
if
(
This
->
content
_type
)
{
nsACString_SetData
(
aContentType
,
This
->
content
);
nsACString_SetData
(
aContentType
,
This
->
content
_type
);
return
S_OK
;
return
S_OK
;
}
}
...
@@ -688,13 +688,8 @@ static nsresult async_open_doc_uri(nsChannel *This, NSContainer *container,
...
@@ -688,13 +688,8 @@ static nsresult async_open_doc_uri(nsChannel *This, NSContainer *container,
channelbsc_set_channel
(
container
->
bscallback
,
This
,
listener
,
context
);
channelbsc_set_channel
(
container
->
bscallback
,
This
,
listener
,
context
);
if
(
container
->
doc
&&
container
->
doc
->
mime
)
{
if
(
container
->
doc
&&
container
->
doc
->
mime
)
{
DWORD
len
;
heap_free
(
This
->
content_type
);
This
->
content_type
=
heap_strdupWtoA
(
container
->
doc
->
mime
);
heap_free
(
This
->
content
);
len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
container
->
doc
->
mime
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
This
->
content
=
heap_alloc
(
len
);
WideCharToMultiByte
(
CP_ACP
,
0
,
container
->
doc
->
mime
,
-
1
,
This
->
content
,
-
1
,
NULL
,
NULL
);
}
}
if
(
do_load_from_moniker_hack
(
This
))
if
(
do_load_from_moniker_hack
(
This
))
...
@@ -2155,20 +2150,13 @@ static nsresult NSAPI nsIOService_NewChannelFromURI(nsIIOService *iface, nsIURI
...
@@ -2155,20 +2150,13 @@ static nsresult NSAPI nsIOService_NewChannelFromURI(nsIIOService *iface, nsIURI
return
channel
?
NS_OK
:
NS_ERROR_UNEXPECTED
;
return
channel
?
NS_OK
:
NS_ERROR_UNEXPECTED
;
}
}
ret
=
heap_alloc
(
sizeof
(
nsChannel
));
ret
=
heap_alloc
_zero
(
sizeof
(
nsChannel
));
ret
->
lpHttpChannelVtbl
=
&
nsChannelVtbl
;
ret
->
lpHttpChannelVtbl
=
&
nsChannelVtbl
;
ret
->
lpUploadChannelVtbl
=
&
nsUploadChannelVtbl
;
ret
->
lpUploadChannelVtbl
=
&
nsUploadChannelVtbl
;
ret
->
ref
=
1
;
ret
->
ref
=
1
;
ret
->
channel
=
channel
;
ret
->
channel
=
channel
;
ret
->
http_channel
=
NULL
;
ret
->
uri
=
wine_uri
;
ret
->
uri
=
wine_uri
;
ret
->
post_data_stream
=
NULL
;
ret
->
load_group
=
NULL
;
ret
->
notif_callback
=
NULL
;
ret
->
load_flags
=
0
;
ret
->
content
=
NULL
;
ret
->
charset
=
NULL
;
nsIURI_AddRef
(
aURI
);
nsIURI_AddRef
(
aURI
);
ret
->
original_uri
=
aURI
;
ret
->
original_uri
=
aURI
;
...
...
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