Use shared pointers to hold wxWebHandlers throughout.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/SOC2011_WEBVIEW@68605 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -103,10 +103,10 @@ wxgtk_webview_webkit_navigation(WebKitWebView *,
|
||||
else
|
||||
{
|
||||
wxString wxuri = uri;
|
||||
wxWebHandler *handler = NULL;
|
||||
wxVector<wxWebHandler*> hanlders = webKitCtrl->GetHandlers();
|
||||
wxSharedPtr<wxWebHandler> handler;
|
||||
wxVector<wxSharedPtr<wxWebHandler> > hanlders = webKitCtrl->GetHandlers();
|
||||
//We are not vetoed so see if we match one of the additional handlers
|
||||
for(wxVector<wxWebHandler*>::iterator it = hanlders.begin();
|
||||
for(wxVector<wxSharedPtr<wxWebHandler> >::iterator it = hanlders.begin();
|
||||
it != hanlders.end(); ++it)
|
||||
{
|
||||
if(wxuri.substr(0, (*it)->GetName().length()) == (*it)->GetName())
|
||||
@@ -328,11 +328,11 @@ wxgtk_webview_webkit_resource_req(WebKitWebView *,
|
||||
{
|
||||
wxString uri = webkit_network_request_get_uri(request);
|
||||
|
||||
wxWebHandler *handler = NULL;
|
||||
wxVector<wxWebHandler*> hanlders = webKitCtrl->GetHandlers();
|
||||
wxSharedPtr<wxWebHandler> handler;
|
||||
wxVector<wxSharedPtr<wxWebHandler> > hanlders = webKitCtrl->GetHandlers();
|
||||
|
||||
//We are not vetoed so see if we match one of the additional handlers
|
||||
for(wxVector<wxWebHandler*>::iterator it = hanlders.begin();
|
||||
for(wxVector<wxSharedPtr<wxWebHandler> >::iterator it = hanlders.begin();
|
||||
it != hanlders.end(); ++it)
|
||||
{
|
||||
if(uri.substr(0, (*it)->GetName().length()) == (*it)->GetName())
|
||||
@@ -913,7 +913,7 @@ void wxWebViewWebKit::RunScript(const wxString& javascript)
|
||||
javascript.mb_str(wxConvUTF8));
|
||||
}
|
||||
|
||||
void wxWebViewWebKit::RegisterHandler(wxWebHandler* handler)
|
||||
void wxWebViewWebKit::RegisterHandler(wxSharedPtr<wxWebHandler> handler)
|
||||
{
|
||||
m_handlerList.push_back(handler);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user