gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog server/Property.h server/as_obj...


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog server/Property.h server/as_obj...
Date: Fri, 26 Oct 2007 22:56:07 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  07/10/26 22:56:07

Modified files:
        .              : ChangeLog 
        server         : Property.h as_object.cpp as_object.h 
                         as_prop_flags.h 
        testsuite/swfdec: PASSING 

Log message:
                * server/as_prop_flags.h: add version-based ignore flags.
                * server/Property.h: expose an isVisible(int ver) method.
                * server/as_object.{cpp,h} (findProperty): ignore invisible
                  properties.
                * testsuite/swfdec/PASSING: success for all versions from
                  ASSetPropFlags-ignore.as

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.4722&r2=1.4723
http://cvs.savannah.gnu.org/viewcvs/gnash/server/Property.h?cvsroot=gnash&r1=1.10&r2=1.11
http://cvs.savannah.gnu.org/viewcvs/gnash/server/as_object.cpp?cvsroot=gnash&r1=1.71&r2=1.72
http://cvs.savannah.gnu.org/viewcvs/gnash/server/as_object.h?cvsroot=gnash&r1=1.78&r2=1.79
http://cvs.savannah.gnu.org/viewcvs/gnash/server/as_prop_flags.h?cvsroot=gnash&r1=1.9&r2=1.10
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/swfdec/PASSING?cvsroot=gnash&r1=1.49&r2=1.50

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.4722
retrieving revision 1.4723
diff -u -b -r1.4722 -r1.4723
--- ChangeLog   26 Oct 2007 21:35:01 -0000      1.4722
+++ ChangeLog   26 Oct 2007 22:56:06 -0000      1.4723
@@ -1,5 +1,14 @@
 2007-10-26 Sandro Santilli <address@hidden>
 
+       * server/as_prop_flags.h: add version-based ignore flags.
+       * server/Property.h: expose an isVisible(int ver) method.
+       * server/as_object.{cpp,h} (findProperty): ignore invisible
+         properties.
+       * testsuite/swfdec/PASSING: success for all versions from
+         ASSetPropFlags-ignore.as
+
+2007-10-26 Sandro Santilli <address@hidden>
+
        * extensions/gtk2/gtkext.cpp: use init_member to initialize interface
          (fixes build)
 

Index: server/Property.h
===================================================================
RCS file: /sources/gnash/gnash/server/Property.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- server/Property.h   18 Oct 2007 11:47:53 -0000      1.10
+++ server/Property.h   26 Oct 2007 22:56:06 -0000      1.11
@@ -214,6 +214,9 @@
        /// Is this a static property?
        bool isStatic() const { return _flags.get_static(); }
 
+       /// Is this member supposed to be visible by a VM of given version ?
+       bool isVisible(int swfVersion) const { return 
_flags.get_visible(swfVersion); }
+
        /// What is the name of this property?
        string_table::key getName() const { return mName; }
 

Index: server/as_object.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/as_object.cpp,v
retrieving revision 1.71
retrieving revision 1.72
diff -u -b -r1.71 -r1.72
--- server/as_object.cpp        26 Oct 2007 13:03:56 -0000      1.71
+++ server/as_object.cpp        26 Oct 2007 22:56:07 -0000      1.72
@@ -189,11 +189,13 @@
        // keep track of visited objects, avoid infinite loops.
        std::set<as_object*> visited;
 
