Title: [200143] trunk/Source/WebKit2
Revision
200143
Author
[email protected]
Date
2016-04-27 12:39:35 -0700 (Wed, 27 Apr 2016)

Log Message

[GTK][EFL] Move WK2 platform code to a common place
https://bugs.webkit.org/show_bug.cgi?id=157069

Reviewed by Carlos Garcia Campos.

Logging implementation can be shared between EFL and GTK, so move it to unix.
The GTK Module implementation doesn't depend on GTK anyhow so move it to glib.

* Platform/efl/LoggingEfl.cpp: Removed.
(WebKit::logLevelString): Deleted.
* Platform/glib/ModuleGlib.cpp: Renamed from Source/WebKit2/Platform/gtk/ModuleGtk.cpp.
(WebKit::Module::load):
(WebKit::Module::unload):
(WebKit::Module::platformFunctionPointer):
* Platform/gtk/LoggingGtk.cpp:
(WebKit::logLevelString): Deleted.
* Platform/gtk/ModuleGtk.cpp:
(WebKit::Module::load): Deleted.
(WebKit::Module::unload): Deleted.
(WebKit::Module::platformFunctionPointer): Deleted.
* Platform/unix/LoggingUnix.cpp: Renamed from Source/WebKit2/Platform/gtk/LoggingGtk.cpp.
(WebKit::logLevelString):
* PlatformEfl.cmake: Update.
* PlatformGTK.cmake: Update

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (200142 => 200143)


--- trunk/Source/WebKit2/ChangeLog	2016-04-27 19:30:01 UTC (rev 200142)
+++ trunk/Source/WebKit2/ChangeLog	2016-04-27 19:39:35 UTC (rev 200143)
@@ -1,3 +1,30 @@
+2016-04-27  Claudio Saavedra  <[email protected]>
+
+        [GTK][EFL] Move WK2 platform code to a common place
+        https://bugs.webkit.org/show_bug.cgi?id=157069
+
+        Reviewed by Carlos Garcia Campos.
+
+        Logging implementation can be shared between EFL and GTK, so move it to unix.
+        The GTK Module implementation doesn't depend on GTK anyhow so move it to glib.
+
+        * Platform/efl/LoggingEfl.cpp: Removed.
+        (WebKit::logLevelString): Deleted.
+        * Platform/glib/ModuleGlib.cpp: Renamed from Source/WebKit2/Platform/gtk/ModuleGtk.cpp.
+        (WebKit::Module::load):
+        (WebKit::Module::unload):
+        (WebKit::Module::platformFunctionPointer):
+        * Platform/gtk/LoggingGtk.cpp:
+        (WebKit::logLevelString): Deleted.
+        * Platform/gtk/ModuleGtk.cpp:
+        (WebKit::Module::load): Deleted.
+        (WebKit::Module::unload): Deleted.
+        (WebKit::Module::platformFunctionPointer): Deleted.
+        * Platform/unix/LoggingUnix.cpp: Renamed from Source/WebKit2/Platform/gtk/LoggingGtk.cpp.
+        (WebKit::logLevelString):
+        * PlatformEfl.cmake: Update.
+        * PlatformGTK.cmake: Update
+
 2016-04-27  Alex Christensen  <[email protected]>
 
         Fix assertion when downloading with NSURLSession after r198955

Deleted: trunk/Source/WebKit2/Platform/efl/LoggingEfl.cpp (200142 => 200143)


