Title: [119208] trunk/Source
Revision
119208
Author
[email protected]
Date
2012-06-01 03:45:22 -0700 (Fri, 01 Jun 2012)

Log Message

[EFL] Implement PlatformStrategies
https://bugs.webkit.org/show_bug.cgi?id=86946

Source/WebCore:

Patch by Sudarsana Nagineni <[email protected]> on 2012-06-01
Reviewed by Carlos Garcia Campos.

* PlatformEfl.cmake: Add PlatformStrategies.cpp file to the build system.
Also, remove PluginDataEfl.cpp because the same functionality is now
implemented in PlatformStrategiesEfl.cpp.

Source/WebKit:

Patch by Sudarsana Nagineni <[email protected]> on 2012-06-01
Reviewed by Carlos Garcia Campos.

* PlatformEfl.cmake: Add PlatformStrategiesEfl file to the build
system.

Source/WebKit/efl:

Patch by Sudarsana Nagineni <[email protected]> on 2012-06-01
Reviewed by Carlos Garcia Campos.

Enable PLATFORM_STRATEGIES for EFL platform.

* WebCoreSupport/PlatformStrategiesEfl.cpp: Added, code was moved
from platform/PluginDataEfl.
(PlatformStrategiesEfl::initialize): Initialize platform strategies.
(PlatformStrategiesEfl::PlatformStrategiesEfl):
(PlatformStrategiesEfl::createCookiesStrategy): Return this.
(PlatformStrategiesEfl::createPluginStrategy): Ditto.
(PlatformStrategiesEfl::createVisitedLinkStrategy): Ditto.
(PlatformStrategiesEfl::createPasteboardStrategy): Return 0, since
PasteboardStrategy is only used by mac code for now.
(PlatformStrategiesEfl::notifyCookiesChanged):
(PlatformStrategiesEfl::refreshPlugins): Refresh the plugin
database. Code executes only when NETSCAPE_PLUGIN_API is ON.
(PlatformStrategiesEfl::getPluginInfo): Initialize plugins and
populate the given vector with plugins information. Code executes
only when NETSCAPE_PLUGIN_API is ON.
(PlatformStrategiesEfl::isLinkVisited): Return whether the given
hash is a visited link of the page group.
(PlatformStrategiesEfl::addVisitedLink): Add the given hash to the
page group visited links.
* WebCoreSupport/PlatformStrategiesEfl.h: Added.
(PlatformStrategiesEfl):
* ewk/ewk_main.cpp: Initialize PlatformStrategiesEfl.
(_ewk_init_body):

Source/WTF:

Patch by Sudarsana Nagineni <[email protected]> on 2012-06-01
Reviewed by Carlos Garcia Campos.

* wtf/Platform.h: Enable PLATFORM_STRATEGIES for EFL platform.

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (119207 => 119208)


--- trunk/Source/WTF/ChangeLog	2012-06-01 10:39:05 UTC (rev 119207)
+++ trunk/Source/WTF/ChangeLog	2012-06-01 10:45:22 UTC (rev 119208)
@@ -1,3 +1,12 @@
+2012-06-01  Sudarsana Nagineni  <[email protected]>
+
+        [EFL] Implement PlatformStrategies
+        https://bugs.webkit.org/show_bug.cgi?id=86946
+
+        Reviewed by Carlos Garcia Campos.
+
+        * wtf/Platform.h: Enable PLATFORM_STRATEGIES for EFL platform.
+
 2012-05-31  Anders Carlsson  <[email protected]>
 
         Enable support for rvalue references when building with a version of clang that supports them

Modified: trunk/Source/WTF/wtf/Platform.h (119207 => 119208)


--- trunk/Source/WTF/wtf/Platform.h	2012-06-01 10:39:05 UTC (rev 119207)
+++ trunk/Source/WTF/wtf/Platform.h	2012-06-01 10:45:22 UTC (rev 119208)
@@ -1024,7 +1024,7 @@
 #define WTF_PLATFORM_CFNETWORK Error USE_macro_should_be_used_with_CFNETWORK
 
 /* FIXME: Eventually we should enable this for all platforms and get rid of the define. */
