gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] /srv/bzr/gnash/trunk r11603: Stop querying the string_tab


From: Sandro Santilli
Subject: [Gnash-commit] /srv/bzr/gnash/trunk r11603: Stop querying the string_table for _bytesLoaded and _bytesTotal
Date: Thu, 05 Nov 2009 22:33:24 +0100
User-agent: Bazaar (1.16.1)

------------------------------------------------------------
revno: 11603
committer: Sandro Santilli <address@hidden>
branch nick: trunk
timestamp: Thu 2009-11-05 22:33:24 +0100
message:
  Stop querying the string_table for _bytesLoaded and _bytesTotal
modified:
  libcore/asobj/LoadableObject.cpp
  libcore/namedStrings.cpp
  libcore/namedStrings.h
=== modified file 'libcore/asobj/LoadableObject.cpp'
--- a/libcore/asobj/LoadableObject.cpp  2009-11-05 20:46:48 +0000
+++ b/libcore/asobj/LoadableObject.cpp  2009-11-05 21:33:24 +0000
@@ -101,16 +101,13 @@
     size_t actuallyRead = lt->readNonBlocking(buf.data()+buf.size(),
                                               chunk-buf.size());
 
-    string_table& st = getStringTable(*obj);
-
     if ( actuallyRead )
     {
         buf.resize(buf.size()+actuallyRead);
 
-        // TODO: use namedString
-        obj->set_member(st.find("_bytesLoaded"), buf.size());
+        obj->set_member(NSV::PROP_uBYTES_LOADED, buf.size());
         // TODO: do this only on first call ?
-        obj->set_member(st.find("_bytesTotal"), lt->size());
+        obj->set_member(NSV::PROP_uBYTES_TOTAL, lt->size());
 
         log_debug("LoadableObject Loaded %d bytes, reaching %d total",
             actuallyRead, buf.size());
@@ -228,8 +225,7 @@
 {
     boost::intrusive_ptr<as_object> ptr = ensure<ValidThis>(fn);
     as_value bytesLoaded;
-    string_table& st = getStringTable(fn);
-    ptr->get_member(st.find("_bytesLoaded"), &bytesLoaded);
+    ptr->get_member(NSV::PROP_uBYTES_LOADED, &bytesLoaded);
     return bytesLoaded;
 }
     
@@ -238,8 +234,7 @@
 {
     boost::intrusive_ptr<as_object> ptr = ensure<ValidThis>(fn);
     as_value bytesTotal;
-    string_table& st = getStringTable(fn);
-    ptr->get_member(st.find("_bytesTotal"), &bytesTotal);
+    ptr->get_member(NSV::PROP_uBYTES_TOTAL, &bytesTotal);
     return bytesTotal;
 }
 
@@ -531,9 +526,8 @@
     movie_root& mr = getRoot(fn);
     mr.addLoadableObject(obj, str);
 
-    string_table& st = getStringTable(fn);
-    obj->set_member(st.find("_bytesLoaded"), 0.0);
-    obj->set_member(st.find("_bytesTotal"), as_value());
+    obj->set_member(NSV::PROP_uBYTES_LOADED, 0.0);
+    obj->set_member(NSV::PROP_uBYTES_TOTAL, as_value());
 
     return as_value(true);
 

=== modified file 'libcore/namedStrings.cpp'
--- a/libcore/namedStrings.cpp  2009-10-26 08:41:46 +0000
+++ b/libcore/namedStrings.cpp  2009-11-05 21:33:24 +0000
@@ -42,6 +42,8 @@
        string_table::svt( "bold", NSV::PROP_BOLD ),
        string_table::svt( "broadcastMessage", NSV::PROP_BROADCAST_MESSAGE ),
        string_table::svt( "bullet", NSV::PROP_BULLET ),
+       string_table::svt( "_bytesTotal", NSV::PROP_uBYTES_TOTAL ),
+       string_table::svt( "_bytesLoaded", NSV::PROP_uBYTES_LOADED ),
        string_table::svt( "c", NSV::PROP_C ),
        string_table::svt( "callee", NSV::PROP_CALLEE ),
        string_table::svt( "caller", NSV::PROP_CALLER ),

=== modified file 'libcore/namedStrings.h'
--- a/libcore/namedStrings.h    2009-10-26 08:41:46 +0000
+++ b/libcore/namedStrings.h    2009-11-05 21:33:24 +0000
@@ -135,6 +135,8 @@
         PROP_BOLD,
         PROP_BROADCAST_MESSAGE,
         PROP_BULLET,
+        PROP_uBYTES_TOTAL,
+        PROP_uBYTES_LOADED,
         PROP_C,
         PROP_CALLEE,
         PROP_CALLER,


reply via email to

[Prev in Thread] Current Thread [Next in Thread]