[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog server/parser/movie_def_impl.cp...
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] gnash ChangeLog server/parser/movie_def_impl.cp... |
Date: |
Thu, 16 Nov 2006 20:13:32 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Sandro Santilli <strk> 06/11/16 20:13:32
Modified files:
. : ChangeLog
server/parser : movie_def_impl.cpp movie_def_impl.h
Log message:
* server/parser/movie_def_impl.{cpp,h}:
get_exported_resource() and export_resource() moved
from header to implementation file, for (near) future
threads protection (notes added for it);
get_exported_resource() changed to take incremental
loading into account, by making sure the whole
stream has been parsed before returning a failure
(the EXPORT tag might be at the end of the stream!)
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.1633&r2=1.1634
http://cvs.savannah.gnu.org/viewcvs/gnash/server/parser/movie_def_impl.cpp?cvsroot=gnash&r1=1.35&r2=1.36
http://cvs.savannah.gnu.org/viewcvs/gnash/server/parser/movie_def_impl.h?cvsroot=gnash&r1=1.17&r2=1.18
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.1633
retrieving revision 1.1634
diff -u -b -r1.1633 -r1.1634
--- ChangeLog 16 Nov 2006 18:46:13 -0000 1.1633
+++ ChangeLog 16 Nov 2006 20:13:32 -0000 1.1634
@@ -1,5 +1,16 @@
2006-11-16 Sandro Santilli <address@hidden>
+ * server/parser/movie_def_impl.{cpp,h}:
+ get_exported_resource() and export_resource() moved
+ from header to implementation file, for (near) future
+ threads protection (notes added for it);
+ get_exported_resource() changed to take incremental
+ loading into account, by making sure the whole
+ stream has been parsed before returning a failure
+ (the EXPORT tag might be at the end of the stream!)
+
+2006-11-16 Sandro Santilli <address@hidden>
+
* testsuite/actionscript.all/check.as: moved most dejagnu_so
specific code.
* testsuite/actionscript.all/dejagnu_so_init.as:
Index: server/parser/movie_def_impl.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/parser/movie_def_impl.cpp,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -b -r1.35 -r1.36
--- server/parser/movie_def_impl.cpp 11 Nov 2006 22:44:54 -0000 1.35
+++ server/parser/movie_def_impl.cpp 16 Nov 2006 20:13:32 -0000 1.36
@@ -946,5 +946,64 @@
}
+void
+movie_def_impl::export_resource(const tu_string& symbol, resource* res)
+{
+ // FIXME: m_exports access should be protected by a mutex
+
+ // SWF sometimes exports the same thing more than once!
+ m_exports[symbol] = res;
+}
+
+
+boost::intrusive_ptr<resource>
+movie_def_impl::get_exported_resource(const tu_string& symbol)
+{
+ boost::intrusive_ptr<resource> res;
+
+ //
+#ifdef DEBUG_EXPORTS
+ log_msg("get_exported_resource called, frame count=%u", m_frame_count);
+#endif
+
+ // Keep trying until either we found the export or
+ // the stream is over.
+ bool found=false;
+ // FIXME: m_exports is not protected by a mutex
+ // this method is usually called by the loader
+ // thread of the *loader* movie, and the loader
+ // thread of *this* movie, updating 'm_exports'
+ // will be in another thread....
+ //
+ while ( ! (found = m_exports.get(symbol, &res)) )
+ {
+ // FIXME: get_loading_frame() is not protected by a mutex.
+ // this method is usually called by the loader
+ // thread of the *loader* movie, and the loader
+ // thread of *this* movie, updating 'loading_frame'
+ // will be in another thread....
+ if ( get_loading_frame() >= m_frame_count ) break;
+
+#ifdef DEBUG_EXPORTS
+ log_msg("We haven't finished loading (loading frame %u), "
+ "but m_exports.get returned no entries, "
+ "sleeping a bit and trying again",
+ get_loading_frame());
+#endif
+ usleep(100); // take a breath
+ }
+
+ if ( ! found )
+ {
+ found = m_exports.get(symbol, &res);
+ log_msg("At end of stream, still no '%s' symbol found "
+ "in m_exports (%u entries in it, follow)",
+ symbol.c_str(), m_exports.size());
+ }
+
+ return res;
+}
+
+
} // namespace gnash
Index: server/parser/movie_def_impl.h
===================================================================
RCS file: /sources/gnash/gnash/server/parser/movie_def_impl.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -b -r1.17 -r1.18
--- server/parser/movie_def_impl.h 15 Nov 2006 10:29:00 -0000 1.17
+++ server/parser/movie_def_impl.h 16 Nov 2006 20:13:32 -0000 1.18
@@ -324,20 +324,11 @@
/// Expose one of our resources under the given symbol,
/// for export. Other movies can import it.
virtual void export_resource(const tu_string& symbol,
- resource* res)
- {
- // SWF sometimes exports the same thing more than once!
- m_exports[symbol] = res;
- }
+ resource* res);
/// Get the named exported resource, if we expose it.
/// Otherwise return NULL.
- virtual boost::intrusive_ptr<resource> get_exported_resource(const
tu_string& symbol)
- {
- boost::intrusive_ptr<resource> res;
- m_exports.get(symbol, &res);
- return res;
- }
+ virtual boost::intrusive_ptr<resource> get_exported_resource(const
tu_string& symbol);
/// Adds an entry to a table of resources that need to
/// be imported from other movies. Client code must
- [Gnash-commit] gnash ChangeLog server/parser/movie_def_impl.cp...,
Sandro Santilli <=