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:
Steve Lamerton
2011-08-08 15:12:33 +00:00
parent fea281f428
commit 3baf235f60
8 changed files with 23 additions and 24 deletions

View File

@@ -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);
}