-#if PLATFORM(IOS) || PLATFORM(MAC) || PLATFORM(WIN) || PLATFORM(QT) || PLATFORM(GTK)
+#if PLATFORM(IOS) || PLATFORM(MAC) || PLATFORM(WIN) || PLATFORM(QT) || PLATFORM(GTK) || PLATFORM(EFL)
 #define WTF_USE_PLATFORM_STRATEGIES 1
 #endif
 

Modified: trunk/Source/WebCore/ChangeLog (119207 => 119208)


--- trunk/Source/WebCore/ChangeLog	2012-06-01 10:39:05 UTC (rev 119207)
+++ trunk/Source/WebCore/ChangeLog	2012-06-01 10:45:22 UTC (rev 119208)
@@ -1,3 +1,14 @@
+2012-06-01  Sudarsana Nagineni  <[email protected]>
+
+        [EFL] Implement PlatformStrategies
+        https://bugs.webkit.org/show_bug.cgi?id=86946
+
+        Reviewed by Carlos Garcia Campos.
+
+        * PlatformEfl.cmake: Add PlatformStrategies.cpp file to the build system.
+        Also, remove PluginDataEfl.cpp because the same functionality is now
+        implemented in PlatformStrategiesEfl.cpp.
+
 2012-06-01  Adam Barth  <[email protected]>
 
         ASSERT(m_fontSelector->document()) is bogus and should be removed

Modified: trunk/Source/WebCore/PlatformEfl.cmake (119207 => 119208)


--- trunk/Source/WebCore/PlatformEfl.cmake	2012-06-01 10:39:05 UTC (rev 119207)
+++ trunk/Source/WebCore/PlatformEfl.cmake	2012-06-01 10:45:22 UTC (rev 119208)
@@ -83,6 +83,7 @@
   platform/network/soup/ResourceResponseSoup.cpp
   platform/network/soup/SocketStreamHandleSoup.cpp
   platform/network/soup/SoupURIUtils.cpp
+  platform/PlatformStrategies.cpp
   platform/posix/FileSystemPOSIX.cpp
   platform/text/efl/TextBreakIteratorInternalICUEfl.cpp
 )
@@ -95,13 +96,11 @@
     plugins/PluginStream.cpp
     plugins/PluginView.cpp
 
-    plugins/efl/PluginDataEfl.cpp
     plugins/efl/PluginPackageEfl.cpp
     plugins/efl/PluginViewEfl.cpp
   )
 ELSE ()
   LIST(APPEND WebCore_SOURCES
-    plugins/PluginDataNone.cpp
     plugins/PluginPackageNone.cpp
     plugins/PluginViewNone.cpp
   )

Deleted: trunk/Source/WebCore/plugins/efl/PluginDataEfl.cpp (119207 => 119208)


--- trunk/Source/WebCore/plugins/efl/PluginDataEfl.cpp	2012-06-01 10:39:05 UTC (rev 119207)
+++ trunk/Source/WebCore/plugins/efl/PluginDataEfl.cpp	2012-06-01 10:45:22 UTC (rev 119208)
@@ -1,66 +0,0 @@
-/*
-    Copyright (C) 2006, 2007 Apple Inc.  All rights reserved.
-    Copyright (C) 2008 Trolltech ASA
-    Copyright (C) 2008 Collabora Ltd. All rights reserved.
-    Copyright (C) 2008 INdT - Instituto Nokia de Tecnologia
-    Copyright (C) 2009-2010 ProFUSION embedded systems
-    Copyright (C) 2009-2011 Samsung Electronics
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Library General Public
-    License as published by the Free Software Foundation; either
-    version 2 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Library General Public License for more details.
-
-    You should have received a copy of the GNU Library General Public License
-    along with this library; see the file COPYING.LIB.  If not, write to
-    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-    Boston, MA 02110-1301, USA.
-*/
-
-#include "config.h"
-#include "PluginData.h"
-
-#include "PluginDatabase.h"
-#include "PluginPackage.h"
-
-namespace WebCore {
-
-void PluginData::initPlugins(const Page*)
-{
-    const Vector<PluginPackage*>& plugins = PluginDatabase::installedPlugins()->plugins();
-
-    for (size_t i = 0; i < plugins.size(); ++i) {
-        PluginPackage* package = plugins[i];
-        PluginInfo info;
-
-        info.name = package->name();
-        info.file = package->fileName();
-        info.desc = package->description();
-
-        const MIMEToDescriptionsMap& mimeToDescriptions = package->mimeToDescriptions();
-        MIMEToDescriptionsMap::const_iterator end = mimeToDescriptions.end();
-        for (MIMEToDescriptionsMap::const_iterator it = mimeToDescriptions.begin(); it != end; ++it) {
-            MimeClassInfo mime;
-
-            mime.type = it->first;
-            mime.desc = it->second;
-            mime.extensions = package->mimeToExtensions().get(mime.type);
-
-            info.mimes.append(mime);
-        }
-
-        m_plugins.append(info);
-    }
-}
-
-void PluginData::refresh()
-{
-    PluginDatabase::installedPlugins()->refresh();
-}
-
-};

