From: Braden M. <br...@us...> - 2006-07-23 05:43:16
|
Update of /cvsroot/openvrml/openvrml/mozilla-plugin/src/openvrml-player In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30550/mozilla-plugin/src/openvrml-player Modified Files: gtkvrmlbrowser.cpp player.cpp plugin_streambuf.cpp plugin_streambuf.h Log Message: Backed out change to set the plugin_resource_istream initial state to invalid if the Web browser's get-url function fails. The attempted solution deadlocks. Index: player.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/mozilla-plugin/src/openvrml-player/player.cpp,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** player.cpp 15 May 2006 05:51:59 -0000 1.24 --- player.cpp 23 Jul 2006 05:43:12 -0000 1.25 *************** *** 74,89 **** string command; command_line_stream >> command; ! if (command == "get-url-result") { ! using boost::shared_ptr; ! ! std::string url; ! int result; ! command_line_stream >> url >> result; ! ! shared_ptr<plugin_streambuf> streambuf = ! uninitialized_plugin_streambuf_map_.find(url); ! assert(streambuf); ! streambuf->set_get_url_result(result); ! } else if (command == "new-stream") { using boost::shared_ptr; --- 74,78 ---- string command; command_line_stream >> command; ! if (command == "new-stream") { using boost::shared_ptr; Index: plugin_streambuf.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/mozilla-plugin/src/openvrml-player/plugin_streambuf.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** plugin_streambuf.cpp 15 May 2006 05:51:59 -0000 1.4 --- plugin_streambuf.cpp 23 Jul 2006 05:43:12 -0000 1.5 *************** *** 24,28 **** openvrml_player::plugin_streambuf:: plugin_streambuf(const std::string & requested_url): - get_url_result_(-1), initialized_(false), url_(requested_url), --- 24,27 ---- *************** *** 38,58 **** } - void openvrml_player::plugin_streambuf::set_get_url_result(const int result) - { - boost::mutex::scoped_lock lock(this->mutex_); - assert(this->get_url_result_ == -1); - this->get_url_result_ = result; - this->received_get_url_result_.notify_all(); - } - - int openvrml_player::plugin_streambuf::get_url_result() const - { - boost::mutex::scoped_lock lock(this->mutex_); - while (this->get_url_result_ == -1) { - this->received_get_url_result_.wait(lock); - } - return this->get_url_result_; - } - void openvrml_player::plugin_streambuf::init(const size_t stream_id, const std::string & received_url, --- 37,40 ---- Index: gtkvrmlbrowser.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/mozilla-plugin/src/openvrml-player/gtkvrmlbrowser.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** gtkvrmlbrowser.cpp 15 May 2006 05:51:59 -0000 1.2 --- gtkvrmlbrowser.cpp 23 Jul 2006 05:43:12 -0000 1.3 *************** *** 183,187 **** } ! void gtk_vrml_browser_class_init(GtkVrmlBrowserClass *) {} --- 183,187 ---- } ! void gtk_vrml_browser_class_init(GtkVrmlBrowserClass * klass) {} *************** *** 512,523 **** 0); g_io_channel_flush(this->request_channel_, 0); - - // - // This blocks until we know the result of NPN_GetURL. - // - const int get_url_result = this->streambuf_->get_url_result(); - if (get_url_result != 0) { - this->setstate(std::ios_base::failbit); - } } --- 512,515 ---- Index: plugin_streambuf.h =================================================================== RCS file: /cvsroot/openvrml/openvrml/mozilla-plugin/src/openvrml-player/plugin_streambuf.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** plugin_streambuf.h 15 May 2006 05:51:59 -0000 1.3 --- plugin_streambuf.h 23 Jul 2006 05:43:12 -0000 1.4 *************** *** 40,45 **** mutable boost::mutex mutex_; - int get_url_result_; - mutable boost::condition received_get_url_result_; bool initialized_; mutable boost::condition streambuf_initialized_; --- 40,43 ---- *************** *** 55,60 **** public: explicit plugin_streambuf(const std::string & requested_url); - void set_get_url_result(int result); - int get_url_result() const; void init(size_t stream_id, const std::string & received_url, --- 53,56 ---- |