+       int swfVersion = _vm.getSWFVersion();
+
        boost::intrusive_ptr<as_object> obj = this;
        while (obj && visited.insert(obj.get()).second)
        {
                Property* prop = obj->_members.getProperty(key);
-               if (prop)
+               if (prop && prop->isVisible(swfVersion) )
                {
                        if (owner != NULL)
                                *owner = obj.get();
@@ -207,42 +209,6 @@
        return NULL;
 }
 
-#if 0
-/*private*/
-Property*
-as_object::findGetterSetter(string_table::key key, string_table::key nsname)
-{
-       // don't enter an infinite loop looking for __proto__ ...
-       if (key == NSV::PROP_uuPROTOuu)
-       {
-               Property* prop = _members.getProperty(key, nsname);
-               if ( ! prop ) return NULL;
-               if ( ! prop->isGetterSetter() ) return NULL;
-               return prop;
-       }
-
-       // this set will keep track of visited objects,
-       // to avoid infinite loops
-       std::set< as_object* > visited;
-
-       boost::intrusive_ptr<as_object> obj = this;
-       while ( obj && visited.insert(obj.get()).second )
-       {
-               Property* prop = obj->_members.getProperty(key, nsname);
-               if ( prop && prop->isGetterSetter() )
-               {
-                       // what if a property is found which is
-                       // NOT a getter/setter ?
-                       return prop;
-               }
-               obj = obj->get_prototype();
-       }
-
-       // No Getter/Setter property found
-       return NULL;
-}
-#endif
-
 Property*
 as_object::findUpdatableProperty(string_table::key key, string_table::key 
nsname)
 {

Index: server/as_object.h
===================================================================
RCS file: /sources/gnash/gnash/server/as_object.h,v
retrieving revision 1.78
retrieving revision 1.79
diff -u -b -r1.78 -r1.79
--- server/as_object.h  26 Oct 2007 13:03:56 -0000      1.78
+++ server/as_object.h  26 Oct 2007 22:56:07 -0000      1.79
@@ -90,16 +90,6 @@
                return *this;
        }
 
-#if 0
-       /// Look for a Getter/setter property scanning the inheritance chain
-       //
-       /// @returns a Getter/Setter propery if found, NULL if not found
-       ///
-       /// TODO: drop this function, is unused
-       Property* findGetterSetter(string_table::key name, 
-               string_table::key nsname = 0);
-#endif
-
        /// Find an existing property for update, only scaning the inheritance 
chain for getter/setters
        /// or statics.
        //
@@ -108,6 +98,7 @@
        ///       completely new or as an override).
        ///
        /// @returns a propery if found, NULL if not found
+       ///          or not visible in current VM version
        ///
        Property* findUpdatableProperty(string_table::key name, 
                string_table::key nsname = 0);
@@ -121,6 +112,7 @@
        /// If not null, this is set to the object which contained the property.
        ///
        /// @returns a Propery if found, NULL if not found
+       ///          or not visible in current VM version
        ///
        Property* findProperty(string_table::key name, string_table::key nsname,
                as_object **owner = NULL);

Index: server/as_prop_flags.h
===================================================================
RCS file: /sources/gnash/gnash/server/as_prop_flags.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- server/as_prop_flags.h      18 Oct 2007 11:47:54 -0000      1.9
+++ server/as_prop_flags.h      26 Oct 2007 22:56:07 -0000      1.10
@@ -55,15 +55,28 @@
                staticProp      = 1 << 3,
 
                /// Flags are protected from changes
-               isProtected     = 1 << 4
+               isProtected     = 1 << 4,
+
+               /// Only visible by VM initialized for version 6 or higher 
+               onlySWF6Up      = 1 << 7, // 128
+
+               /// Ignore in SWF6-initialized VM
+               ignoreSWF6      = 1 << 8, // 256
+
+               /// Only visible by VM initialized for version 7 or higher 
+               onlySWF7Up      = 1 << 10, // 1024
+
+               /// Only visible by VM initialized for version 8 or higher 
+               onlySWF8Up      = 1 << 12 // 4096
+
        };
 
-       /// mask for flags
+       /// mask for flags (bits that can be set by user)
        //
        /// TODO: make private.
        ///       Currently used by as_global_assetpropflags in Global.cpp
        ///
-       static const int as_prop_flags_mask = dontEnum|dontDelete|readOnly;
+       static const int as_prop_flags_mask = 
dontEnum|dontDelete|readOnly|onlySWF6Up|ignoreSWF6|onlySWF7Up|onlySWF8Up;
 
 
        /// Default constructor
@@ -132,6 +145,16 @@
        /// Clear "don't enum" flag 
        void clear_dont_enum() { _flags &= ~dontEnum; }
 
+       /// Get version-based visibility 
+       bool get_visible(int swfVersion) const
+       {
+               if ( _flags & onlySWF6Up && swfVersion  < 6 ) return false;
+               if ( _flags & ignoreSWF6 && swfVersion == 6 ) return false;
+               if ( _flags & onlySWF7Up && swfVersion  < 7 ) return false;
+               if ( _flags & onlySWF8Up && swfVersion < 8 ) return false;
+               return true;
+       }
+
        /// accesor to the numerical flags value
        int get_flags() const { return _flags; }
 

Index: testsuite/swfdec/PASSING
===================================================================
RCS file: /sources/gnash/gnash/testsuite/swfdec/PASSING,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -b -r1.49 -r1.50
--- testsuite/swfdec/PASSING    25 Oct 2007 14:21:02 -0000      1.49
+++ testsuite/swfdec/PASSING    26 Oct 2007 22:56:07 -0000      1.50
@@ -1,3 +1,6 @@
+ASSetPropFlags-ignore-5.swf:c4e6df938c3b197cf816e2eb5be64756
+ASSetPropFlags-ignore-6.swf:304d494ef49c6692685327c3db5fb3b0
+ASSetPropFlags-ignore-7.swf:b4afbd0943294a476fc64716a6e6e896
 ASSetPropFlags-ignore-8.swf:6e567a540363bd2812616604dfd04033
 DoInitAction-once.swf:4a95697fd4287b3617268acba457ffdf
 DoInitAction-this.swf:d747ea8f0ead68e586dd4a7aadaded90




reply via email to

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