--- trunk/Source/WebKit2/Platform/efl/LoggingEfl.cpp	2016-04-27 19:30:01 UTC (rev 200142)
+++ trunk/Source/WebKit2/Platform/efl/LoggingEfl.cpp	2016-04-27 19:39:35 UTC (rev 200143)
@@ -1,41 +0,0 @@
-/*
- * Copyright (C) 2012 Samsung Electronics. All rights reserved.
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "Logging.h"
-
-#if !LOG_DISABLED
-
-namespace WebKit {
-
-String logLevelString()
-{
-    return getenv("WEBKIT_DEBUG");
-}
-
-} // namespace WebKit
-
-#endif // !LOG_DISABLED

Copied: trunk/Source/WebKit2/Platform/glib/ModuleGlib.cpp (from rev 200142, trunk/Source/WebKit2/Platform/gtk/ModuleGtk.cpp) (0 => 200143)


--- trunk/Source/WebKit2/Platform/glib/ModuleGlib.cpp	                        (rev 0)
+++ trunk/Source/WebKit2/Platform/glib/ModuleGlib.cpp	2016-04-27 19:39:35 UTC (rev 200143)
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ * Portions Copyright (c) 2010 Motorola Mobility, Inc. All rights reserved.
+ * Copyright (C) 2011 Igalia S.L.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "Module.h"
+
+#include <gmodule.h>
+#include <wtf/text/CString.h>
+
+namespace WebKit {
+
+bool Module::load()
+{
+    m_handle = g_module_open(m_path.utf8().data(), G_MODULE_BIND_LAZY);
+    if (!m_handle)
+        WTFLogAlways("Error loading module '%s': %s", m_path.utf8().data(), g_module_error());
+    return m_handle;
+}
+
+void Module::unload()
+{
+    if (m_handle)
+        g_module_close(m_handle);
+}
+
+void* Module::platformFunctionPointer(const char* functionName) const
+{
+    gpointer symbol = 0;
+    g_module_symbol(m_handle, functionName, &symbol);
+    return symbol;
+}
+
+}

Copied: trunk/Source/WebKit2/Platform/unix/LoggingUnix.cpp (from rev 200142, trunk/Source/WebKit2/Platform/gtk/LoggingGtk.cpp) (0 => 200143)


--- trunk/Source/WebKit2/Platform/unix/LoggingUnix.cpp	                        (rev 0)
+++ trunk/Source/WebKit2/Platform/unix/LoggingUnix.cpp	2016-04-27 19:39:35 UTC (rev 200143)
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2011 Samsung Electronics
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "Logging.h"
+
+namespace WebKit {
+
+#if !LOG_DISABLED
+
+String logLevelString()
+{
+    return getenv("WEBKIT_DEBUG");
+}
+
+#endif // !LOG_DISABLED
+
+}

Modified: trunk/Source/WebKit2/PlatformEfl.cmake (200142 => 200143)


--- trunk/Source/WebKit2/PlatformEfl.cmake	2016-04-27 19:30:01 UTC (rev 200142)
+++ trunk/Source/WebKit2/PlatformEfl.cmake	2016-04-27 19:39:35 UTC (rev 200143)
@@ -16,9 +16,9 @@
     Platform/IPC/unix/AttachmentUnix.cpp
     Platform/IPC/unix/ConnectionUnix.cpp
 
-    Platform/efl/LoggingEfl.cpp
     Platform/efl/ModuleEfl.cpp
 
+    Platform/unix/LoggingUnix.cpp
     Platform/unix/SharedMemoryUnix.cpp
 
     PluginProcess/unix/PluginControllerProxyUnix.cpp

Modified: trunk/Source/WebKit2/PlatformGTK.cmake (200142 => 200143)


--- trunk/Source/WebKit2/PlatformGTK.cmake	2016-04-27 19:30:01 UTC (rev 200142)
+++ trunk/Source/WebKit2/PlatformGTK.cmake	2016-04-27 19:39:35 UTC (rev 200143)
@@ -46,9 +46,9 @@
     Platform/IPC/unix/AttachmentUnix.cpp
     Platform/IPC/unix/ConnectionUnix.cpp
 
-    Platform/gtk/LoggingGtk.cpp
-    Platform/gtk/ModuleGtk.cpp
+    Platform/glib/ModuleGlib.cpp
 
+    Platform/unix/LoggingUnix.cpp
     Platform/unix/SharedMemoryUnix.cpp
 
     PluginProcess/unix/PluginControllerProxyUnix.cpp
@@ -728,9 +728,9 @@
         Platform/IPC/unix/AttachmentUnix.cpp
         Platform/IPC/unix/ConnectionUnix.cpp
 
-        Platform/gtk/LoggingGtk.cpp
-        Platform/gtk/ModuleGtk.cpp
+        Platform/glib/ModuleGlib.cpp
 
+        Platform/unix/LoggingUnix.cpp
         Platform/unix/SharedMemoryUnix.cpp
 
         PluginProcess/PluginControllerProxy.cpp
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to