<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[199815] trunk/Source/WebCore</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/199815">199815</a></dd>
<dt>Author</dt> <dd>csaavedra@igalia.com</dd>
<dt>Date</dt> <dd>2016-04-21 08:12:11 -0700 (Thu, 21 Apr 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>[GTK][EFL] Move non-glib/gtk platform implementations out of platform/gtk
https://bugs.webkit.org/show_bug.cgi?id=156847

Reviewed by Carlos Garcia Campos.

The Language and Logging implementation don't really need glib, so
rework them and move them to a new platform/unix directory so that
they can be shared among Unix ports.

* PlatformEfl.cmake: Use the unix version.
* PlatformGTK.cmake: Same.
* platform/efl/LanguageEfl.cpp: Removed.
* platform/efl/LoggingEfl.cpp: Removed.
* platform/unix/LanguageUnix.cpp: Renamed from Source/WebCore/platform/gtk/LanguageGtk.cpp.
(WebCore::platformLanguage):
(WebCore::platformUserPreferredLanguages):
* platform/unix/LoggingUnix.cpp: Renamed from Source/WebCore/platform/gtk/LoggingGtk.cpp.
(WebCore::logLevelString):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorePlatformEflcmake">trunk/Source/WebCore/PlatformEfl.cmake</a></li>
<li><a href="#trunkSourceWebCorePlatformGTKcmake">trunk/Source/WebCore/PlatformGTK.cmake</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li>trunk/Source/WebCore/platform/unix/</li>
<li><a href="#trunkSourceWebCoreplatformunixLanguageUnixcpp">trunk/Source/WebCore/platform/unix/LanguageUnix.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformunixLoggingUnixcpp">trunk/Source/WebCore/platform/unix/LoggingUnix.cpp</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreplatformeflLanguageEflcpp">trunk/Source/WebCore/platform/efl/LanguageEfl.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformeflLoggingEflcpp">trunk/Source/WebCore/platform/efl/LoggingEfl.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgtkLanguageGtkcpp">trunk/Source/WebCore/platform/gtk/LanguageGtk.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgtkLoggingGtkcpp">trunk/Source/WebCore/platform/gtk/LoggingGtk.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (199814 => 199815)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-04-21 12:33:13 UTC (rev 199814)
+++ trunk/Source/WebCore/ChangeLog        2016-04-21 15:12:11 UTC (rev 199815)
</span><span class="lines">@@ -1,3 +1,24 @@
</span><ins>+2016-04-21  Claudio Saavedra  &lt;csaavedra@igalia.com&gt;
+
+        [GTK][EFL] Move non-glib/gtk platform implementations out of platform/gtk
+        https://bugs.webkit.org/show_bug.cgi?id=156847
+
+        Reviewed by Carlos Garcia Campos.
+
+        The Language and Logging implementation don't really need glib, so
+        rework them and move them to a new platform/unix directory so that
+        they can be shared among Unix ports.
+
+        * PlatformEfl.cmake: Use the unix version.
+        * PlatformGTK.cmake: Same.
+        * platform/efl/LanguageEfl.cpp: Removed.
+        * platform/efl/LoggingEfl.cpp: Removed.
+        * platform/unix/LanguageUnix.cpp: Renamed from Source/WebCore/platform/gtk/LanguageGtk.cpp.
+        (WebCore::platformLanguage):
+        (WebCore::platformUserPreferredLanguages):
+        * platform/unix/LoggingUnix.cpp: Renamed from Source/WebCore/platform/gtk/LoggingGtk.cpp.
+        (WebCore::logLevelString):
+
</ins><span class="cx"> 2016-04-21  Nan Wang  &lt;n_wang@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         AX: stringForTextMarkerRange returning empty string for document range
</span></span></pre></div>
<a id="trunkSourceWebCorePlatformEflcmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/PlatformEfl.cmake (199814 => 199815)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/PlatformEfl.cmake        2016-04-21 12:33:13 UTC (rev 199814)
+++ trunk/Source/WebCore/PlatformEfl.cmake        2016-04-21 15:12:11 UTC (rev 199815)
</span><span class="lines">@@ -99,9 +99,7 @@
</span><span class="cx">     platform/efl/EventLoopEfl.cpp
</span><span class="cx">     platform/efl/FileSystemEfl.cpp
</span><span class="cx">     platform/efl/GamepadsEfl.cpp
</span><del>-    platform/efl/LanguageEfl.cpp
</del><span class="cx">     platform/efl/LocalizedStringsEfl.cpp
</span><del>-    platform/efl/LoggingEfl.cpp
</del><span class="cx">     platform/efl/MIMETypeRegistryEfl.cpp
</span><span class="cx">     platform/efl/MainThreadSharedTimerEfl.cpp
</span><span class="cx">     platform/efl/PasteboardEfl.cpp
</span><span class="lines">@@ -220,6 +218,9 @@
</span><span class="cx"> 
</span><span class="cx">     platform/text/hyphen/HyphenationLibHyphen.cpp
</span><span class="cx"> 
</span><ins>+    platform/unix/LanguageUnix.cpp
+    platform/unix/LoggingUnix.cpp
+
</ins><span class="cx">     rendering/RenderThemeEfl.cpp
</span><span class="cx"> )
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorePlatformGTKcmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/PlatformGTK.cmake (199814 => 199815)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/PlatformGTK.cmake        2016-04-21 12:33:13 UTC (rev 199814)
+++ trunk/Source/WebCore/PlatformGTK.cmake        2016-04-21 15:12:11 UTC (rev 199815)
</span><span class="lines">@@ -141,8 +141,6 @@
</span><span class="cx">     platform/graphics/x11/XUniqueResource.cpp
</span><span class="cx"> 
</span><span class="cx">     platform/gtk/ErrorsGtk.cpp
</span><del>-    platform/gtk/LanguageGtk.cpp
-    platform/gtk/LoggingGtk.cpp
</del><span class="cx">     platform/gtk/MIMETypeRegistryGtk.cpp
</span><span class="cx">     platform/gtk/ScrollAnimatorGtk.cpp
</span><span class="cx">     platform/gtk/TemporaryLinkStubs.cpp
</span><span class="lines">@@ -184,6 +182,9 @@
</span><span class="cx">     platform/text/gtk/TextBreakIteratorInternalICUGtk.cpp
</span><span class="cx"> 
</span><span class="cx">     platform/text/hyphen/HyphenationLibHyphen.cpp
</span><ins>+
+    platform/unix/LanguageUnix.cpp
+    platform/unix/LoggingUnix.cpp
</ins><span class="cx"> )
</span><span class="cx"> 
</span><span class="cx"> list(APPEND WebCorePlatformGTK_SOURCES
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformeflLanguageEflcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/efl/LanguageEfl.cpp (199814 => 199815)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/efl/LanguageEfl.cpp        2016-04-21 12:33:13 UTC (rev 199814)
+++ trunk/Source/WebCore/platform/efl/LanguageEfl.cpp        2016-04-21 15:12:11 UTC (rev 199815)
</span><span class="lines">@@ -1,61 +0,0 @@
</span><del>-/*
- * Copyright (C) 2003, 2006 Apple Inc.  All rights reserved.
- * Copyright (C) 2008 INdT - Instituto Nokia de Tecnologia
- * Copyright (C) 2009-2010 ProFUSION embedded systems
- * Copyright (C) 2009-2010 Samsung Electronics
- *
- * 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. ``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
- * 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 &quot;config.h&quot;
-#include &quot;Language.h&quot;
-
-#include &lt;locale.h&gt;
-#include &lt;wtf/Vector.h&gt;
-#include &lt;wtf/text/WTFString.h&gt;
-
-namespace WebCore {
-
-static String platformLanguage()
-{
-    char* localeDefault = setlocale(LC_CTYPE, 0);
-
-    if (!localeDefault)
-        return String(&quot;c&quot;);
-
-    String locale = String(localeDefault);
-    locale.replace('_', '-');
-    size_t position = locale.find('.');
-    if (position != notFound)
-        locale = locale.left(position);
-
-    return locale;
-}
-
-Vector&lt;String&gt; platformUserPreferredLanguages()
-{
-    Vector&lt;String&gt; userPreferredLanguages;
-    userPreferredLanguages.append(platformLanguage());
-    return userPreferredLanguages;
-}
-
-}
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformeflLoggingEflcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/efl/LoggingEfl.cpp (199814 => 199815)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/efl/LoggingEfl.cpp        2016-04-21 12:33:13 UTC (rev 199814)
+++ trunk/Source/WebCore/platform/efl/LoggingEfl.cpp        2016-04-21 15:12:11 UTC (rev 199815)
</span><span class="lines">@@ -1,52 +0,0 @@
</span><del>-/*
- * Copyright (C) 2007 Alp Toker &lt;alp@atoker.com&gt;
- * Copyright (C) 2008 INdT - Instituto Nokia de Tecnologia
- * Copyright (C) 2009-2010 ProFUSION embedded systems
- * Copyright (C) 2009-2010 Samsung Electronics
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#include &quot;config.h&quot;
-#include &quot;Logging.h&quot;
-
-#if !LOG_DISABLED
-
-#include &lt;Eina.h&gt;
-#include &lt;wtf/text/WTFString.h&gt;
-
-namespace WebCore {
-
-String logLevelString()
-{
-    char* logEnv = getenv(&quot;WEBKIT_DEBUG&quot;);
-    if (!logEnv)
-        return emptyString();
-
-#if defined(NDEBUG)
-    EINA_LOG_WARN(&quot;WEBKIT_DEBUG is not empty, but this is a release build. Notice that many log messages will only appear in a debug build.&quot;);
-#endif
-
-    // To disable logging notImplemented set the DISABLE_NI_WARNING environment variable to 1.
-    String logLevel = &quot;NotYetImplemented,&quot;;
-    logLevel.append(logEnv);
-    return logLevel;
-}
-
-}
-
-#endif // !LOG_DISABLED
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformgtkLanguageGtkcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/gtk/LanguageGtk.cpp (199814 => 199815)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/gtk/LanguageGtk.cpp        2016-04-21 12:33:13 UTC (rev 199814)
+++ trunk/Source/WebCore/platform/gtk/LanguageGtk.cpp        2016-04-21 15:12:11 UTC (rev 199815)
</span><span class="lines">@@ -1,64 +0,0 @@
</span><del>-/*
- * Copyright (C) 2007 Alp Toker &lt;alp@atoker.com&gt;
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#include &quot;config.h&quot;
-#include &quot;Language.h&quot;
-
-#include &lt;wtf/Vector.h&gt;
-#include &lt;wtf/glib/GUniquePtr.h&gt;
-#include &lt;wtf/text/CString.h&gt;
-#include &lt;wtf/text/WTFString.h&gt;
-
-#include &lt;glib.h&gt;
-#include &lt;locale.h&gt;
-
-namespace WebCore {
-
-// Using pango_language_get_default() here is not an option, because
-// it doesn't support changing the locale in runtime, so it returns
-// always the same value.
-static String platformLanguage()
-{
-    char* localeDefault = setlocale(LC_CTYPE, NULL);
-
-    if (!localeDefault)
-        return String(&quot;c&quot;);
-
-    GUniquePtr&lt;gchar&gt; normalizedDefault(g_ascii_strdown(localeDefault, -1));
-    char* ptr = strchr(normalizedDefault.get(), '_');
-
-    if (ptr)
-        *ptr = '-';
-
-    ptr = strchr(normalizedDefault.get(), '.');
-
-    if (ptr)
-        *ptr = '\0';
-
-    return String(normalizedDefault.get());
-}
-
-Vector&lt;String&gt; platformUserPreferredLanguages()
-{
-    Vector&lt;String&gt; userPreferredLanguages;
-    userPreferredLanguages.append(platformLanguage());
-    return userPreferredLanguages;
-}
-    
-}
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformgtkLoggingGtkcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/gtk/LoggingGtk.cpp (199814 => 199815)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/gtk/LoggingGtk.cpp        2016-04-21 12:33:13 UTC (rev 199814)
+++ trunk/Source/WebCore/platform/gtk/LoggingGtk.cpp        2016-04-21 15:12:11 UTC (rev 199815)
</span><span class="lines">@@ -1,52 +0,0 @@
</span><del>-/*
- * Copyright (C) 2007 Alp Toker &lt;alp@atoker.com&gt;
- * Copyright (C) 2009 Gustavo Noronha Silva &lt;gns@gnome.org&gt;
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#include &quot;config.h&quot;
-#include &quot;Logging.h&quot;
-
-#if !LOG_DISABLED
-
-#include &lt;glib.h&gt;
-#include &lt;string.h&gt;
-#include &lt;wtf/text/WTFString.h&gt;
-
-namespace WebCore {
-
-String logLevelString()
-{
-    char* logEnv = getenv(&quot;WEBKIT_DEBUG&quot;);
-    if (!logEnv)
-        return emptyString();
-
-    // We set up the logs anyway because some of our logging, such as Soup's is available in release builds.
-#if defined(NDEBUG)
-    g_warning(&quot;WEBKIT_DEBUG is not empty, but this is a release build. Notice that many log messages will only appear in a debug build.&quot;);
-#endif
-
-    // To disable logging notImplemented set the DISABLE_NI_WARNING environment variable to 1.
-    String logLevel = &quot;NotYetImplemented,&quot;;
-    logLevel.append(logEnv);
-    return logLevel;
-}
-
-} // namespace WebCore
-
-#endif // !LOG_DISABLED
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformunixLanguageUnixcppfromrev199814trunkSourceWebCoreplatformgtkLanguageGtkcpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/unix/LanguageUnix.cpp (from rev 199814, trunk/Source/WebCore/platform/gtk/LanguageGtk.cpp) (0 => 199815)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/unix/LanguageUnix.cpp                                (rev 0)
+++ trunk/Source/WebCore/platform/unix/LanguageUnix.cpp        2016-04-21 15:12:11 UTC (rev 199815)
</span><span class="lines">@@ -0,0 +1,49 @@
</span><ins>+/*
+ * Copyright (C) 2007 Alp Toker &lt;alp@atoker.com&gt;
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library 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
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;Language.h&quot;
+
+#include &lt;locale.h&gt;
+#include &lt;wtf/Vector.h&gt;
+#include &lt;wtf/text/WTFString.h&gt;
+
+namespace WebCore {
+
+// Using pango_language_get_default() here is not an option, because
+// it doesn't support changing the locale in runtime, so it returns
+// always the same value.
+static String platformLanguage()
+{
+    String localeDefault(setlocale(LC_CTYPE, nullptr));
+    if (localeDefault.isEmpty())
+        return String(&quot;c&quot;);
+
+    String normalizedDefault = localeDefault.convertToASCIILowercase();
+    normalizedDefault.replace('_', '-');
+    normalizedDefault.truncate(normalizedDefault.find('.'));
+    return normalizedDefault;
+}
+
+Vector&lt;String&gt; platformUserPreferredLanguages()
+{
+    return { platformLanguage() };
+}
+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformunixLoggingUnixcppfromrev199814trunkSourceWebCoreplatformgtkLoggingGtkcpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/unix/LoggingUnix.cpp (from rev 199814, trunk/Source/WebCore/platform/gtk/LoggingGtk.cpp) (0 => 199815)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/unix/LoggingUnix.cpp                                (rev 0)
+++ trunk/Source/WebCore/platform/unix/LoggingUnix.cpp        2016-04-21 15:12:11 UTC (rev 199815)
</span><span class="lines">@@ -0,0 +1,49 @@
</span><ins>+/*
+ * Copyright (C) 2007 Alp Toker &lt;alp@atoker.com&gt;
+ * Copyright (C) 2009 Gustavo Noronha Silva &lt;gns@gnome.org&gt;
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library 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
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;Logging.h&quot;
+
+#if !LOG_DISABLED
+
+#include &lt;string.h&gt;
+#include &lt;wtf/text/WTFString.h&gt;
+
+namespace WebCore {
+
+String logLevelString()
+{
+    char* logEnv = getenv(&quot;WEBKIT_DEBUG&quot;);
+    if (!logEnv)
+        return emptyString();
+
+    // We set up the logs anyway because some of our logging, such as Soup's is available in release builds.
+#if defined(NDEBUG)
+    WTFLogAlways(&quot;WEBKIT_DEBUG is not empty, but this is a release build. Notice that many log messages will only appear in a debug build.&quot;);
+#endif
+
+    // To disable logging notImplemented set the DISABLE_NI_WARNING environment variable to 1.
+    return String(&quot;NotYetImplemented,&quot;) + logEnv;
+}
+
+} // namespace WebCore
+
+#endif // !LOG_DISABLED
</ins></span></pre>
</div>
</div>

</body>
</html>