Title: [150062] trunk/Source
Revision
150062
Author
commit-qu...@webkit.org
Date
2013-05-14 03:12:35 -0700 (Tue, 14 May 2013)

Log Message

[BlackBerry] Implement platform strategies
https://bugs.webkit.org/show_bug.cgi?id=112162

Patch by Carlos Garcia Campos <cgar...@igalia.com> on 2013-05-14
Reviewed by Rob Buis.

Source/WebCore:

This is just a refactoring, covered by existing tests.

* CMakeLists.txt: Move PlatformStrategies.cpp from platform
specific makefiles to the global one now that all platforms using
cmake implement platform strategies.
* PlatformBlackBerry.cmake:
* PlatformEfl.cmake:
* PlatformWinCE.cmake:
* loader/CookieJar.cpp: Remove the preprocessor error that is not
needed anymore.
* loader/blackberry/CookieJarBlackBerry.cpp: Removed.
* platform/network/blackberry/CookieJarBlackBerry.cpp: Added.
(WebCore):
(WebCore::setCookiesFromDOM):
(WebCore::cookiesForDOM):
(WebCore::cookieRequestHeaderFieldValue):
(WebCore::cookiesEnabled):
(WebCore::getRawCookies):
(WebCore::deleteCookie):
(WebCore::getHostnamesWithCookies):
(WebCore::deleteCookiesForHostname):
(WebCore::deleteAllCookies):
* plugins/blackberry/PluginDataBlackBerry.cpp: Removed.

Source/WebKit:

* PlatformBlackBerry.cmake: Add new files to compilation.

Source/WebKit/blackberry:

* Api/BlackBerryGlobal.cpp:
(BlackBerry::WebKit::globalInitialize): Initialize platform
strategies.
* WebCoreSupport/PlatformStrategiesBlackBerry.cpp: Added.
(PlatformStrategiesBlackBerry::initialize):
(PlatformStrategiesBlackBerry::PlatformStrategiesBlackBerry):
(PlatformStrategiesBlackBerry::createCookiesStrategy):
(PlatformStrategiesBlackBerry::createDatabaseStrategy):
(PlatformStrategiesBlackBerry::createLoaderStrategy):
(PlatformStrategiesBlackBerry::createPasteboardStrategy):
(PlatformStrategiesBlackBerry::createPluginStrategy):
(PlatformStrategiesBlackBerry::createSharedWorkerStrategy):
(PlatformStrategiesBlackBerry::createStorageStrategy):
(PlatformStrategiesBlackBerry::createVisitedLinkStrategy):
(PlatformStrategiesBlackBerry::cookiesForDOM):
(PlatformStrategiesBlackBerry::setCookiesFromDOM):
(PlatformStrategiesBlackBerry::cookiesEnabled):
(PlatformStrategiesBlackBerry::cookieRequestHeaderFieldValue):
(PlatformStrategiesBlackBerry::getRawCookies):
(PlatformStrategiesBlackBerry::deleteCookie):
(PlatformStrategiesBlackBerry::refreshPlugins):
(PlatformStrategiesBlackBerry::getPluginInfo):
(PlatformStrategiesBlackBerry::isLinkVisited):
(PlatformStrategiesBlackBerry::addVisitedLink):
* WebCoreSupport/PlatformStrategiesBlackBerry.h: Added.
(PlatformStrategiesBlackBerry):

Source/WTF:

* wtf/Platform.h: Add BlackBerry platform to the list of platforms
using platform strategies.

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (150061 => 150062)


--- trunk/Source/WTF/ChangeLog	2013-05-14 09:23:19 UTC (rev 150061)
+++ trunk/Source/WTF/ChangeLog	2013-05-14 10:12:35 UTC (rev 150062)
@@ -1,3 +1,13 @@
+2013-05-14  Carlos Garcia Campos  <cgar...@igalia.com>
+
+        [BlackBerry] Implement platform strategies
+        https://bugs.webkit.org/show_bug.cgi?id=112162
+
+        Reviewed by Rob Buis.
+
+        * wtf/Platform.h: Add BlackBerry platform to the list of platforms
+        using platform strategies.
+
 2013-05-13  Benjamin Poulain  <benja...@webkit.org>
 
         Improve stringProtoFuncLastIndexOf for the prefix case