Modified: trunk/Source/WebKit/ChangeLog (119207 => 119208)


--- trunk/Source/WebKit/ChangeLog	2012-06-01 10:39:05 UTC (rev 119207)
+++ trunk/Source/WebKit/ChangeLog	2012-06-01 10:45:22 UTC (rev 119208)
@@ -1,3 +1,13 @@
+2012-06-01  Sudarsana Nagineni  <[email protected]>
+
+        [EFL] Implement PlatformStrategies
+        https://bugs.webkit.org/show_bug.cgi?id=86946
+
+        Reviewed by Carlos Garcia Campos.
+
+        * PlatformEfl.cmake: Add PlatformStrategiesEfl file to the build
+        system.
+
 2012-05-31  Gyuyoung Kim  <[email protected]>
 
         [CMAKE][EFL] Remove unneeded include path

Modified: trunk/Source/WebKit/PlatformEfl.cmake (119207 => 119208)


--- trunk/Source/WebKit/PlatformEfl.cmake	2012-06-01 10:39:05 UTC (rev 119207)
+++ trunk/Source/WebKit/PlatformEfl.cmake	2012-06-01 10:45:22 UTC (rev 119208)
@@ -98,6 +98,7 @@
     efl/WebCoreSupport/InspectorClientEfl.cpp
     efl/WebCoreSupport/NotificationPresenterClientEfl.cpp
     efl/WebCoreSupport/PageClientEfl.cpp
+    efl/WebCoreSupport/PlatformStrategiesEfl.cpp 
 
     efl/ewk/ewk_auth.cpp
     efl/ewk/ewk_auth_soup.cpp

Modified: trunk/Source/WebKit/efl/ChangeLog (119207 => 119208)


--- trunk/Source/WebKit/efl/ChangeLog	2012-06-01 10:39:05 UTC (rev 119207)
+++ trunk/Source/WebKit/efl/ChangeLog	2012-06-01 10:45:22 UTC (rev 119208)
@@ -1,3 +1,36 @@
+2012-06-01  Sudarsana Nagineni  <[email protected]>
+
+        [EFL] Implement PlatformStrategies
+        https://bugs.webkit.org/show_bug.cgi?id=86946
+
+        Reviewed by Carlos Garcia Campos.                 
+
+        Enable PLATFORM_STRATEGIES for EFL platform.
+
+        * WebCoreSupport/PlatformStrategiesEfl.cpp: Added, code was moved
+        from platform/PluginDataEfl.
+        (PlatformStrategiesEfl::initialize): Initialize platform strategies.
+        (PlatformStrategiesEfl::PlatformStrategiesEfl):
+        (PlatformStrategiesEfl::createCookiesStrategy): Return this.
+        (PlatformStrategiesEfl::createPluginStrategy): Ditto.
+        (PlatformStrategiesEfl::createVisitedLinkStrategy): Ditto.
+        (PlatformStrategiesEfl::createPasteboardStrategy): Return 0, since
+        PasteboardStrategy is only used by mac code for now.
+        (PlatformStrategiesEfl::notifyCookiesChanged): 
+        (PlatformStrategiesEfl::refreshPlugins): Refresh the plugin
+        database. Code executes only when NETSCAPE_PLUGIN_API is ON.
+        (PlatformStrategiesEfl::getPluginInfo): Initialize plugins and
+        populate the given vector with plugins information. Code executes
+        only when NETSCAPE_PLUGIN_API is ON.
+        (PlatformStrategiesEfl::isLinkVisited): Return whether the given
+        hash is a visited link of the page group.
+        (PlatformStrategiesEfl::addVisitedLink): Add the given hash to the
+        page group visited links.
+        * WebCoreSupport/PlatformStrategiesEfl.h: Added.
+        (PlatformStrategiesEfl):
+        * ewk/ewk_main.cpp: Initialize PlatformStrategiesEfl.
+        (_ewk_init_body):
+
 2012-05-31  Alexander Shalamov  <[email protected]>
 
         [EFL] <input type="number"> is not a spinbutton

