Update of /cvsroot/openvrml/openvrml/src/openvrml-gtkplug
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv3665/src/openvrml-gtkplug
Modified Files:
gtkvrmlbrowser.cpp
Log Message:
Factored creation of openvrml::resource_istreams to a dedicated abstract factory, openvrml::resource_fetcher. This allows the code associated with resource fetching to live at least as long as the browser instance, which it needs to do if there are any outstanding fetches happening when the browser instance is destroyed.
Index: gtkvrmlbrowser.cpp
===================================================================
RCS file: /cvsroot/openvrml/openvrml/src/openvrml-gtkplug/gtkvrmlbrowser.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** gtkvrmlbrowser.cpp 1 Oct 2006 05:47:07 -0000 1.2
--- gtkvrmlbrowser.cpp 22 Nov 2006 00:05:19 -0000 1.3
***************
*** 97,105 ****
G_GNUC_INTERNAL GdkGLConfig * gl_config;
! class G_GNUC_INTERNAL browser : public openvrml::browser {
GIOChannel * request_channel_;
public:
! explicit browser(GIOChannel & request_channel);
private:
--- 97,105 ----
G_GNUC_INTERNAL GdkGLConfig * gl_config;
! class G_GNUC_INTERNAL resource_fetcher : public openvrml::resource_fetcher {
GIOChannel * request_channel_;
public:
! explicit resource_fetcher(GIOChannel & request_channel);
private:
***************
*** 121,125 ****
gpointer);
! ::browser browser_;
GtkVrmlBrowser & vrml_browser_;
guint timer;
--- 121,126 ----
gpointer);
! ::resource_fetcher fetcher_;
! openvrml::browser browser_;
GtkVrmlBrowser & vrml_browser_;
guint timer;
***************
*** 473,483 ****
namespace {
! browser::browser(GIOChannel & request_channel):
! openvrml::browser(std::cout, std::cerr),
request_channel_(&request_channel)
{}
std::auto_ptr<openvrml::resource_istream>
! browser::do_get_resource(const std::string & uri)
{
using openvrml_player::plugin_streambuf;
--- 474,483 ----
namespace {
! resource_fetcher::resource_fetcher(GIOChannel & request_channel):
request_channel_(&request_channel)
{}
std::auto_ptr<openvrml::resource_istream>
! resource_fetcher::do_get_resource(const std::string & uri)
{
using openvrml_player::plugin_streambuf;
***************
*** 542,546 ****
GtkGLViewer::GtkGLViewer(GIOChannel & request_channel,
GtkVrmlBrowser & vrml_browser):
! browser_(request_channel),
vrml_browser_(vrml_browser),
timer(0),
--- 542,547 ----
GtkGLViewer::GtkGLViewer(GIOChannel & request_channel,
GtkVrmlBrowser & vrml_browser):
! fetcher_(request_channel),
! browser_(this->fetcher_, std::cout, std::cerr),
vrml_browser_(vrml_browser),
timer(0),
|