Modified: trunk/Source/WTF/wtf/Platform.h (150061 => 150062)


--- trunk/Source/WTF/wtf/Platform.h	2013-05-14 09:23:19 UTC (rev 150061)
+++ trunk/Source/WTF/wtf/Platform.h	2013-05-14 10:12:35 UTC (rev 150062)
@@ -886,7 +886,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) || PLATFORM(EFL)
+#if PLATFORM(IOS) || PLATFORM(MAC) || PLATFORM(WIN) || PLATFORM(QT) || PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(BLACKBERRY)
 #define WTF_USE_PLATFORM_STRATEGIES 1
 #endif
 

Modified: trunk/Source/WebCore/CMakeLists.txt (150061 => 150062)


--- trunk/Source/WebCore/CMakeLists.txt	2013-05-14 09:23:19 UTC (rev 150061)
+++ trunk/Source/WebCore/CMakeLists.txt	2013-05-14 10:12:35 UTC (rev 150062)
@@ -1832,6 +1832,7 @@
     platform/NotImplemented.cpp
     platform/PlatformEvent.cpp
     platform/PlatformInstrumentation.cpp
+    platform/PlatformStrategies.cpp
     platform/RunLoop.cpp
     platform/RuntimeApplicationChecks.cpp
     platform/ScrollAnimator.cpp

Modified: trunk/Source/WebCore/ChangeLog (150061 => 150062)


--- trunk/Source/WebCore/ChangeLog	2013-05-14 09:23:19 UTC (rev 150061)
+++ trunk/Source/WebCore/ChangeLog	2013-05-14 10:12:35 UTC (rev 150062)
@@ -1,3 +1,34 @@
+2013-05-14  Carlos Garcia Campos  <cgar...@igalia.com>
+
+        [BlackBerry] Implement platform strategies
+        https://bugs.webkit.org/show_bug.cgi?id=112162
+
+        Reviewed by Rob Buis.
+
+        This is just a refactoring, covered by existing tests.
+
+        * CMakeLists.txt: Move PlatformStrategies.cpp from platform
+        specific makefiles to the global one now that all platforms using
+        cmake implement platform strategies.
+        * PlatformBlackBerry.cmake:
+        * PlatformEfl.cmake:
+        * PlatformWinCE.cmake:
+        * loader/CookieJar.cpp: Remove the preprocessor error that is not
+        needed anymore.
+        * loader/blackberry/CookieJarBlackBerry.cpp: Removed.
+        * platform/network/blackberry/CookieJarBlackBerry.cpp: Added.
+        (WebCore):
+        (WebCore::setCookiesFromDOM):
+        (WebCore::cookiesForDOM):
+        (WebCore::cookieRequestHeaderFieldValue):
+        (WebCore::cookiesEnabled):
+        (WebCore::getRawCookies):
+        (WebCore::deleteCookie):
+        (WebCore::getHostnamesWithCookies):
+        (WebCore::deleteCookiesForHostname):
+        (WebCore::deleteAllCookies):
+        * plugins/blackberry/PluginDataBlackBerry.cpp: Removed.
+
 2013-05-14  Jocelyn Turcotte  <jocelyn.turco...@digia.com>
 
         [Qt] Fix a crash under ~PingLoader when the QNAM on the page has been destroyed.

Modified: trunk/Source/WebCore/PlatformBlackBerry.cmake (150061 => 150062)


--- trunk/Source/WebCore/PlatformBlackBerry.cmake	2013-05-14 09:23:19 UTC (rev 150061)
+++ trunk/Source/WebCore/PlatformBlackBerry.cmake	2013-05-14 10:12:35 UTC (rev 150062)
@@ -44,6 +44,7 @@
     platform/network/NetworkStorageSessionStub.cpp
     platform/network/ProxyServer.cpp
     platform/network/blackberry/AutofillBackingStore.cpp