Added: trunk/Source/WebKit/efl/WebCoreSupport/PlatformStrategiesEfl.cpp (0 => 119208)


--- trunk/Source/WebKit/efl/WebCoreSupport/PlatformStrategiesEfl.cpp	                        (rev 0)
+++ trunk/Source/WebKit/efl/WebCoreSupport/PlatformStrategiesEfl.cpp	2012-06-01 10:45:22 UTC (rev 119208)
@@ -0,0 +1,122 @@
+/*
+    Copyright (C) 2006, 2007 Apple Inc.  All rights reserved.
+    Copyright (C) 2008 Trolltech ASA
+    Copyright (C) 2008 Collabora Ltd. All rights reserved.
+    Copyright (C) 2008 INdT - Instituto Nokia de Tecnologia
+    Copyright (C) 2009-2010 ProFUSION embedded systems
+    Copyright (C) 2009-2011 Samsung Electronics
+    Copyright (C) 2012 Intel Corporation
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+
+#include "config.h"
+#include "PlatformStrategiesEfl.h"
+
+#include "NotImplemented.h"
+#include "Page.h"
+#include "PageGroup.h"
+#include "PluginDatabase.h"
+#include "PluginPackage.h"
+
+using namespace WebCore;
+
+void PlatformStrategiesEfl::initialize()
+{
+    DEFINE_STATIC_LOCAL(PlatformStrategiesEfl, platformStrategies, ());
+    setPlatformStrategies(&platformStrategies);
+}
+
+PlatformStrategiesEfl::PlatformStrategiesEfl()
+{
+}
+
+// CookiesStrategy
+CookiesStrategy* PlatformStrategiesEfl::createCookiesStrategy()
+{
+    return this;
+}
+
+// PluginStrategy
+PluginStrategy* PlatformStrategiesEfl::createPluginStrategy()
+{
+    return this;
+}
+
+VisitedLinkStrategy* PlatformStrategiesEfl::createVisitedLinkStrategy()
+{
+    return this;
+}
+
+PasteboardStrategy* PlatformStrategiesEfl::createPasteboardStrategy()
+{
+    notImplemented();
+    return 0;
+}
+
+// CookiesStrategy
+void PlatformStrategiesEfl::notifyCookiesChanged()
+{
+}
+
+void PlatformStrategiesEfl::refreshPlugins()
+{
+#if ENABLE(NETSCAPE_PLUGIN_API)
+    PluginDatabase::installedPlugins()->refresh();
+#endif
+}
+
+void PlatformStrategiesEfl::getPluginInfo(const Page* page, Vector<PluginInfo>& outPlugins)
+{
+#if ENABLE(NETSCAPE_PLUGIN_API)
+    PluginDatabase::installedPlugins()->refresh();
+    const Vector<PluginPackage*>& plugins = PluginDatabase::installedPlugins()->plugins();
+    outPlugins.resize(plugins.size());
+
+    for (size_t i = 0; i < plugins.size(); ++i) {
+        PluginPackage* package = plugins[i];
+
+        PluginInfo pluginInfo;
+        pluginInfo.name = package->name();
+        pluginInfo.file = package->fileName();
+        pluginInfo.desc = package->description();
+
+        const MIMEToDescriptionsMap& mimeToDescriptions = package->mimeToDescriptions();
+        MIMEToDescriptionsMap::const_iterator end = mimeToDescriptions.end();
+        for (MIMEToDescriptionsMap::const_iterator it = mimeToDescriptions.begin(); it != end; ++it) {
+            MimeClassInfo mime;
+
+            mime.type = it->first;
+            mime.desc = it->second;
+            mime.extensions = package->mimeToExtensions().get(mime.type);
+            pluginInfo.mimes.append(mime);
+        }
+
+        outPlugins.append(pluginInfo);
+    }
+#endif
+}
+
+// VisitedLinkStrategy
+bool PlatformStrategiesEfl::isLinkVisited(Page* page, LinkHash hash, const KURL&, const AtomicString&)
+{
+    return page->group().isLinkVisited(hash);
+}
+
+void PlatformStrategiesEfl::addVisitedLink(Page* page, LinkHash hash)
+{
+    page->group().addVisitedLinkHash(hash);
+}

Added: trunk/Source/WebKit/efl/WebCoreSupport/PlatformStrategiesEfl.h (0 => 119208)


--- trunk/Source/WebKit/efl/WebCoreSupport/PlatformStrategiesEfl.h	                        (rev 0)
+++ trunk/Source/WebKit/efl/WebCoreSupport/PlatformStrategiesEfl.h	2012-06-01 10:45:22 UTC (rev 119208)
@@ -0,0 +1,54 @@
+/*
+    Copyright (C) 2012 Intel Corporation
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+
+#ifndef PlatformStrategiesEfl_h
+#define PlatformStrategiesEfl_h
+
+#include "CookiesStrategy.h"
+#include "PasteboardStrategy.h"
+#include "PlatformStrategies.h"
+#include "PluginStrategy.h"
+#include "VisitedLinkStrategy.h"
+
+class PlatformStrategiesEfl : public WebCore::PlatformStrategies, private WebCore::CookiesStrategy, private WebCore::PluginStrategy, private WebCore::VisitedLinkStrategy {
+public:
+    static void initialize();
+
+private:
+    PlatformStrategiesEfl();
+
+    // WebCore::PlatformStrategies
+    virtual WebCore::CookiesStrategy* createCookiesStrategy();
+    virtual WebCore::PluginStrategy* createPluginStrategy();
+    virtual WebCore::VisitedLinkStrategy* createVisitedLinkStrategy();
+    virtual WebCore::PasteboardStrategy* createPasteboardStrategy();
+
+    // WebCore::CookiesStrategy
+    virtual void notifyCookiesChanged();
+
+    // WebCore::PluginStrategy
+    virtual void refreshPlugins();
+    virtual void getPluginInfo(const WebCore::Page*, Vector<WebCore::PluginInfo>&);
+
+    // WebCore::VisitedLinkStrategy
+    virtual bool isLinkVisited(WebCore::Page*, WebCore::LinkHash, const WebCore::KURL& baseURL, const WTF::AtomicString& attributeURL);
+    virtual void addVisitedLink(WebCore::Page*, WebCore::LinkHash);
+};
+
+#endif // PlatformStrategiesEfl_h

Modified: trunk/Source/WebKit/efl/ewk/ewk_main.cpp (119207 => 119208)


--- trunk/Source/WebKit/efl/ewk/ewk_main.cpp	2012-06-01 10:39:05 UTC (rev 119207)
+++ trunk/Source/WebKit/efl/ewk/ewk_main.cpp	2012-06-01 10:45:22 UTC (rev 119208)
@@ -25,6 +25,7 @@
 #include "Logging.h"
 #include "PageCache.h"
 #include "PageGroup.h"
+#include "PlatformStrategiesEfl.h"
 #include "ResourceHandle.h"
 #include "ScriptController.h"
 #include "Settings.h"
@@ -148,6 +149,8 @@
     WebCore::initializeLoggingChannelsIfNecessary();
     WebCore::Settings::setDefaultMinDOMTimerInterval(0.004);
 
+    PlatformStrategiesEfl::initialize();
+
     // Page cache capacity (in pages). Comment from Mac port:
     // (Research indicates that value / page drops substantially after 3 pages.)
     // FIXME: Calculate based on available resources
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to