gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] [SCM] Gnash branch, objecturi, updated. a3e2d11b545fcdb32


From: Sandro Santilli
Subject: [Gnash-commit] [SCM] Gnash branch, objecturi, updated. a3e2d11b545fcdb326df4229e9524bf27d4fc9bd
Date: Wed, 22 Sep 2010 20:24:45 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnash".

The branch, objecturi has been updated
       via  a3e2d11b545fcdb326df4229e9524bf27d4fc9bd (commit)
       via  f2744d191d002e89682f7536fdf33f803a7f558b (commit)
       via  68ef231874cdefd878bb7e867a6e4f8741561bad (commit)
      from  9d8a897354e14faf06cd0582604cc691ca8eb552 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit//commit/?id=a3e2d11b545fcdb326df4229e9524bf27d4fc9bd


commit a3e2d11b545fcdb326df4229e9524bf27d4fc9bd
Author: Sandro Santilli <address@hidden>
Date:   Wed Sep 22 22:24:37 2010 +0200

    These two seems to require some sleeps (now that we are faster ? Probably...

diff --git a/testsuite/swfdec/REALTIME b/testsuite/swfdec/REALTIME
index 2d2a5ad..ac8a322 100644
--- a/testsuite/swfdec/REALTIME
+++ b/testsuite/swfdec/REALTIME
@@ -27,3 +27,5 @@ sec-0.6.2-local-access-5.swf
 sec-0.6.2-local-access-6.swf
 sec-0.6.2-local-access-7.swf
 sec-0.6.2-local-access-8.swf
+crash-0.6.0-moviecliploader-7.swf
+crash-0.6.0-moviecliploader-8.swf

http://git.savannah.gnu.org/cgit//commit/?id=f2744d191d002e89682f7536fdf33f803a7f558b


commit f2744d191d002e89682f7536fdf33f803a7f558b
Author: Sandro Santilli <address@hidden>
Date:   Wed Sep 22 22:19:50 2010 +0200

    Switch path element lookup functions to ObjectURI as well

diff --git a/libcore/DisplayObject.cpp b/libcore/DisplayObject.cpp
index d5fcb13..14a6540 100644
--- a/libcore/DisplayObject.cpp
+++ b/libcore/DisplayObject.cpp
@@ -162,17 +162,22 @@ DisplayObject::getWorldVolume() const
 
 
 as_object*
-DisplayObject::pathElement(string_table::key key)
+DisplayObject::pathElement(const ObjectURI& uri)
 {
     as_object* obj = getObject(this);
     if (!obj) return 0;
 
+    string_table::key key = getName(uri);
+
     string_table& st = stage().getVM().getStringTable();
+
+    // TODO: put ".." and "." in namedStrings
     if (key == st.find("..")) return getObject(parent());
        if (key == st.find(".")) return obj;
     
     // The check is case-insensitive for SWF6 and below.
-    if (equal(st, key, NSV::PROP_THIS, caseless(*obj))) {
+    // TODO: cache ObjectURI(NSV::PROP_THIS) [as many others...]
+    if (equals(st, uri, ObjectURI(NSV::PROP_THIS), caseless(*obj))) {
         return obj;
     }
        return 0;
diff --git a/libcore/DisplayObject.h b/libcore/DisplayObject.h
index ae2b52d..dea7682 100644
--- a/libcore/DisplayObject.h
+++ b/libcore/DisplayObject.h
@@ -558,7 +558,7 @@ public:
     /// In ActionScript 1.0, everything seems to be CASE
     /// INSENSITIVE.
     ///
-    virtual as_object* pathElement(string_table::key key);
+    virtual as_object* pathElement(const ObjectURI& uri);
 
     /// \brief
     /// Return true if PlaceObjects tag are allowed to move
diff --git a/libcore/MovieClip.cpp b/libcore/MovieClip.cpp
index f60c7a6..db89280 100644
--- a/libcore/MovieClip.cpp
+++ b/libcore/MovieClip.cpp
@@ -694,13 +694,13 @@ MovieClip::notifyEvent(const event_id& id)
 }
 
 as_object*
-MovieClip::pathElement(string_table::key key)
+MovieClip::pathElement(const ObjectURI& uri)
 {
-    as_object* obj = DisplayObject::pathElement(key);
+    as_object* obj = DisplayObject::pathElement(uri);
     if (obj) return obj;
 
     // See if we have a match on the display list.
-    obj = getObject(getDisplayListObject(key));
+    obj = getObject(getDisplayListObject(uri));
     if (obj) return obj;
 
     obj = getObject(this);
@@ -708,7 +708,7 @@ MovieClip::pathElement(string_table::key key)
 
     // See if it's a member
     as_value tmp;
-    if (!obj->as_object::get_member(key, &tmp)) {
+    if (!obj->as_object::get_member(uri, &tmp)) {
         return NULL;
     }
     if (!tmp.is_object()) {
diff --git a/libcore/MovieClip.h b/libcore/MovieClip.h
index 15321eb..4e22903 100644
--- a/libcore/MovieClip.h
+++ b/libcore/MovieClip.h
@@ -465,7 +465,7 @@ public:
     DisplayObject* getDisplayListObject(const ObjectURI& uri);
 
     /// Overridden to look in DisplayList for a match
-    as_object* pathElement(string_table::key key);
+    as_object* pathElement(const ObjectURI& uri);
 
     /// Execute the actions for the specified frame. 
     //
diff --git a/libcore/as_environment.cpp b/libcore/as_environment.cpp
index c6b097d..2c0d6eb 100644
--- a/libcore/as_environment.cpp
+++ b/libcore/as_environment.cpp
@@ -109,11 +109,11 @@ setLocal(as_object& locals, const std::string& varname, 
const as_value& val)
 }
 
 as_object*
-getElement(as_object* obj, string_table::key key)
+getElement(as_object* obj, const ObjectURI& uri)
 {
     DisplayObject* d = obj->displayObject();
-    if (d) return d->pathElement(key);
-    return obj->get_path_element(key);
+    if (d) return d->pathElement(uri);
+    return obj->get_path_element(uri);
 }
 
 }
@@ -483,7 +483,6 @@ as_object*
 as_environment::find_object(const std::string& path,
         const ScopeStack* scopeStack) const
 {
-
     if (path.empty()) {
         return getObject(m_target);
     }
@@ -491,6 +490,7 @@ as_environment::find_object(const std::string& path,
     VM& vm = _vm;
     string_table& st = vm.getStringTable();
     const int swfVersion = vm.getSWFVersion();
+    ObjectURI globalURI(NSV::PROP_uGLOBAL);
 
     bool firstElementParsed = false;
     bool dot_allowed = true;
@@ -577,7 +577,7 @@ as_environment::find_object(const std::string& path,
         // No more components to scan
         if (subpart.empty()) break;
 
-        const string_table::key subpartKey = st.find(subpart);
+        const ObjectURI subpartURI(st.find(subpart));
 
         if (!firstElementParsed) {
             as_object* element(0);
@@ -588,7 +588,7 @@ as_environment::find_object(const std::string& path,
                     for (size_t i = scopeStack->size(); i > 0; --i) {
                         as_object* obj = (*scopeStack)[i-1];
                         
-                        element = getElement(obj, subpartKey);
+                        element = getElement(obj, subpartURI);
                         if (element) break;
                     }
                     if (element) break;
@@ -597,7 +597,7 @@ as_environment::find_object(const std::string& path,
                 // Try current target  (if any)
                 assert(env == getObject(m_target));
                 if (env) {
-                    element = getElement(env, subpartKey);
+                    element = getElement(env, subpartURI);
                     if (element) break;
                 }
 
@@ -606,13 +606,13 @@ as_environment::find_object(const std::string& path,
                 const bool nocase = caseless(*global);
 
                 if (swfVersion > 5 &&
-                        equal(st, subpartKey, NSV::PROP_uGLOBAL, nocase)) {
+                        equals(st, subpartURI, globalURI, nocase)) {
                     element = global;
                     break;
                 }
 
                 // Look for globals.
-                element = getElement(global, subpartKey);
+                element = getElement(global, subpartURI);
 
             } while (0);
 
@@ -636,7 +636,7 @@ as_environment::find_object(const std::string& path,
                     "%p"), subpart, (void *)env);
 #endif
 
-            as_object* element = getElement(env, subpartKey);
+            as_object* element = getElement(env, subpartURI);
             if (!element) {
 #ifdef DEBUG_TARGET_FINDING 
                 log_debug(_("Path element %s not found in "
diff --git a/libcore/as_object.cpp b/libcore/as_object.cpp
index 6512408..bb0e4ac 100644
--- a/libcore/as_object.cpp
+++ b/libcore/as_object.cpp
@@ -979,22 +979,22 @@ as_object::getMember(const ObjectURI& uri)
 }
 
 as_object*
-as_object::get_path_element(string_table::key key)
+as_object::get_path_element(const ObjectURI& uri)
 {
 //#define DEBUG_TARGET_FINDING 1
 
     as_value tmp;
-    if (!get_member(key, &tmp)) {
+    if (!get_member(uri, &tmp)) {
 #ifdef DEBUG_TARGET_FINDING 
         log_debug("Member %s not found in object %p",
-                  getStringTable(*this).value(key), (void*)this);
+                  uri.toString(getStringTable(*this)), (void*)this);
 #endif
         return NULL;
     }
     if (!tmp.is_object()) {
 #ifdef DEBUG_TARGET_FINDING 
         log_debug("Member %s of object %p is not an object (%s)",
-                  getStringTable(*this).value(key), (void*)this, tmp);
+                  uri.toString(getStringTable(*this)), (void*)this, tmp);
 #endif
         return NULL;
     }
diff --git a/libcore/as_object.h b/libcore/as_object.h
index d35d455..71b8297 100644
--- a/libcore/as_object.h
+++ b/libcore/as_object.h
@@ -471,7 +471,7 @@ public:
     ///
     /// Main use if for getvariable and settarget resolution,
     /// currently implemented in as_environment.
-    virtual as_object* get_path_element(string_table::key key);
+    virtual as_object* get_path_element(const ObjectURI& uri);
 
     /// Get the super object of this object.
     ///
diff --git a/libcore/movie_root.cpp b/libcore/movie_root.cpp
index 4d20321..ee73c62 100644
--- a/libcore/movie_root.cpp
+++ b/libcore/movie_root.cpp
@@ -2102,9 +2102,10 @@ movie_root::findCharacterByTarget(const std::string& 
tgtstr) const
         std::string part(tgtstr, from, to - from);
 
         // TODO: there is surely a cleaner way to implement path finding.
+        ObjectURI uri(st.find(part));
         o = o->displayObject() ?
-            o->displayObject()->pathElement(st.find(part)) :
-            o->get_path_element(st.find(part));
+            o->displayObject()->pathElement(uri) :
+            o->get_path_element(uri);
 
         if (!o) {
 #ifdef GNASH_DEBUG_TARGET_RESOLUTION

http://git.savannah.gnu.org/cgit//commit/?id=68ef231874cdefd878bb7e867a6e4f8741561bad


commit 68ef231874cdefd878bb7e867a6e4f8741561bad
Author: Sandro Santilli <address@hidden>
Date:   Wed Sep 22 21:54:14 2010 +0200

    Add equals(uri,uri) function to replace the one currently implemented in 
string_table (key,key)

diff --git a/libcore/ObjectURI.h b/libcore/ObjectURI.h
index e57e483..336bb56 100644
--- a/libcore/ObjectURI.h
+++ b/libcore/ObjectURI.h
@@ -90,6 +90,13 @@ equalsNoCase(string_table& st, const ObjectURI& a, const 
ObjectURI& b)
     return a.noCase(st) == b.noCase(st);
 }
 
+inline bool
+equals(string_table& st, const ObjectURI& a, const ObjectURI& b, bool caseless)
+{
+    if ( caseless ) return equalsNoCase(st, a, b);
+    else return a == b;
+}
+
 /// ObjectURIs are equal if name is equal
 inline bool
 operator==(const ObjectURI& a, const ObjectURI& b)

-----------------------------------------------------------------------

Summary of changes:
 libcore/DisplayObject.cpp  |    9 +++++++--
 libcore/DisplayObject.h    |    2 +-
 libcore/MovieClip.cpp      |    8 ++++----
 libcore/MovieClip.h        |    2 +-
 libcore/ObjectURI.h        |    7 +++++++
 libcore/as_environment.cpp |   20 ++++++++++----------
 libcore/as_object.cpp      |    8 ++++----
 libcore/as_object.h        |    2 +-
 libcore/movie_root.cpp     |    5 +++--
 testsuite/swfdec/REALTIME  |    2 ++
 10 files changed, 40 insertions(+), 25 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

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