Diff
Modified: trunk/Source/WebKit/ChangeLog (107182 => 107183)
--- trunk/Source/WebKit/ChangeLog 2012-02-09 06:58:35 UTC (rev 107182)
+++ trunk/Source/WebKit/ChangeLog 2012-02-09 07:02:04 UTC (rev 107183)
@@ -1,3 +1,17 @@
+2012-02-08 Jacky Jiang <[email protected]>
+
+ [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 <[email protected]>
[BlackBerry] Upstream InspectorClientBlackBerry.{h, cpp}
Added: trunk/Source/WebKit/blackberry/WebCoreSupport/FrameNetworkingContextBlackBerry.cpp (0 => 107183)
--- trunk/Source/WebKit/blackberry/WebCoreSupport/FrameNetworkingContextBlackBerry.cpp (rev 0)
+++ trunk/Source/WebKit/blackberry/WebCoreSupport/FrameNetworkingContextBlackBerry.cpp 2012-02-09 07:02:04 UTC (rev 107183)
@@ -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));
+}
+
+}
Added: trunk/Source/WebKit/blackberry/WebCoreSupport/FrameNetworkingContextBlackBerry.h (0 => 107183)
--- trunk/Source/WebKit/blackberry/WebCoreSupport/FrameNetworkingContextBlackBerry.h (rev 0)
+++ trunk/Source/WebKit/blackberry/WebCoreSupport/FrameNetworkingContextBlackBerry.h 2012-02-09 07:02:04 UTC (rev 107183)
@@ -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
Added: trunk/Source/WebKit/blackberry/WebCoreSupport/IconDatabaseClientBlackBerry.cpp (0 => 107183)
--- trunk/Source/WebKit/blackberry/WebCoreSupport/IconDatabaseClientBlackBerry.cpp (rev 0)
+++ trunk/Source/WebKit/blackberry/WebCoreSupport/IconDatabaseClientBlackBerry.cpp 2012-02-09 07:02:04 UTC (rev 107183)
@@ -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
Added: trunk/Source/WebKit/blackberry/WebCoreSupport/IconDatabaseClientBlackBerry.h (0 => 107183)
--- trunk/Source/WebKit/blackberry/WebCoreSupport/IconDatabaseClientBlackBerry.h (rev 0)
+++ trunk/Source/WebKit/blackberry/WebCoreSupport/IconDatabaseClientBlackBerry.h 2012-02-09 07:02:04 UTC (rev 107183)
@@ -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