Java
authorkov@webkit.org <kov@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 15 Sep 2009 02:08:46 +0000 (02:08 +0000)
committerkov@webkit.org <kov@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 15 Sep 2009 02:08:46 +0000 (02:08 +0000)
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@48381 268f45cc-cd09-0410-ab3c-d52691b4dbfc

JavaScriptCore/wtf/GOwnPtr.cpp
JavaScriptCore/wtf/GOwnPtr.h
WebCore/plugins/gtk/PluginPackageGtk.cpp
WebCore/plugins/gtk/PluginViewGtk.cpp
WebKit/gtk/webkit/webkitwebview.cpp

index 432885f..7b763ec 100644 (file)
@@ -62,4 +62,10 @@ template <> void freeOwnedGPtr<GHashTable>(GHashTable* ptr)
         g_hash_table_unref(ptr);
 }
 
+template <> void freeOwnedGPtr<GFile>(GFile* file)
+{
+    if (file)
+        g_object_unref(file);
+}
+
 } // namespace WTF
index 4993348..b62ff7c 100644 (file)
@@ -26,6 +26,7 @@
 #include <glib.h>
 #include <wtf/Assertions.h>
 #include <wtf/Noncopyable.h>
+#include <gio/gio.h>
 
 namespace WTF {
     template <typename T> inline void freeOwnedGPtr(T* ptr) { g_free(reinterpret_cast<void*>(ptr)); }
@@ -36,6 +37,7 @@ namespace WTF {
     template<> void freeOwnedGPtr<GPatternSpec>(GPatternSpec*);
     template<> void freeOwnedGPtr<GDir>(GDir*);
     template<> void freeOwnedGPtr<GHashTable>(GHashTable*);
+    template<> void freeOwnedGPtr<GFile>(GFile*);
 
     template <typename T> class GOwnPtr : public Noncopyable {
     public:
index bcbd519..951fa84 100644 (file)
 #include "config.h"
 #include "PluginPackage.h"
 
-#include <stdio.h>
-
 #include "CString.h"
+#include <GOwnPtr.h>
 #include "MIMETypeRegistry.h"
 #include "NotImplemented.h"
 #include "npruntime_impl.h"
 #include "PluginDebug.h"
 
+#include <stdio.h>
+#include <gio/gio.h>
+
 namespace WebCore {
 
 bool PluginPackage::fetchInfo()
@@ -105,7 +107,16 @@ bool PluginPackage::load()
         return true;
     }
 
-    m_module = g_module_open((m_path.utf8()).data(), G_MODULE_BIND_LOCAL);
+    GOwnPtr<gchar> finalPath(g_strdup(m_path.utf8().data()));
+    while (g_file_test(finalPath.get(), G_FILE_TEST_IS_SYMLINK)) {
+        GOwnPtr<GFile> file(g_file_new_for_path(finalPath.get()));
+        GOwnPtr<gchar> linkPath(g_file_read_link(finalPath.get(), NULL));
+
+        GOwnPtr<GFile> resolvedFile(g_file_resolve_relative_path(file.get(), linkPath.get()));
+        finalPath.set(g_file_get_path(resolvedFile.get()));
+    }
+
+    m_module = g_module_open(finalPath.get(), G_MODULE_BIND_LOCAL);
 
     if (!m_module) {
         LOG(Plugins,"Module Load Failed :%s, Error:%s\n", (m_path.utf8()).data(), g_module_error());
index 46b0fc7..89f952c 100644 (file)
@@ -342,57 +342,55 @@ NPError PluginView::getValue(NPNVariable variable, void* value)
             return NPERR_GENERIC_ERROR;
 #endif
 
-#if ENABLE(NETSCAPE_PLUGIN_API)
-        case NPNVWindowNPObject: {
-            if (m_isJavaScriptPaused)
-                return NPERR_GENERIC_ERROR;
+    case NPNVWindowNPObject: {
+        if (m_isJavaScriptPaused)
+            return NPERR_GENERIC_ERROR;
 
-            NPObject* windowScriptObject = m_parentFrame->script()->windowScriptNPObject();
+        NPObject* windowScriptObject = m_parentFrame->script()->windowScriptNPObject();
 
-            // Return value is expected to be retained, as described here: <http://www.mozilla.org/projects/plugin/npruntime.html>
-            if (windowScriptObject)
-                _NPN_RetainObject(windowScriptObject);
+        // Return value is expected to be retained, as described here: <http://www.mozilla.org/projects/plugin/npruntime.html>
+        if (windowScriptObject)
+            _NPN_RetainObject(windowScriptObject);
 
-            void** v = (void**)value;
-            *v = windowScriptObject;
-            
-            return NPERR_NO_ERROR;
-        }
+        void** v = (void**)value;
+        *v = windowScriptObject;
+        
+        return NPERR_NO_ERROR;
+    }
 
-        case NPNVPluginElementNPObject: {
-            if (m_isJavaScriptPaused)
-                return NPERR_GENERIC_ERROR;
+    case NPNVPluginElementNPObject: {
+        if (m_isJavaScriptPaused)
+            return NPERR_GENERIC_ERROR;
 
-            NPObject* pluginScriptObject = 0;
+        NPObject* pluginScriptObject = 0;
 
-            if (m_element->hasTagName(appletTag) || m_element->hasTagName(embedTag) || m_element->hasTagName(objectTag))
-                pluginScriptObject = static_cast<HTMLPlugInElement*>(m_element)->getNPObject();
+        if (m_element->hasTagName(appletTag) || m_element->hasTagName(embedTag) || m_element->hasTagName(objectTag))
+            pluginScriptObject = static_cast<HTMLPlugInElement*>(m_element)->getNPObject();
 
-            // Return value is expected to be retained, as described here: <http://www.mozilla.org/projects/plugin/npruntime.html>
-            if (pluginScriptObject)
-                _NPN_RetainObject(pluginScriptObject);
+        // Return value is expected to be retained, as described here: <http://www.mozilla.org/projects/plugin/npruntime.html>
+        if (pluginScriptObject)
+            _NPN_RetainObject(pluginScriptObject);
 
-            void** v = (void**)value;
-            *v = pluginScriptObject;
+        void** v = (void**)value;
+        *v = pluginScriptObject;
 
-            return NPERR_NO_ERROR;
-        }
-#endif
+        return NPERR_NO_ERROR;
+    }
 
-        case NPNVnetscapeWindow: {
+    case NPNVnetscapeWindow: {
 #if defined(XP_UNIX)
-            void* w = reinterpret_cast<void*>(value);
-            *((XID *)w) = GDK_WINDOW_XWINDOW(m_parentFrame->view()->hostWindow()->platformWindow()->window);
+        void* w = reinterpret_cast<void*>(value);
+        *((XID *)w) = GDK_WINDOW_XWINDOW(m_parentFrame->view()->hostWindow()->platformWindow()->window);
 #endif
-#ifdef GDK_WINDOWING_WIN32
-            HGDIOBJ* w = reinterpret_cast<HGDIOBJ*>(value);
-            *w = GDK_WINDOW_HWND(m_parentFrame->view()->hostWindow()->platformWindow()->window);
+#if defined(GDK_WINDOWING_WIN32)
+        HGDIOBJ* w = reinterpret_cast<HGDIOBJ*>(value);
+        *w = GDK_WINDOW_HWND(m_parentFrame->view()->hostWindow()->platformWindow()->window);
 #endif
-            return NPERR_NO_ERROR;
-        }
+        return NPERR_NO_ERROR;
+     }
 
-        default:
-            return getValueStatic(variable, value);
+    default:
+        return getValueStatic(variable, value);
     }
 }
 
index 0554ea1..4e91d1a 100644 (file)
@@ -2422,6 +2422,8 @@ static void webkit_web_view_update_settings(WebKitWebView* webView)
     settings->setEditingBehavior(core(editingBehavior));
     settings->setAllowUniversalAccessFromFileURLs(enableUniversalAccessFromFileURI);
 
+    settings->setJavaEnabled(true);
+
     g_free(defaultEncoding);
     g_free(cursiveFontFamily);
     g_free(defaultFontFamily);