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
61121cef
Commit
61121cef
authored
Feb 21, 2010
by
Jacek Caban
Committed by
Alexandre Julliard
Feb 22, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Moved OnStartURIOpen implementation to nsio.c.
parent
d95a54aa
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
45 deletions
+54
-45
mshtml_private.h
dlls/mshtml/mshtml_private.h
+1
-0
nsembed.c
dlls/mshtml/nsembed.c
+3
-45
nsio.c
dlls/mshtml/nsio.c
+50
-0
No files found.
dlls/mshtml/mshtml_private.h
View file @
61121cef
...
@@ -437,6 +437,7 @@ struct NSContainer {
...
@@ -437,6 +437,7 @@ struct NSContainer {
typedef
struct
nsWineURI
nsWineURI
;
typedef
struct
nsWineURI
nsWineURI
;
HRESULT
set_wine_url
(
nsWineURI
*
,
LPCWSTR
);
HRESULT
set_wine_url
(
nsWineURI
*
,
LPCWSTR
);
nsresult
on_start_uri_open
(
NSContainer
*
,
nsIURI
*
,
PRBool
*
);
typedef
struct
{
typedef
struct
{
const
nsIHttpChannelVtbl
*
lpHttpChannelVtbl
;
const
nsIHttpChannelVtbl
*
lpHttpChannelVtbl
;
...
...
dlls/mshtml/nsembed.c
View file @
61121cef
...
@@ -1124,41 +1124,12 @@ static nsrefcnt NSAPI nsURIContentListener_Release(nsIURIContentListener *iface)
...
@@ -1124,41 +1124,12 @@ static nsrefcnt NSAPI nsURIContentListener_Release(nsIURIContentListener *iface)
return
nsIWebBrowserChrome_Release
(
NSWBCHROME
(
This
));
return
nsIWebBrowserChrome_Release
(
NSWBCHROME
(
This
));
}
}
static
BOOL
translate_url
(
HTMLDocumentObj
*
doc
,
nsIWineURI
*
nsuri
)
{
OLECHAR
*
new_url
=
NULL
,
*
url
;
BOOL
ret
=
FALSE
;
LPCWSTR
wine_url
;
HRESULT
hres
;
if
(
!
doc
->
hostui
)
return
FALSE
;
nsIWineURI_GetWineURL
(
nsuri
,
&
wine_url
);
url
=
heap_strdupW
(
wine_url
);
hres
=
IDocHostUIHandler_TranslateUrl
(
doc
->
hostui
,
0
,
url
,
&
new_url
);
heap_free
(
url
);
if
(
hres
!=
S_OK
||
!
new_url
)
return
FALSE
;
if
(
strcmpW
(
url
,
new_url
))
{
FIXME
(
"TranslateUrl returned new URL %s -> %s
\n
"
,
debugstr_w
(
url
),
debugstr_w
(
new_url
));
ret
=
TRUE
;
}
CoTaskMemFree
(
new_url
);
return
ret
;
}
static
nsresult
NSAPI
nsURIContentListener_OnStartURIOpen
(
nsIURIContentListener
*
iface
,
static
nsresult
NSAPI
nsURIContentListener_OnStartURIOpen
(
nsIURIContentListener
*
iface
,
nsIURI
*
aURI
,
PRBool
*
_retval
)
nsIURI
*
aURI
,
PRBool
*
_retval
)
{
{
NSContainer
*
This
=
NSURICL_THIS
(
iface
);
NSContainer
*
This
=
NSURICL_THIS
(
iface
);
nsIWineURI
*
wine_uri
;
nsACString
spec_str
;
nsACString
spec_str
;
const
char
*
spec
;
const
char
*
spec
;
BOOL
is_doc_uri
;
nsresult
nsres
;
nsresult
nsres
;
nsACString_Init
(
&
spec_str
,
NULL
);
nsACString_Init
(
&
spec_str
,
NULL
);
...
@@ -1169,22 +1140,9 @@ static nsresult NSAPI nsURIContentListener_OnStartURIOpen(nsIURIContentListener
...
@@ -1169,22 +1140,9 @@ static nsresult NSAPI nsURIContentListener_OnStartURIOpen(nsIURIContentListener
nsACString_Finish
(
&
spec_str
);
nsACString_Finish
(
&
spec_str
);
nsres
=
nsIURI_QueryInterface
(
aURI
,
&
IID_nsIWineURI
,
(
void
**
)
&
wine_uri
);
nsres
=
on_start_uri_open
(
This
,
aURI
,
_retval
);
if
(
NS_FAILED
(
nsres
))
{
if
(
NS_FAILED
(
nsres
))
WARN
(
"Could not get nsIWineURI interface: %08x
\n
"
,
nsres
);
return
nsres
;
return
NS_ERROR_NOT_IMPLEMENTED
;
}
nsIWineURI_GetIsDocumentURI
(
wine_uri
,
&
is_doc_uri
);
if
(
!
is_doc_uri
)
{
nsIWineURI_SetNSContainer
(
wine_uri
,
This
);
nsIWineURI_SetIsDocumentURI
(
wine_uri
,
TRUE
);
*
_retval
=
translate_url
(
This
->
doc
->
basedoc
.
doc_obj
,
wine_uri
);
}
nsIWineURI_Release
(
wine_uri
);
return
!*
_retval
&&
This
->
content_listener
return
!*
_retval
&&
This
->
content_listener
?
nsIURIContentListener_OnStartURIOpen
(
This
->
content_listener
,
aURI
,
_retval
)
?
nsIURIContentListener_OnStartURIOpen
(
This
->
content_listener
,
aURI
,
_retval
)
...
...
dlls/mshtml/nsio.c
View file @
61121cef
...
@@ -150,6 +150,56 @@ static BOOL before_async_open(nsChannel *channel, NSContainer *container)
...
@@ -150,6 +150,56 @@ static BOOL before_async_open(nsChannel *channel, NSContainer *container)
return
hres
!=
S_OK
;
return
hres
!=
S_OK
;
}
}
static
BOOL
translate_url
(
HTMLDocumentObj
*
doc
,
nsWineURI
*
uri
)
{
OLECHAR
*
new_url
=
NULL
,
*
url
;
BOOL
ret
=
FALSE
;
HRESULT
hres
;
if
(
!
doc
->
hostui
)
return
FALSE
;
url
=
heap_strdupW
(
uri
->
wine_url
);
hres
=
IDocHostUIHandler_TranslateUrl
(
doc
->
hostui
,
0
,
url
,
&
new_url
);
heap_free
(
url
);
if
(
hres
!=
S_OK
||
!
new_url
)
return
FALSE
;
if
(
strcmpW
(
url
,
new_url
))
{
FIXME
(
"TranslateUrl returned new URL %s -> %s
\n
"
,
debugstr_w
(
url
),
debugstr_w
(
new_url
));
ret
=
TRUE
;
}
CoTaskMemFree
(
new_url
);
return
ret
;
}
nsresult
on_start_uri_open
(
NSContainer
*
nscontainer
,
nsIURI
*
uri
,
PRBool
*
_retval
)
{
nsWineURI
*
wine_uri
;
nsresult
nsres
;
*
_retval
=
FALSE
;
nsres
=
nsIURI_QueryInterface
(
uri
,
&
IID_nsIWineURI
,
(
void
**
)
&
wine_uri
);
if
(
NS_FAILED
(
nsres
))
{
WARN
(
"Could not get nsWineURI: %08x
\n
"
,
nsres
);
return
NS_ERROR_NOT_IMPLEMENTED
;
}
if
(
!
wine_uri
->
is_doc_uri
)
{
if
(
!
wine_uri
->
container
)
{
nsIWebBrowserChrome_AddRef
(
NSWBCHROME
(
nscontainer
));
wine_uri
->
container
=
nscontainer
;
}
wine_uri
->
is_doc_uri
=
TRUE
;
*
_retval
=
translate_url
(
nscontainer
->
doc
->
basedoc
.
doc_obj
,
wine_uri
);
}
nsIURI_Release
(
NSURI
(
wine_uri
));
return
NS_OK
;
}
HRESULT
set_wine_url
(
nsWineURI
*
This
,
LPCWSTR
url
)
HRESULT
set_wine_url
(
nsWineURI
*
This
,
LPCWSTR
url
)
{
{
nsIWineURI_SetWineURL
(
NSWINEURI
(
This
),
url
);
nsIWineURI_SetWineURL
(
NSWINEURI
(
This
),
url
);
...
...
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