+    platform/network/blackberry/CookieJarBlackBerry.cpp
     platform/network/blackberry/DNSBlackBerry.cpp
     platform/network/blackberry/DeferredData.cpp
     platform/network/blackberry/NetworkJob.cpp
@@ -94,7 +95,6 @@
     editing/blackberry/EditorBlackBerry.cpp
     editing/blackberry/SmartReplaceBlackBerry.cpp
     html/shadow/MediaControlsBlackBerry.cpp
-    loader/blackberry/CookieJarBlackBerry.cpp
     page/blackberry/AccessibilityObjectBlackBerry.cpp
     page/blackberry/DragControllerBlackBerry.cpp
     page/blackberry/EventHandlerBlackBerry.cpp
@@ -204,7 +204,6 @@
 if (ENABLE_NETSCAPE_PLUGIN_API)
     list(APPEND WebCore_SOURCES
         plugins/blackberry/NPCallbacksBlackBerry.cpp
-        plugins/blackberry/PluginDataBlackBerry.cpp
         plugins/blackberry/PluginPackageBlackBerry.cpp
         plugins/blackberry/PluginViewBlackBerry.cpp
         plugins/blackberry/PluginViewPrivateBlackBerry.cpp

Modified: trunk/Source/WebCore/PlatformEfl.cmake (150061 => 150062)


--- trunk/Source/WebCore/PlatformEfl.cmake	2013-05-14 09:23:19 UTC (rev 150061)
+++ trunk/Source/WebCore/PlatformEfl.cmake	2013-05-14 10:12:35 UTC (rev 150062)
@@ -158,8 +158,6 @@
     platform/network/soup/SocketStreamHandleSoup.cpp
     platform/network/soup/SoupURIUtils.cpp
 
-    platform/PlatformStrategies.cpp
-
     platform/posix/FileSystemPOSIX.cpp
     platform/posix/SharedBufferPOSIX.cpp
 

Modified: trunk/Source/WebCore/PlatformWinCE.cmake (150061 => 150062)


--- trunk/Source/WebCore/PlatformWinCE.cmake	2013-05-14 09:23:19 UTC (rev 150061)
+++ trunk/Source/WebCore/PlatformWinCE.cmake	2013-05-14 10:12:35 UTC (rev 150062)
@@ -31,7 +31,6 @@
 
     platform/Cursor.cpp
     platform/LocalizedStrings.cpp
-    platform/PlatformStrategies.cpp
     platform/ScrollAnimatorNone.cpp
 
     platform/win/BitmapInfo.cpp

Modified: trunk/Source/WebCore/loader/CookieJar.cpp (150061 => 150062)


--- trunk/Source/WebCore/loader/CookieJar.cpp	2013-05-14 09:23:19 UTC (rev 150061)
+++ trunk/Source/WebCore/loader/CookieJar.cpp	2013-05-14 10:12:35 UTC (rev 150062)
@@ -37,10 +37,6 @@
 #include "PlatformStrategies.h"
 #endif
 
-#if PLATFORM(BLACKBERRY)
-#error Blackberry currently uses a fork of this file because of layering violations
-#endif
-
 namespace WebCore {
 
 static NetworkingContext* networkingContext(const Document* document)

Deleted: trunk/Source/WebCore/loader/blackberry/CookieJarBlackBerry.cpp (150061 => 150062)


--- trunk/Source/WebCore/loader/blackberry/CookieJarBlackBerry.cpp	2013-05-14 09:23:19 UTC (rev 150061)
+++ trunk/Source/WebCore/loader/blackberry/CookieJarBlackBerry.cpp	2013-05-14 10:12:35 UTC (rev 150062)
@@ -1,85 +0,0 @@
-/*
- * Copyright (C) 2011, 2012 Research In Motion Limited. All rights reserved.
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/
- * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved.
- */
-
-#include "config.h"
-#include "CookieJar.h"
-
-#include "Cookie.h"
-#include "CookieManager.h"
-#include "Document.h"
-#include "Frame.h"
-#include "FrameLoaderClientBlackBerry.h"
-#include "KURL.h"
-#include "NotImplemented.h"
-#include "Page.h"
-#include "PageGroupLoadDeferrer.h"
-#include "Settings.h"
-#include <wtf/text/CString.h>
-
-namespace WebCore {
-
-// FIXME: Unfork. This file is forked because all other platforms use NetworkingContext to access cookie jar, not Document or Frame.
-
-String cookies(Document const* document, KURL const& url)
-{
-    // 'HttpOnly' cookies should no be accessible from scripts, so we filter them out here
-    if (cookiesEnabled(document))
-        return cookieManager().getCookie(url, NoHttpOnlyCookie);
-    return String();
-
-}
-
-void setCookies(Document* document, KURL const& url, String const& value)
-{
-    if (cookiesEnabled(document))
-        cookieManager().setCookies(url, value, NoHttpOnlyCookie);
-}
-
-bool cookiesEnabled(const Document* document)
-{
-    return document && document->settings() && document->settings()->cookieEnabled();
-}
-
-bool getRawCookies(const Document*, const KURL& url, Vector<Cookie>& rawCookies)
-{
-    // Note: this method is called by inspector only. No need to check if cookie is enabled.
-    Vector<RefPtr<ParsedCookie> > result;
-    cookieManager().getRawCookies(result, url, WithHttpOnlyCookies);
-    for (size_t i = 0; i < result.size(); i++)
-        result[i]->appendWebCoreCookie(rawCookies);
-    return true;
-}
-
-void deleteCookie(const Document*, const KURL& url, const String& cookieName)
-{
-    // Cookies are not bound to the document. Therefore, we don't need to pass
-    // in the document object to find the targeted cookies in cookie manager.
-    // Note: this method is called by inspector only. No need to check if cookie is enabled.
-    cookieManager().removeCookieWithName(url, cookieName);
-}
-
-String cookieRequestHeaderFieldValue(const Document* document, const KURL &url)
-{
-    if (cookiesEnabled(document))
-        return cookieManager().getCookie(url, WithHttpOnlyCookies);
-    return String();
-}
-
-} // namespace WebCore

Added: trunk/Source/WebCore/platform/network/blackberry/CookieJarBlackBerry.cpp (0 => 150062)


--- trunk/Source/WebCore/platform/network/blackberry/CookieJarBlackBerry.cpp	                        (rev 0)
+++ trunk/Source/WebCore/platform/network/blackberry/CookieJarBlackBerry.cpp	2013-05-14 10:12:35 UTC (rev 150062)
@@ -0,0 +1,77 @@
+/*
+ * Copyright (C) 2013 Research In Motion Limited. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include "config.h"
+#include "PlatformCookieJar.h"
+
+#include "CookieManager.h"
+#include "NotImplemented.h"
+
+namespace WebCore {
+
+void setCookiesFromDOM(const NetworkStorageSession&, const KURL& /*firstParty*/, const KURL& url, const String& value)
+{
+    cookieManager().setCookies(url, value, NoHttpOnlyCookie);
+}
+
+String cookiesForDOM(const NetworkStorageSession&, const KURL& /*firstParty*/, const KURL& url)
+{
+    // 'HttpOnly' cookies should no be accessible from scripts, so we filter them out here.
+    return cookieManager().getCookie(url, NoHttpOnlyCookie);
+}
+
+String cookieRequestHeaderFieldValue(const NetworkStorageSession&, const KURL& /*firstParty*/, const KURL& url)
+{
+    return cookieManager().getCookie(url, WithHttpOnlyCookies);
+}
+
+bool cookiesEnabled(const NetworkStorageSession&, const KURL& /*firstParty*/, const KURL& /*url*/)
+{
+    return !cookieManager().cookieJar().isEmpty();
+}
+
+bool getRawCookies(const NetworkStorageSession&, const KURL& /*firstParty*/, const KURL& url, Vector<Cookie>& rawCookies)
+{
+    Vector<RefPtr<ParsedCookie> > result;
+    cookieManager().getRawCookies(result, url, WithHttpOnlyCookies);
+    for (size_t i = 0; i < result.size(); i++)
+        result[i]->appendWebCoreCookie(rawCookies);
+    return true;
+}
+
+void deleteCookie(const NetworkStorageSession&, const KURL& url, const String& name)
+{
+    cookieManager().removeCookieWithName(url, name);
+}
+
+void getHostnamesWithCookies(const NetworkStorageSession&, HashSet<String>& /*hostnames*/)
+{
+    notImplemented();
+}
+
+void deleteCookiesForHostname(const NetworkStorageSession&, const String& /*hostname*/)
+{
+    notImplemented();
+}
+
+void deleteAllCookies(const NetworkStorageSession&)
+{
+    notImplemented();
+}
+
+}

