[BlackBerry] Upstream BlackBerry WebCoreSupport FrameNetworkingContextBlackBerry...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 9 Feb 2012 07:02:04 +0000 (07:02 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 9 Feb 2012 07:02:04 +0000 (07:02 +0000)
https://bugs.webkit.org/show_bug.cgi?id=78049

Patch by Jacky Jiang <zhajiang@rim.com> on 2012-02-08
Reviewed by Rob Buis.

Initial upstream, no new tests.

* blackberry/WebCoreSupport/FrameNetworkingContextBlackBerry.cpp: Added.
* blackberry/WebCoreSupport/FrameNetworkingContextBlackBerry.h: Added.
* blackberry/WebCoreSupport/IconDatabaseClientBlackBerry.cpp: Added.
* blackberry/WebCoreSupport/IconDatabaseClientBlackBerry.h: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@107183 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/ChangeLog
Source/WebKit/blackberry/WebCoreSupport/FrameNetworkingContextBlackBerry.cpp [new file with mode: 0644]
Source/WebKit/blackberry/WebCoreSupport/FrameNetworkingContextBlackBerry.h [new file with mode: 0644]
Source/WebKit/blackberry/WebCoreSupport/IconDatabaseClientBlackBerry.cpp [new file with mode: 0644]
Source/WebKit/blackberry/WebCoreSupport/IconDatabaseClientBlackBerry.h [new file with mode: 0644]

index a696cab..678b840 100644 (file)
@@ -1,3 +1,17 @@
+2012-02-08  Jacky Jiang  <zhajiang@rim.com>
+
+        [BlackBerry] Upstream BlackBerry WebCoreSupport FrameNetworkingContextBlackBerry and IconDatabaseClientBlackBerry classes
+        https://bugs.webkit.org/show_bug.cgi?id=78049
+
+        Reviewed by Rob Buis.
+
+        Initial upstream, no new tests.
+
+        * blackberry/WebCoreSupport/FrameNetworkingContextBlackBerry.cpp: Added.
+        * blackberry/WebCoreSupport/FrameNetworkingContextBlackBerry.h: Added.
+        * blackberry/WebCoreSupport/IconDatabaseClientBlackBerry.cpp: Added.
+        * blackberry/WebCoreSupport/IconDatabaseClientBlackBerry.h: Added.
+
 2012-02-08  Leo Yang  <leo.yang@torchmobile.com.cn>
 
         [BlackBerry] Upstream InspectorClientBlackBerry.{h, cpp}
diff --git a/Source/WebKit/blackberry/WebCoreSupport/FrameNetworkingContextBlackBerry.cpp b/Source/WebKit/blackberry/WebCoreSupport/FrameNetworkingContextBlackBerry.cpp
new file mode 100644 (file)
index 0000000..f6cdbce
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2010, 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
+ */
+
+#include "config.h"
+#include "FrameNetworkingContextBlackBerry.h"
+
+namespace WebCore {
+
+FrameNetworkingContextBlackBerry::FrameNetworkingContextBlackBerry(Frame* frame)
+    : FrameNetworkingContext(frame)
+{
+}
+
+PassRefPtr<FrameNetworkingContextBlackBerry> FrameNetworkingContextBlackBerry::create(Frame* frame)
+{
+    return adoptRef(new FrameNetworkingContextBlackBerry(frame));
+}
+
+}
diff --git a/Source/WebKit/blackberry/WebCoreSupport/FrameNetworkingContextBlackBerry.h b/Source/WebKit/blackberry/WebCoreSupport/FrameNetworkingContextBlackBerry.h
new file mode 100644 (file)
index 0000000..408b1ee
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2010, 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
+ */
+
+#ifndef FrameNetworkingContextBlackBerry_h
+#define FrameNetworkingContextBlackBerry_h
+
+#include "FrameNetworkingContext.h"
+
+namespace WebCore {
+
+class FrameNetworkingContextBlackBerry : public FrameNetworkingContext {
+public:
+    static PassRefPtr<FrameNetworkingContextBlackBerry> create(Frame*);
+    using FrameNetworkingContext::frame;
+
+private:
+    FrameNetworkingContextBlackBerry(Frame*);
+};
+
+}
+
+#endif // FrameNetworkingContextBlackBerry_h
diff --git a/Source/WebKit/blackberry/WebCoreSupport/IconDatabaseClientBlackBerry.cpp b/Source/WebKit/blackberry/WebCoreSupport/IconDatabaseClientBlackBerry.cpp
new file mode 100644 (file)
index 0000000..174de15
--- /dev/null
@@ -0,0 +1,88 @@
+/*
+ * 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
+ */
+
+#include "config.h"
+#include "IconDatabaseClientBlackBerry.h"
+
+#include "IconDatabase.h"
+#include "WebSettings.h"
+#include "WebString.h"
+
+namespace WebCore {
+
+IconDatabaseClientBlackBerry* IconDatabaseClientBlackBerry::getInstance()
+{
+    static IconDatabaseClientBlackBerry* instance = 0;
+    if (!instance)
+        instance = new IconDatabaseClientBlackBerry();
+    return instance;
+}
+
+bool IconDatabaseClientBlackBerry::initIconDatabase(const BlackBerry::WebKit::WebSettings* settings)
+{
+    bool enable = !settings->isPrivateBrowsingEnabled() && settings->isDatabasesEnabled();
+    iconDatabase().setEnabled(enable);
+    if (!enable) {
+        m_initState = NotInitialized;
+        return false;
+    }
+
+    if (m_initState == InitializeFailed)
+        return false;
+
+    if (m_initState == InitializeSucceeded)
+        return true;
+
+    iconDatabase().setClient(this);
+
+    BlackBerry::WebKit::WebString path = settings->databasePath();
+
+    if (path.isEmpty())
+        path = settings->localStoragePath();
+
+    m_initState = iconDatabase().open(path, IconDatabase::defaultDatabaseFilename()) ? InitializeSucceeded : InitializeFailed;
+
+    return m_initState == InitializeSucceeded;
+}
+
+bool IconDatabaseClientBlackBerry::performImport()
+{
+    return true;
+}
+
+void IconDatabaseClientBlackBerry::didRemoveAllIcons()
+{
+}
+
+void IconDatabaseClientBlackBerry::didImportIconURLForPageURL(const String&)
+{
+}
+
+void IconDatabaseClientBlackBerry::didImportIconDataForPageURL(const String&)
+{
+}
+
+void IconDatabaseClientBlackBerry::didChangeIconForPageURL(const String&)
+{
+}
+
+void IconDatabaseClientBlackBerry::didFinishURLImport()
+{
+}
+
+} // namespace WebCore
diff --git a/Source/WebKit/blackberry/WebCoreSupport/IconDatabaseClientBlackBerry.h b/Source/WebKit/blackberry/WebCoreSupport/IconDatabaseClientBlackBerry.h
new file mode 100644 (file)
index 0000000..c72a450
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * 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
+ */
+
+#ifndef IconDatabaseClientBlackBerry_h
+#define IconDatabaseClientBlackBerry_h
+
+#include "IconDatabaseClient.h"
+
+namespace BlackBerry {
+namespace WebKit {
+class WebSettings;
+}
+}
+
+namespace WebCore {
+
+class IconDatabaseClientBlackBerry : public IconDatabaseClient {
+public:
+    static IconDatabaseClientBlackBerry* getInstance();
+    bool initIconDatabase(const BlackBerry::WebKit::WebSettings*);
+
+    virtual bool performImport();
+    virtual void didRemoveAllIcons();
+    virtual void didImportIconURLForPageURL(const String&);
+    virtual void didImportIconDataForPageURL(const String&);
+    virtual void didChangeIconForPageURL(const String&);
+    virtual void didFinishURLImport();
+
+private:
+    IconDatabaseClientBlackBerry()
+        : m_initState(NotInitialized)
+    {
+    }
+    enum { NotInitialized, InitializeSucceeded, InitializeFailed } m_initState;
+};
+
+}
+
+#endif