<!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>[160001] 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/160001">160001</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2013-12-03 06:24:50 -0800 (Tue, 03 Dec 2013)</dd>
</dl>
<h3>Log Message</h3>
<pre>Nix Upstream: Adding missing nix new files to WebCore
https://bugs.webkit.org/show_bug.cgi?id=124987
Patch by Thiago de Barros Lacerda <thiago.lacerda@openbossa.org> on 2013-12-03
Reviewed by Benjamin Poulain.
No new tests needed.
* PlatformNix.cmake:
* platform/nix/ErrorsNix.cpp: Added.
* platform/nix/ErrorsNix.h: Added.
* platform/nix/FileSystemNix.cpp: Added.
* platform/nix/MIMETypeRegistryNix.cpp: Added.
* platform/nix/SharedTimerNix.cpp: Added.
* platform/nix/TemporaryLinkStubs.cpp: Added.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorePlatformNixcmake">trunk/Source/WebCore/PlatformNix.cmake</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreplatformnixErrorsNixcpp">trunk/Source/WebCore/platform/nix/ErrorsNix.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformnixErrorsNixh">trunk/Source/WebCore/platform/nix/ErrorsNix.h</a></li>
<li><a href="#trunkSourceWebCoreplatformnixFileSystemNixcpp">trunk/Source/WebCore/platform/nix/FileSystemNix.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformnixMIMETypeRegistryNixcpp">trunk/Source/WebCore/platform/nix/MIMETypeRegistryNix.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformnixSharedTimerNixcpp">trunk/Source/WebCore/platform/nix/SharedTimerNix.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformnixTemporaryLinkStubscpp">trunk/Source/WebCore/platform/nix/TemporaryLinkStubs.cpp</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (160000 => 160001)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2013-12-03 12:44:27 UTC (rev 160000)
+++ trunk/Source/WebCore/ChangeLog        2013-12-03 14:24:50 UTC (rev 160001)
</span><span class="lines">@@ -1,3 +1,20 @@
</span><ins>+2013-12-03 Thiago de Barros Lacerda <thiago.lacerda@openbossa.org>
+
+ Nix Upstream: Adding missing nix new files to WebCore
+ https://bugs.webkit.org/show_bug.cgi?id=124987
+
+ Reviewed by Benjamin Poulain.
+
+ No new tests needed.
+
+ * PlatformNix.cmake:
+ * platform/nix/ErrorsNix.cpp: Added.
+ * platform/nix/ErrorsNix.h: Added.
+ * platform/nix/FileSystemNix.cpp: Added.
+ * platform/nix/MIMETypeRegistryNix.cpp: Added.
+ * platform/nix/SharedTimerNix.cpp: Added.
+ * platform/nix/TemporaryLinkStubs.cpp: Added.
+
</ins><span class="cx"> 2013-12-03 Tamas Gergely <gertom@inf.u-szeged.hu>
</span><span class="cx">
</span><span class="cx"> Correct broken build on efl port with --no-netscape-plugin-api
</span></span></pre></div>
<a id="trunkSourceWebCorePlatformNixcmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/PlatformNix.cmake (160000 => 160001)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/PlatformNix.cmake        2013-12-03 12:44:27 UTC (rev 160000)
+++ trunk/Source/WebCore/PlatformNix.cmake        2013-12-03 14:24:50 UTC (rev 160001)
</span><span class="lines">@@ -116,16 +116,21 @@
</span><span class="cx"> platform/nix/CursorNix.cpp
</span><span class="cx"> platform/nix/DragDataNix.cpp
</span><span class="cx"> platform/nix/DragImageNix.cpp
</span><ins>+ platform/nix/ErrorsNix.cpp
+ platform/nix/FileSystemNix.cpp
</ins><span class="cx"> platform/nix/GamepadsNix.cpp
</span><span class="cx"> platform/nix/LanguageNix.cpp
</span><span class="cx"> platform/nix/LocalizedStringsNix.cpp
</span><ins>+ platform/nix/MIMETypeRegistryNix.cpp
</ins><span class="cx"> platform/nix/NixKeyboardUtilities.cpp
</span><span class="cx"> platform/nix/PasteboardNix.cpp
</span><span class="cx"> platform/nix/PlatformKeyboardEventNix.cpp
</span><span class="cx"> platform/nix/PlatformScreenNix.cpp
</span><span class="cx"> platform/nix/RenderThemeNix.cpp
</span><span class="cx"> platform/nix/ScrollbarThemeNix.cpp
</span><ins>+ platform/nix/SharedTimerNix.cpp
</ins><span class="cx"> platform/nix/SoundNix.cpp
</span><ins>+ platform/nix/TemporaryLinkStubs.cpp
</ins><span class="cx"> platform/nix/WidgetNix.cpp
</span><span class="cx">
</span><span class="cx"> platform/nix/support/MultiChannelPCMData.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnixErrorsNixcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/nix/ErrorsNix.cpp (0 => 160001)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/nix/ErrorsNix.cpp         (rev 0)
+++ trunk/Source/WebCore/platform/nix/ErrorsNix.cpp        2013-12-03 14:24:50 UTC (rev 160001)
</span><span class="lines">@@ -0,0 +1,111 @@
</span><ins>+/*
+ * Copyright (C) 2012 Intel Corporation. All rights reserved.
+ * Copyright (C) 2012, 2013 Nokia Corporation and/or its subsidiary(-ies).
+ *
+ * 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 "ErrorsNix.h"
+
+#include "DocumentLoader.h"
+#include "Frame.h"
+#include "PrintContext.h"
+#include "ResourceError.h"
+#include "ResourceRequest.h"
+#include "ResourceResponse.h"
+
+namespace WebCore {
+
+ResourceError cancelledError(const ResourceRequest& request)
+{
+ return ResourceError(errorDomainNetwork, NetworkErrorCancelled, request.url().string(), ASCIILiteral("Load request cancelled"));
+}
+
+ResourceError blockedError(const ResourceRequest& request)
+{
+ return ResourceError(errorDomainPolicy, PolicyErrorCannotUseRestrictedPort, request.url().string(), ASCIILiteral("Not allowed to use restricted network port"));
+}
+
+ResourceError cannotShowURLError(const ResourceRequest& request)
+{
+ return ResourceError(errorDomainPolicy, PolicyErrorCannotShowURL, request.url().string(), ASCIILiteral("URL cannot be shown"));
+}
+
+ResourceError interruptedForPolicyChangeError(const ResourceRequest& request)
+{
+ return ResourceError(errorDomainPolicy, PolicyErrorFrameLoadInterruptedByPolicyChange, request.url().string(), ASCIILiteral("Frame load was interrupted"));
+}
+
+ResourceError cannotShowMIMETypeError(const ResourceResponse& response)
+{
+ return ResourceError(errorDomainPolicy, PolicyErrorCannotShowMimeType, response.url().string(), ASCIILiteral("Content with the specified MIME type cannot be shown"));
+}
+
+ResourceError fileDoesNotExistError(const ResourceResponse& response)
+{
+ return ResourceError(errorDomainNetwork, NetworkErrorFileDoesNotExist, response.url().string(), ASCIILiteral("File does not exist"));
+}
+
+ResourceError pluginWillHandleLoadError(const ResourceResponse& response)
+{
+ return ResourceError(errorDomainPlugin, PluginErrorWillHandleLoad, response.url().string(), ASCIILiteral("Plugin will handle load"));
+}
+
+ResourceError downloadNetworkError(const ResourceError& networkError)
+{
+ return ResourceError(errorDomainDownload, DownloadErrorNetwork, networkError.failingURL(), networkError.localizedDescription());
+}
+
+ResourceError downloadCancelledByUserError(const ResourceResponse& response)
+{
+ return ResourceError(errorDomainDownload, DownloadErrorCancelledByUser, response.url().string(), ASCIILiteral("User cancelled the download"));
+}
+
+ResourceError downloadDestinationError(const ResourceResponse& response, const String& errorMessage)
+{
+ return ResourceError(errorDomainDownload, DownloadErrorDestination, response.url().string(), errorMessage);
+}
+
+ResourceError printError(const PrintContext* printContext, const String& errorMessage)
+{
+ DocumentLoader* documentLoader = printContext->frame()->loader().documentLoader();
+
+ return ResourceError(errorDomainPrint, PrintErrorGeneral, documentLoader ? documentLoader->url() : URL(), errorMessage);
+}
+
+ResourceError printerNotFoundError(const PrintContext* printContext)
+{
+ DocumentLoader* documentLoader = printContext->frame()->loader().documentLoader();
+
+ return ResourceError(errorDomainPrint, PrintErrorPrinterNotFound, documentLoader ? documentLoader->url() : URL(), ASCIILiteral("Printer not found"));
+}
+
+ResourceError invalidPageRangeToPrint(const PrintContext* printContext)
+{
+ DocumentLoader* documentLoader = printContext->frame()->loader().documentLoader();
+
+ return ResourceError(errorDomainPrint, PrintErrorInvalidPageRange, documentLoader ? documentLoader->url() : URL(), ASCIILiteral("Invalid page range"));
+}
+
+} // namespace WebCore
+
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformnixErrorsNixh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/nix/ErrorsNix.h (0 => 160001)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/nix/ErrorsNix.h         (rev 0)
+++ trunk/Source/WebCore/platform/nix/ErrorsNix.h        2013-12-03 14:24:50 UTC (rev 160001)
</span><span class="lines">@@ -0,0 +1,101 @@
</span><ins>+/*
+ * Copyright (C) 2012 Intel Corporation. All rights reserved.
+ * Copyright (C) 2012, 2013 Nokia Corporation and/or its subsidiary(-ies).
+ *
+ * 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.
+ */
+
+#ifndef ErrorsNix_h
+#define ErrorsNix_h
+
+#include <wtf/text/WTFString.h>
+
+namespace WebCore {
+
+class PrintContext;
+class ResourceError;
+class ResourceRequest;
+class ResourceResponse;
+
+static const char errorDomainNetwork[] = "WebKitNetworkError";
+static const char errorDomainPolicy[] = "WebKitPolicyError";
+static const char errorDomainPlugin[] = "WebKitPluginError";
+static const char errorDomainDownload[] = "WebKitDownloadError";
+static const char errorDomainPrint[] = "WebKitPrintError";
+
+enum NetworkError {
+ NetworkErrorFailed = 399,
+ NetworkErrorTransport = 300,
+ NetworkErrorUnknownProtocol = 301,
+ NetworkErrorCancelled = 302,
+ NetworkErrorFileDoesNotExist = 303
+};
+
+// Sync'd with Mac's WebKit Errors at:
+// Source/WebKit/mac/Misc/WebKitErrors[Private].h
+enum PolicyError {
+ PolicyErrorFailed = 199,
+ PolicyErrorCannotShowMimeType = 100,
+ PolicyErrorCannotShowURL = 101,
+ PolicyErrorFrameLoadInterruptedByPolicyChange = 102,
+ PolicyErrorCannotUseRestrictedPort = 103
+};
+
+enum PluginError {
+ PluginErrorFailed = 299,
+ PluginErrorCannotFindPlugin = 200,
+ PluginErrorCannotLoadPlugin = 201,
+ PluginErrorJavaUnavailable = 202,
+ PluginErrorConnectionCancelled = 203,
+ PluginErrorWillHandleLoad = 204
+};
+
+enum DownloadError {
+ DownloadErrorNetwork = 499,
+ DownloadErrorCancelledByUser = 400,
+ DownloadErrorDestination = 401
+};
+
+enum PrintError {
+ PrintErrorGeneral = 599,
+ PrintErrorPrinterNotFound = 500,
+ PrintErrorInvalidPageRange = 501
+};
+
+ResourceError cancelledError(const ResourceRequest&);
+ResourceError blockedError(const ResourceRequest&);
+ResourceError cannotShowURLError(const ResourceRequest&);
+ResourceError interruptedForPolicyChangeError(const ResourceRequest&);
+ResourceError cannotShowMIMETypeError(const ResourceResponse&);
+ResourceError fileDoesNotExistError(const ResourceResponse&);
+ResourceError pluginWillHandleLoadError(const ResourceResponse&);
+ResourceError downloadNetworkError(const ResourceError&);
+ResourceError downloadCancelledByUserError(const ResourceResponse&);
+ResourceError downloadDestinationError(const ResourceResponse&, const String& errorMessage);
+ResourceError printError(const PrintContext*, const String& errorMessage);
+ResourceError printerNotFoundError(const PrintContext*);
+ResourceError invalidPageRangeToPrint(const PrintContext*);
+
+} // namespace WebCore
+
+#endif // ErrorsNix_h
+
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformnixFileSystemNixcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/nix/FileSystemNix.cpp (0 => 160001)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/nix/FileSystemNix.cpp         (rev 0)
+++ trunk/Source/WebCore/platform/nix/FileSystemNix.cpp        2013-12-03 14:24:50 UTC (rev 160001)
</span><span class="lines">@@ -0,0 +1,343 @@
</span><ins>+/*
+ * Copyright (C) 2007, 2009 Holger Hans Peter Freyther
+ * Copyright (C) 2008 Collabora, Ltd.
+ * Copyright (C) 2008 Apple Inc. All rights reserved.
+ * Portions Copyright (c) 2010 Motorola Mobility, Inc. All rights reserved.
+ * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies).
+ *
+ * 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 THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
+ * OWNER 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 "config.h"
+#include "FileSystem.h"
+
+#include "FileMetadata.h"
+#include "UUID.h"
+#include <gio/gio.h>
+#include <glib.h>
+#include <glib/gstdio.h>
+#include <wtf/gobject/GOwnPtr.h>
+#include <wtf/gobject/GRefPtr.h>
+#include <wtf/gobject/GlibUtilities.h>
+#include <wtf/text/CString.h>
+#include <wtf/text/WTFString.h>
+
+namespace WebCore {
+
+// On linux file names are just raw bytes, so also strings that cannot be encoded in any way
+// are valid file names. This mean that we cannot just store a file name as-is in a String
+// but we have to escape it.
+// On Windows the GLib file name encoding is always UTF-8 so we can optimize this case.
+String filenameToString(const char* filename)
+{
+ if (!filename)
+ return String();
+
+ GOwnPtr<gchar> escapedString(g_uri_escape_string(filename, "/:", false));
+ return escapedString.get();
+}
+
+CString fileSystemRepresentation(const String& path)
+{
+ GOwnPtr<gchar> filename(g_uri_unescape_string(path.utf8().data(), 0));
+ return filename.get();
+}
+
+// Converts a string to something suitable to be displayed to the user.
+String filenameForDisplay(const String& string)
+{
+ CString filename = fileSystemRepresentation(string);
+ GOwnPtr<gchar> display(g_filename_to_utf8(filename.data(), 0, 0, 0, 0));
+ if (!display)
+ return string;
+
+ return String::fromUTF8(display.get());
+}
+
+bool fileExists(const String& path)
+{
+ bool result = false;
+ CString filename = fileSystemRepresentation(path);
+
+ if (!filename.isNull())
+ result = g_file_test(filename.data(), G_FILE_TEST_EXISTS);
+
+ return result;
+}
+
+bool deleteFile(const String& path)
+{
+ bool result = false;
+ CString filename = fileSystemRepresentation(path);
+
+ if (!filename.isNull())
+ result = !g_remove(filename.data());
+
+ return result;
+}
+
+bool deleteEmptyDirectory(const String& path)
+{
+ bool result = false;
+ CString filename = fileSystemRepresentation(path);
+
+ if (!filename.isNull())
+ result = !g_rmdir(filename.data());
+
+ return result;
+}
+
+bool getFileSize(const String& path, long long& resultSize)
+{
+ CString filename = fileSystemRepresentation(path);
+ if (filename.isNull())
+ return false;
+
+ GStatBuf statResult;
+ gint result = g_stat(filename.data(), &statResult);
+ if (result)
+ return false;
+
+ resultSize = statResult.st_size;
+ return true;
+}
+
+bool getFileModificationTime(const String& path, time_t& modifiedTime)
+{
+ CString filename = fileSystemRepresentation(path);
+ if (filename.isNull())
+ return false;
+
+ GStatBuf statResult;
+ gint result = g_stat(filename.data(), &statResult);
+ if (result)
+ return false;
+
+ modifiedTime = statResult.st_mtime;
+ return true;
+}
+
+bool getFileMetadata(const String& path, FileMetadata& metadata)
+{
+ CString filename = fileSystemRepresentation(path);
+ if (filename.isNull())
+ return false;
+
+ struct stat statResult;
+ gint result = g_stat(filename.data(), &statResult);
+ if (result)
+ return false;
+
+ metadata.modificationTime = statResult.st_mtime;
+ metadata.length = statResult.st_size;
+ metadata.type = S_ISDIR(statResult.st_mode) ? FileMetadata::TypeDirectory : FileMetadata::TypeFile;
+ return true;
+}
+
+String pathByAppendingComponent(const String& path, const String& component)
+{
+ if (path.endsWith(G_DIR_SEPARATOR_S))
+ return path + component;
+ return path + G_DIR_SEPARATOR_S + component;
+}
+
+bool makeAllDirectories(const String& path)
+{
+ CString filename = fileSystemRepresentation(path);
+ if (filename.isNull())
+ return false;
+
+ gint result = g_mkdir_with_parents(filename.data(), S_IRWXU);
+
+ return !result;
+}
+
+String homeDirectoryPath()
+{
+ return filenameToString(g_get_home_dir());
+}
+
+String pathGetFileName(const String& pathName)
+{
+ if (pathName.isEmpty())
+ return pathName;
+
+ CString tmpFilename = fileSystemRepresentation(pathName);
+ GOwnPtr<gchar> baseName(g_path_get_basename(tmpFilename.data()));
+ return String::fromUTF8(baseName.get());
+}
+
+CString applicationDirectoryPath()
+{
+ CString path = getCurrentExecutablePath();
+ if (!path.isNull())
+ return path;
+
+ // If the above fails, check the PATH env variable.
+ GOwnPtr<char> currentExePath(g_find_program_in_path(g_get_prgname()));
+ if (!currentExePath.get())
+ return CString();
+
+ GOwnPtr<char> dirname(g_path_get_dirname(currentExePath.get()));
+ return dirname.get();
+}
+
+CString sharedResourcesPath()
+{
+ DEFINE_STATIC_LOCAL(CString, cachedPath, ());
+ if (!cachedPath.isNull())
+ return cachedPath;
+
+ GOwnPtr<gchar> dataPath(g_build_filename(DATA_DIR, "webkitnix", NULL));
+
+ cachedPath = dataPath.get();
+ return cachedPath;
+}
+
+uint64_t getVolumeFreeSizeForPath(const char* path)
+{
+ GRefPtr<GFile> file = adoptGRef(g_file_new_for_path(path));
+ GRefPtr<GFileInfo> fileInfo = adoptGRef(g_file_query_filesystem_info(file.get(), G_FILE_ATTRIBUTE_FILESYSTEM_FREE, 0, 0));
+ if (!fileInfo)
+ return 0;
+
+ return g_file_info_get_attribute_uint64(fileInfo.get(), G_FILE_ATTRIBUTE_FILESYSTEM_FREE);
+}
+
+String directoryName(const String& path)
+{
+ GOwnPtr<char> dirname(g_path_get_dirname(fileSystemRepresentation(path).data()));
+ return String::fromUTF8(dirname.get());
+}
+
+Vector<String> listDirectory(const String& path, const String& filter)
+{
+ Vector<String> entries;
+
+ CString filename = fileSystemRepresentation(path);
+ GDir* dir = g_dir_open(filename.data(), 0, 0);
+ if (!dir)
+ return entries;
+
+ GPatternSpec* pspec = g_pattern_spec_new((filter.utf8()).data());
+ while (const char* name = g_dir_read_name(dir)) {
+ if (!g_pattern_match_string(pspec, name))
+ continue;
+
+ GOwnPtr<gchar> entry(g_build_filename(filename.data(), name, NULL));
+ entries.append(filenameToString(entry.get()));
+ }
+ g_pattern_spec_free(pspec);
+ g_dir_close(dir);
+
+ return entries;
+}
+
+String openTemporaryFile(const String& prefix, PlatformFileHandle& handle)
+{
+ GOwnPtr<gchar> filename(g_strdup_printf("%s%s", prefix.utf8().data(), createCanonicalUUIDString().utf8().data()));
+ GOwnPtr<gchar> tempPath(g_build_filename(g_get_tmp_dir(), filename.get(), NULL));
+ GRefPtr<GFile> file = adoptGRef(g_file_new_for_path(tempPath.get()));
+
+ handle = g_file_create_readwrite(file.get(), G_FILE_CREATE_NONE, 0, 0);
+ if (!isHandleValid(handle))
+ return String();
+ return String::fromUTF8(tempPath.get());
+}
+
+PlatformFileHandle openFile(const String& path, FileOpenMode mode)
+{
+ CString fsRep = fileSystemRepresentation(path);
+ if (fsRep.isNull())
+ return invalidPlatformFileHandle;
+
+ GRefPtr<GFile> file = adoptGRef(g_file_new_for_path(fsRep.data()));
+ GFileIOStream* ioStream = 0;
+ if (mode == OpenForRead)
+ ioStream = g_file_open_readwrite(file.get(), 0, 0);
+ else if (mode == OpenForWrite) {
+ if (g_file_test(fsRep.data(), static_cast<GFileTest>(G_FILE_TEST_EXISTS | G_FILE_TEST_IS_REGULAR)))
+ ioStream = g_file_open_readwrite(file.get(), 0, 0);
+ else
+ ioStream = g_file_create_readwrite(file.get(), G_FILE_CREATE_NONE, 0, 0);
+ }
+
+ return ioStream;
+}
+
+void closeFile(PlatformFileHandle& handle)
+{
+ if (!isHandleValid(handle))
+ return;
+
+ g_io_stream_close(G_IO_STREAM(handle), 0, 0);
+ g_object_unref(handle);
+ handle = invalidPlatformFileHandle;
+}
+
+long long seekFile(PlatformFileHandle handle, long long offset, FileSeekOrigin origin)
+{
+ GSeekType seekType = G_SEEK_SET;
+ switch (origin) {
+ case SeekFromBeginning:
+ seekType = G_SEEK_SET;
+ break;
+ case SeekFromCurrent:
+ seekType = G_SEEK_CUR;
+ break;
+ case SeekFromEnd:
+ seekType = G_SEEK_END;
+ break;
+ default:
+ ASSERT_NOT_REACHED();
+ }
+
+ if (!g_seekable_seek(G_SEEKABLE(g_io_stream_get_input_stream(G_IO_STREAM(handle))), offset, seekType, 0, 0))
+ return -1;
+ return g_seekable_tell(G_SEEKABLE(g_io_stream_get_input_stream(G_IO_STREAM(handle))));
+}
+
+int writeToFile(PlatformFileHandle handle, const char* data, int length)
+{
+ gsize bytesWritten;
+ g_output_stream_write_all(g_io_stream_get_output_stream(G_IO_STREAM(handle)), data, length, &bytesWritten, 0, 0);
+ return bytesWritten;
+}
+
+int readFromFile(PlatformFileHandle handle, char* data, int length)
+{
+ GOwnPtr<GError> error;
+ do {
+ gssize bytesRead = g_input_stream_read(g_io_stream_get_input_stream(G_IO_STREAM(handle)), data, length, 0, &error.outPtr());
+ if (bytesRead >= 0)
+ return bytesRead;
+ } while (error && error->code == G_FILE_ERROR_INTR);
+ return -1;
+}
+
+bool unloadModule(PlatformModule module)
+{
+ return g_module_close(module);
+}
+
+} // namespace WebCore
+
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformnixMIMETypeRegistryNixcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/nix/MIMETypeRegistryNix.cpp (0 => 160001)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/nix/MIMETypeRegistryNix.cpp         (rev 0)
+++ trunk/Source/WebCore/platform/nix/MIMETypeRegistryNix.cpp        2013-12-03 14:24:50 UTC (rev 160001)
</span><span class="lines">@@ -0,0 +1,98 @@
</span><ins>+/*
+ * Copyright (C) 2006 Zack Rusin <zack@kde.org>
+ * Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+ * Copyright (C) 2008 Torch Mobile Inc. http://www.torchmobile.com/
+ * Copyright (C) 2009-2010 ProFUSION embedded systems
+ * Copyright (C) 2009-2010 Samsung Electronics
+ * Copyright (C) 2012, 2013 Nokia Corporation and/or its subsidiary(-ies).
+ *
+ * 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 COMPUTER, 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 COMPUTER, 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 "config.h"
+#include "MIMETypeRegistry.h"
+
+#include <wtf/Assertions.h>
+#include <wtf/MainThread.h>
+
+namespace WebCore {
+
+struct ExtensionMap {
+ const char* extension;
+ const char* mimeType;
+};
+
+static const ExtensionMap extensionMap[] = {
+ { "bmp", "image/bmp" },
+ { "css", "text/css" },
+ { "gif", "image/gif" },
+ { "html", "text/html" },
+ { "htm", "text/html" },
+ { "ico", "image/x-icon" },
+ { "jpeg", "image/jpeg" },
+ { "jpg", "image/jpeg" },
+ { "js", "application/x-javascript" },
+ { "mng", "video/x-mng" },
+ { "pbm", "image/x-portable-bitmap" },
+ { "pgm", "image/x-portable-graymap" },
+ { "pdf", "application/pdf" },
+ { "png", "image/png" },
+ { "ppm", "image/x-portable-pixmap" },
+ { "rss", "application/rss+xml" },
+ { "svg", "image/svg+xml" },
+ { "text", "text/plain" },
+ { "tif", "image/tiff" },
+ { "tiff", "image/tiff" },
+ { "txt", "text/plain" },
+ { "xbm", "image/x-xbitmap" },
+ { "xml", "text/xml" },
+ { "xpm", "image/x-xpm" },
+ { "xsl", "text/xsl" },
+ { "xhtml", "application/xhtml+xml" },
+ { "wml", "text/vnd.wap.wml" },
+ { "wmlc", "application/vnd.wap.wmlc" },
+ { 0, 0 }
+};
+
+String MIMETypeRegistry::getMIMETypeForExtension(const String &ext)
+{
+ ASSERT(isMainThread());
+
+ String lowerCaseExt = ext.lower();
+ const ExtensionMap* extMap = extensionMap;
+ while (extMap->extension) {
+ if (lowerCaseExt == extMap->extension)
+ return extMap->mimeType;
+ ++extMap;
+ }
+
+ return String();
+}
+
+bool MIMETypeRegistry::isApplicationPluginMIMEType(const String&)
+{
+ return false;
+}
+
+} // namespace WebCore
+
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformnixSharedTimerNixcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/nix/SharedTimerNix.cpp (0 => 160001)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/nix/SharedTimerNix.cpp         (rev 0)
+++ trunk/Source/WebCore/platform/nix/SharedTimerNix.cpp        2013-12-03 14:24:50 UTC (rev 160001)
</span><span class="lines">@@ -0,0 +1,75 @@
</span><ins>+/*
+ * Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com
+ * All rights reserved.
+ * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies).
+ *
+ * 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 COMPUTER, 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 COMPUTER, 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 "config.h"
+#include "SharedTimer.h"
+
+#define GDK_PRIORITY_REDRAW (G_PRIORITY_HIGH_IDLE + 20)
+#include <glib.h>
+#include <wtf/Assertions.h>
+#include <wtf/CurrentTime.h>
+
+namespace WebCore {
+
+static guint sharedTimer;
+static void (*sharedTimerFiredFunction)();
+
+void setSharedTimerFiredFunction(void (*firedFunction)())
+{
+ sharedTimerFiredFunction = firedFunction;
+}
+
+static gboolean timeoutCallback(gpointer)
+{
+ if (sharedTimerFiredFunction)
+ sharedTimerFiredFunction();
+ return FALSE;
+}
+
+void setSharedTimerFireInterval(double interval)
+{
+ ASSERT(sharedTimerFiredFunction);
+
+ guint intervalInMS = static_cast<guint>(interval * 1000);
+
+ stopSharedTimer();
+ sharedTimer = g_timeout_add_full(GDK_PRIORITY_REDRAW, intervalInMS, timeoutCallback, 0, 0);
+}
+
+void stopSharedTimer()
+{
+ if (!sharedTimer)
+ return;
+
+ gboolean removedSource = g_source_remove(sharedTimer);
+ ASSERT_UNUSED(removedSource, removedSource);
+ sharedTimer = 0;
+}
+
+} // namespace WebCore
+
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformnixTemporaryLinkStubscpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/nix/TemporaryLinkStubs.cpp (0 => 160001)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/nix/TemporaryLinkStubs.cpp         (rev 0)
+++ trunk/Source/WebCore/platform/nix/TemporaryLinkStubs.cpp        2013-12-03 14:24:50 UTC (rev 160001)
</span><span class="lines">@@ -0,0 +1,45 @@
</span><ins>+/*
+ * Copyright (C) 2012, 2013 Nokia Corporation and/or its subsidiary(-ies).
+ *
+ * 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 THE COPYRIGHT HOLDERS ``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 THE COPYRIGHT HOLDERS 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 "config.h"
+
+#include "NotImplemented.h"
+#include "SSLKeyGenerator.h"
+#include "URL.h"
+
+namespace WebCore {
+
+void getSupportedKeySizes(Vector<String>&)
+{
+ notImplemented();
+}
+
+String signedPublicKeyAndChallengeString(unsigned, const String&, const URL&)
+{
+ return String();
+}
+
+} // namespace WebCore
+
</ins></span></pre>
</div>
</div>
</body>
</html>