Deleted: trunk/Source/WebCore/plugins/blackberry/PluginDataBlackBerry.cpp (150061 => 150062)


--- trunk/Source/WebCore/plugins/blackberry/PluginDataBlackBerry.cpp	2013-05-14 09:23:19 UTC (rev 150061)
+++ trunk/Source/WebCore/plugins/blackberry/PluginDataBlackBerry.cpp	2013-05-14 10:12:35 UTC (rev 150062)
@@ -1,59 +0,0 @@
-/*
- * Copyright (C) 2011 Research In Motion Limited. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; 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*)
-{
-    PluginDatabase* db = PluginDatabase::installedPlugins();
-    const Vector<PluginPackage*>& plugins = db->plugins();
-
-    for (unsigned 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->key;
-            mime.desc = it->value;
-            mime.extensions = package->mimeToExtensions().get(mime.type);
-            info.mimes.append(mime);
-        }
-        m_plugins.append(info);
-    }
-}
-
-void PluginData::refresh()
-{
-    PluginDatabase* db = PluginDatabase::installedPlugins();
-    db->refresh();
-}
-
-} // namespace WebCore

Modified: trunk/Source/WebKit/ChangeLog (150061 => 150062)


--- trunk/Source/WebKit/ChangeLog	2013-05-14 09:23:19 UTC (rev 150061)
+++ trunk/Source/WebKit/ChangeLog	2013-05-14 10:12:35 UTC (rev 150062)
@@ -1,3 +1,12 @@
+2013-05-14  Carlos Garcia Campos  <cgar...@igalia.com>
+
+        [BlackBerry] Implement platform strategies
+        https://bugs.webkit.org/show_bug.cgi?id=112162
+
+        Reviewed by Rob Buis.
+
+        * PlatformBlackBerry.cmake: Add new files to compilation.
+
 2013-05-06  Roger Fong  <roger_f...@apple.com>
 
         Unreviewed. AppleWin VS2010 build fix.

Modified: trunk/Source/WebKit/PlatformBlackBerry.cmake (150061 => 150062)


--- trunk/Source/WebKit/PlatformBlackBerry.cmake	2013-05-14 09:23:19 UTC (rev 150061)
+++ trunk/Source/WebKit/PlatformBlackBerry.cmake	2013-05-14 10:12:35 UTC (rev 150062)
@@ -102,6 +102,7 @@
     blackberry/WebCoreSupport/NetworkInfoClientBlackBerry.cpp
     blackberry/WebCoreSupport/NotificationClientBlackBerry.cpp
     blackberry/WebCoreSupport/PagePopupBlackBerry.cpp
+    blackberry/WebCoreSupport/PlatformStrategiesBlackBerry.cpp
     blackberry/WebCoreSupport/NavigatorContentUtilsClientBlackBerry.cpp
     blackberry/WebCoreSupport/SelectPopupClient.cpp
     blackberry/WebCoreSupport/SuggestionBoxHandler.cpp

Modified: trunk/Source/WebKit/blackberry/Api/BlackBerryGlobal.cpp (150061 => 150062)


--- trunk/Source/WebKit/blackberry/Api/BlackBerryGlobal.cpp	2013-05-14 09:23:19 UTC (rev 150061)
+++ trunk/Source/WebKit/blackberry/Api/BlackBerryGlobal.cpp	2013-05-14 10:12:35 UTC (rev 150062)
@@ -33,6 +33,7 @@
 #include "NetworkStateNotifier.h"
 #include "PageCache.h"
 #include "PageGroup.h"
+#include "PlatformStrategiesBlackBerry.h"
 #include "Settings.h"
 #include "TextureCacheCompositingThread.h"
 #include "bindings/js/GCController.h"
@@ -74,6 +75,9 @@
     // we're grabbing callOnMainThread without using the rest of the threading support.
     WTF::initializeMainThread();
 
+    // Initialize our platform strategies.
+    PlatformStrategiesBlackBerry::initialize();
+
     // Set the minimal timer interval to 4 milliseconds.
     WebCore::Settings::setDefaultMinDOMTimerInterval(0.004);
 

Modified: trunk/Source/WebKit/blackberry/ChangeLog (150061 => 150062)


--- trunk/Source/WebKit/blackberry/ChangeLog	2013-05-14 09:23:19 UTC (rev 150061)
+++ trunk/Source/WebKit/blackberry/ChangeLog	2013-05-14 10:12:35 UTC (rev 150062)
@@ -1,5 +1,39 @@
 2013-05-14  Carlos Garcia Campos  <cgar...@igalia.com>
 
+        [BlackBerry] Implement platform strategies
+        https://bugs.webkit.org/show_bug.cgi?id=112162
+
+        Reviewed by Rob Buis.
+
+        * Api/BlackBerryGlobal.cpp:
+        (BlackBerry::WebKit::globalInitialize): Initialize platform
+        strategies.
+        * WebCoreSupport/PlatformStrategiesBlackBerry.cpp: Added.
+        (PlatformStrategiesBlackBerry::initialize):
+        (PlatformStrategiesBlackBerry::PlatformStrategiesBlackBerry):
+        (PlatformStrategiesBlackBerry::createCookiesStrategy):
+        (PlatformStrategiesBlackBerry::createDatabaseStrategy):
+        (PlatformStrategiesBlackBerry::createLoaderStrategy):
+        (PlatformStrategiesBlackBerry::createPasteboardStrategy):
+        (PlatformStrategiesBlackBerry::createPluginStrategy):
+        (PlatformStrategiesBlackBerry::createSharedWorkerStrategy):
+        (PlatformStrategiesBlackBerry::createStorageStrategy):
+        (PlatformStrategiesBlackBerry::createVisitedLinkStrategy):
+        (PlatformStrategiesBlackBerry::cookiesForDOM):
+        (PlatformStrategiesBlackBerry::setCookiesFromDOM):
+        (PlatformStrategiesBlackBerry::cookiesEnabled):
+        (PlatformStrategiesBlackBerry::cookieRequestHeaderFieldValue):
+        (PlatformStrategiesBlackBerry::getRawCookies):
+        (PlatformStrategiesBlackBerry::deleteCookie):
+        (PlatformStrategiesBlackBerry::refreshPlugins):
+        (PlatformStrategiesBlackBerry::getPluginInfo):
+        (PlatformStrategiesBlackBerry::isLinkVisited):
+        (PlatformStrategiesBlackBerry::addVisitedLink):
+        * WebCoreSupport/PlatformStrategiesBlackBerry.h: Added.
+        (PlatformStrategiesBlackBerry):
+
+2013-05-14  Carlos Garcia Campos  <cgar...@igalia.com>
+
         [BlackBerry] Crash due to an assert in FrameView::doDeferredRepaints
         https://bugs.webkit.org/show_bug.cgi?id=115412
 

Added: trunk/Source/WebKit/blackberry/WebCoreSupport/PlatformStrategiesBlackBerry.cpp (0 => 150062)


--- trunk/Source/WebKit/blackberry/WebCoreSupport/PlatformStrategiesBlackBerry.cpp	                        (rev 0)
+++ trunk/Source/WebKit/blackberry/WebCoreSupport/PlatformStrategiesBlackBerry.cpp	2013-05-14 10:12:35 UTC (rev 150062)
@@ -0,0 +1,162 @@
+/*
+ * Copyright (C) 2013 Research In Motion Limited. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include "config.h"
+#include "PlatformStrategiesBlackBerry.h"
+
+#include "NotImplemented.h"
+#include "Page.h"
+#include "PageGroup.h"
+#include "PlatformCookieJar.h"
+#include "PluginDatabase.h"
+#include "PluginPackage.h"
+
+using namespace WebCore;
+
+void PlatformStrategiesBlackBerry::initialize()
+{
+    DEFINE_STATIC_LOCAL(PlatformStrategiesBlackBerry, platformStrategies, ());
+    setPlatformStrategies(&platformStrategies);
+}
+
+PlatformStrategiesBlackBerry::PlatformStrategiesBlackBerry()
+{
+}
+
+CookiesStrategy* PlatformStrategiesBlackBerry::createCookiesStrategy()
+{
+    return this;
+}
+
+DatabaseStrategy* PlatformStrategiesBlackBerry::createDatabaseStrategy()
+{
+    return this;
+}
+
+LoaderStrategy* PlatformStrategiesBlackBerry::createLoaderStrategy()
+{
+    return this;
+}
+
+PasteboardStrategy* PlatformStrategiesBlackBerry::createPasteboardStrategy()
+{
+    // This is currently used only by Mac.
+    notImplemented();
+    return 0;
+}
+
+PluginStrategy* PlatformStrategiesBlackBerry::createPluginStrategy()
+{
+    return this;
+}
+
+SharedWorkerStrategy* PlatformStrategiesBlackBerry::createSharedWorkerStrategy()
+{
+    return this;
+}
+
+StorageStrategy* PlatformStrategiesBlackBerry::createStorageStrategy()
+{
+    return this;
+}
+
+VisitedLinkStrategy* PlatformStrategiesBlackBerry::createVisitedLinkStrategy()
+{
+    return this;
+}
+
+// CookiesStrategy
+String PlatformStrategiesBlackBerry::cookiesForDOM(const NetworkStorageSession& session, const KURL& firstParty, const KURL& url)
+{
+    return WebCore::cookiesForDOM(session, firstParty, url);
+}
+
+void PlatformStrategiesBlackBerry::setCookiesFromDOM(const NetworkStorageSession& session, const KURL& firstParty, const KURL& url, const String& cookieString)
+{
+    WebCore::setCookiesFromDOM(session, firstParty, url, cookieString);
+}
+
+bool PlatformStrategiesBlackBerry::cookiesEnabled(const NetworkStorageSession& session, const KURL& firstParty, const KURL& url)
+{
+    return WebCore::cookiesEnabled(session, firstParty, url);
+}
+
+String PlatformStrategiesBlackBerry::cookieRequestHeaderFieldValue(const NetworkStorageSession& session, const KURL& firstParty, const KURL& url)
+{
+    return WebCore::cookieRequestHeaderFieldValue(session, firstParty, url);
+}
+
+bool PlatformStrategiesBlackBerry::getRawCookies(const NetworkStorageSession& session, const KURL& firstParty, const KURL& url, Vector<Cookie>& rawCookies)
+{
+    return WebCore::getRawCookies(session, firstParty, url, rawCookies);
+}
+
+void PlatformStrategiesBlackBerry::deleteCookie(const NetworkStorageSession& session, const KURL& url, const String& cookieName)
+{
+    WebCore::deleteCookie(session, url, cookieName);
+}
+
+// PluginStrategy
+void PlatformStrategiesBlackBerry::refreshPlugins()
+{
+#if ENABLE(NETSCAPE_PLUGIN_API)
+    PluginDatabase::installedPlugins()->refresh();
+#endif
+}
+
+void PlatformStrategiesBlackBerry::getPluginInfo(const Page*, Vector<PluginInfo>& outPlugins)
+{
+#if ENABLE(NETSCAPE_PLUGIN_API)
+    PluginDatabase* database = PluginDatabase::installedPlugins();
+    const Vector<PluginPackage*> &plugins = database->plugins();
+
+    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->key;
+            mime.desc = it->value;
+            mime.extensions = package->mimeToExtensions().get(mime.type);
+            pluginInfo.mimes.append(mime);
+        }
+
+        outPlugins.append(pluginInfo);
+    }
+#else
+    UNUSED_PARAM(outPlugins);
+#endif
+}
+
+// VisitedLinkStrategy
+bool PlatformStrategiesBlackBerry::isLinkVisited(Page* page, LinkHash hash, const KURL&, const AtomicString&)
+{
+    return page->group().isLinkVisited(hash);
+}
+
+void PlatformStrategiesBlackBerry::addVisitedLink(Page* page, LinkHash hash)
+{
+    page->group().addVisitedLinkHash(hash);
+}

Added: trunk/Source/WebKit/blackberry/WebCoreSupport/PlatformStrategiesBlackBerry.h (0 => 150062)


--- trunk/Source/WebKit/blackberry/WebCoreSupport/PlatformStrategiesBlackBerry.h	                        (rev 0)
+++ trunk/Source/WebKit/blackberry/WebCoreSupport/PlatformStrategiesBlackBerry.h	2013-05-14 10:12:35 UTC (rev 150062)
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2013 Research In Motion Limited. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#ifndef PlatformStrategiesBlackBerry_h
+#define PlatformStrategiesBlackBerry_h
+
+#include "CookiesStrategy.h"
+#include "DatabaseStrategy.h"
+#include "LoaderStrategy.h"
+#include "PasteboardStrategy.h"
+#include "PlatformStrategies.h"
+#include "PluginStrategy.h"
+#include "SharedWorkerStrategy.h"
+#include "StorageStrategy.h"
+#include "VisitedLinkStrategy.h"
+
+class PlatformStrategiesBlackBerry : public WebCore::PlatformStrategies, private WebCore::CookiesStrategy, private WebCore::DatabaseStrategy, private WebCore::LoaderStrategy, private WebCore::PluginStrategy, private WebCore::SharedWorkerStrategy, private WebCore::StorageStrategy, private WebCore::VisitedLinkStrategy {
+public:
+    static void initialize();
+
+private:
+    PlatformStrategiesBlackBerry();
+
+    // WebCore::PlatformStrategies
+    virtual WebCore::CookiesStrategy* createCookiesStrategy();
+    virtual WebCore::DatabaseStrategy* createDatabaseStrategy();
+    virtual WebCore::LoaderStrategy* createLoaderStrategy();
+    virtual WebCore::PasteboardStrategy* createPasteboardStrategy();
+    virtual WebCore::PluginStrategy* createPluginStrategy();
+    virtual WebCore::SharedWorkerStrategy* createSharedWorkerStrategy();
+    virtual WebCore::StorageStrategy* createStorageStrategy();
+    virtual WebCore::VisitedLinkStrategy* createVisitedLinkStrategy();
+
+    // WebCore::CookiesStrategy
+    virtual String cookiesForDOM(const WebCore::NetworkStorageSession&, const WebCore::KURL& firstParty, const WebCore::KURL&);
+    virtual void setCookiesFromDOM(const WebCore::NetworkStorageSession&, const WebCore::KURL& firstParty, const WebCore::KURL&, const String&);
+    virtual bool cookiesEnabled(const WebCore::NetworkStorageSession&, const WebCore::KURL& firstParty, const WebCore::KURL&);
+    virtual String cookieRequestHeaderFieldValue(const WebCore::NetworkStorageSession&, const WebCore::KURL& firstParty, const WebCore::KURL&);
+    virtual bool getRawCookies(const WebCore::NetworkStorageSession&, const WebCore::KURL& firstParty, const WebCore::KURL&, Vector<WebCore::Cookie>&);
+    virtual void deleteCookie(const WebCore::NetworkStorageSession&, const WebCore::KURL&, const String&);
+
+    // WebCore::DatabaseStrategy
+    // - Using default implementation.
+
+    // 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 // PlatformStrategiesBlackBerry_h
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to