gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] [SCM] Gnash branch, master, updated. d1ed3a9f0551983079cd


From: Sandro Santilli
Subject: [Gnash-commit] [SCM] Gnash branch, master, updated. d1ed3a9f0551983079cd117119c68d224b9fd7ac
Date: Fri, 29 Oct 2010 23:20:24 +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, master has been updated
       via  d1ed3a9f0551983079cd117119c68d224b9fd7ac (commit)
      from  e9656783f680eb999feaa368bcf10f5c14c9ff12 (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=d1ed3a9f0551983079cd117119c68d224b9fd7ac


commit d1ed3a9f0551983079cd117119c68d224b9fd7ac
Author: Sandro Santilli <address@hidden>
Date:   Sat Oct 30 01:19:16 2010 +0200

    Use window.document.baseURI rather than window.document.location.href. The 
former honours <base> tags, fixing bug  #31497  (aka easy come, easy go)

diff --git a/plugin/npapi/plugin.cpp b/plugin/npapi/plugin.cpp
index bad11b9..109af71 100644
--- a/plugin/npapi/plugin.cpp
+++ b/plugin/npapi/plugin.cpp
@@ -1267,6 +1267,13 @@ nsPluginInstance::startProc()
 std::string
 nsPluginInstance::getCurrentPageURL() const
 {
+    // Return:
+    //  window.document.baseURI
+    //
+    // Was (bogus):
+    //  window.document.location.href
+    //
+
     NPP npp = _instance;
 
     NPIdentifier sDocument = NPN_GetStringIdentifier("document");
@@ -1279,20 +1286,21 @@ nsPluginInstance::getCurrentPageURL() const
     NPN_ReleaseObject(window);
 
     if (!NPVARIANT_IS_OBJECT(vDoc)) {
-        gnash::log_error("Can't get window object");
-        return NULL;
+        gnash::log_error("Can't get window.document object");
+        return std::string();
     }
     
     NPObject* npDoc = NPVARIANT_TO_OBJECT(vDoc);
 
+/*
     NPIdentifier sLocation = NPN_GetStringIdentifier("location");
     NPVariant vLoc;
     NPN_GetProperty(npp, npDoc, sLocation, &vLoc);
     NPN_ReleaseObject(npDoc);
 
     if (!NPVARIANT_IS_OBJECT(vLoc)) {
-        gnash::log_error("Can't get window.location object");
-        return NULL;
+        gnash::log_error("Can't get window.document.location object");
+        return std::string();
     }
 
     NPObject* npLoc = NPVARIANT_TO_OBJECT(vLoc);
@@ -1303,8 +1311,19 @@ nsPluginInstance::getCurrentPageURL() const
     NPN_ReleaseObject(npLoc);
 
     if (!NPVARIANT_IS_STRING(vProp)) {
-        gnash::log_error("Can't get window.location.href object");
-        return NULL;
+        gnash::log_error("Can't get window.document.location.href string");
+        return std::string();
+    }
+*/
+
+    NPIdentifier sProperty = NPN_GetStringIdentifier("baseURI");
+    NPVariant vProp;
+    NPN_GetProperty(npp, npDoc, sProperty, &vProp);
+    NPN_ReleaseObject(npDoc);
+
+    if (!NPVARIANT_IS_STRING(vProp)) {
+        gnash::log_error("Can't get window.document.baseURI string");
+        return std::string();
     }
 
     const NPString& propValue = NPVARIANT_TO_STRING(vProp);

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

Summary of changes:
 plugin/npapi/plugin.cpp |   31 +++++++++++++++++++++++++------
 1 files changed, 25 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

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