upstream BlackBerry porting of KURL/Logging
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Dec 2011 06:26:36 +0000 (06:26 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Dec 2011 06:26:36 +0000 (06:26 +0000)
https://bugs.webkit.org/show_bug.cgi?id=73524

Patch by Mary Wu <mary.wu@torchmobile.com.cn> on 2011-12-06
Reviewed by Antonio Gomes.

* platform/blackberry/KURLBlackBerry.cpp: Added.
(WebCore::KURL::fileSystemPath):
* platform/blackberry/LoggingBlackBerry.cpp: Added.
(WebCore::initializeWithUserDefault):
(WebCore::InitializeLoggingChannelsIfNecessary):

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

Source/WebCore/ChangeLog
Source/WebCore/platform/blackberry/KURLBlackBerry.cpp [new file with mode: 0644]
Source/WebCore/platform/blackberry/LoggingBlackBerry.cpp [new file with mode: 0644]

index 6453c74..86a4db8 100644 (file)
@@ -1,3 +1,16 @@
+2011-12-06  Mary Wu  <mary.wu@torchmobile.com.cn>
+
+        upstream BlackBerry porting of KURL/Logging
+        https://bugs.webkit.org/show_bug.cgi?id=73524
+
+        Reviewed by Antonio Gomes.
+
+        * platform/blackberry/KURLBlackBerry.cpp: Added.
+        (WebCore::KURL::fileSystemPath):
+        * platform/blackberry/LoggingBlackBerry.cpp: Added.
+        (WebCore::initializeWithUserDefault):
+        (WebCore::InitializeLoggingChannelsIfNecessary):
+
 2011-12-06  Leo Yang  <leo.yang@torchmobile.com.cn>
 
         [BlackBerry] Remove redundant files in PlatformBlackBerry.cmake
diff --git a/Source/WebCore/platform/blackberry/KURLBlackBerry.cpp b/Source/WebCore/platform/blackberry/KURLBlackBerry.cpp
new file mode 100644 (file)
index 0000000..b310961
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2009, 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
+ */
+
+#include "config.h"
+#include "KURL.h"
+
+#include "PlatformString.h"
+
+namespace WebCore {
+
+String KURL::fileSystemPath() const
+{
+    // We choose only to support file:// protocol here to match
+    // the expected behaviour across platforms.
+    if (!isValid() || !protocolIs("file"))
+        return String();
+
+    return path();
+}
+
+} // namespace WebCore
diff --git a/Source/WebCore/platform/blackberry/LoggingBlackBerry.cpp b/Source/WebCore/platform/blackberry/LoggingBlackBerry.cpp
new file mode 100644 (file)
index 0000000..57f3d2a
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2009, 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
+ */
+
+#include "config.h"
+#include "Logging.h"
+
+namespace WebCore {
+
+static inline void initializeWithUserDefault(WTFLogChannel& channel, bool enabled)
+{
+    if (enabled)
+        channel.state = WTFLogChannelOn;
+    else
+        channel.state = WTFLogChannelOff;
+}
+
+void InitializeLoggingChannelsIfNecessary()
+{
+    static bool haveInitializedLoggingChannels = false;
+    if (haveInitializedLoggingChannels)
+        return;
+    haveInitializedLoggingChannels = true;
+
+    initializeWithUserDefault(LogNotYetImplemented, true);
+    initializeWithUserDefault(LogFrames, true);
+    initializeWithUserDefault(LogLoading, true);
+    initializeWithUserDefault(LogPopupBlocking, true);
+    initializeWithUserDefault(LogEvents, true);
+    initializeWithUserDefault(LogEditing, true);
+    initializeWithUserDefault(LogLiveConnect, true);
+    initializeWithUserDefault(LogIconDatabase, false);
+    initializeWithUserDefault(LogSQLDatabase, false);
+    initializeWithUserDefault(LogSpellingAndGrammar, true);
+    initializeWithUserDefault(LogBackForward, true);
+    initializeWithUserDefault(LogHistory, true);
+    initializeWithUserDefault(LogPageCache, true);
+    initializeWithUserDefault(LogPlatformLeaks, true);
+    initializeWithUserDefault(LogNetwork, true);
+    initializeWithUserDefault(LogFTP, true);
+    initializeWithUserDefault(LogThreading, true);
+    initializeWithUserDefault(LogStorageAPI, true);
+    initializeWithUserDefault(LogMedia, true);
+    initializeWithUserDefault(LogPlugins, true);
+    initializeWithUserDefault(LogArchives, true);
+    initializeWithUserDefault(LogProgress, false);
+    initializeWithUserDefault(LogResourceLoading, false);
+    initializeWithUserDefault(LogFileAPI, true);
+}
+
+} // namespace WebCore