Title: [133488] trunk/Source/WebCore
Revision
133488
Author
[email protected]
Date
2012-11-05 09:33:27 -0800 (Mon, 05 Nov 2012)

Log Message

[EFL] Use POSIX implementation of SharedBuffer::createWithContentsOfFile()
https://bugs.webkit.org/show_bug.cgi?id=101228

Patch by Christophe Dumez <[email protected]> on 2012-11-05
Reviewed by Kenneth Rohde Christiansen.

Get rid of EFL-specific implementation of SharedBuffer::createWithContentsOfFile()
and reuse the POSIX one since it is pretty much the same.

No new tests, no behavior change.

* PlatformEfl.cmake:
* platform/efl/SharedBufferEfl.cpp: Removed.

Modified Paths

Removed Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (133487 => 133488)


--- trunk/Source/WebCore/ChangeLog	2012-11-05 17:25:15 UTC (rev 133487)
+++ trunk/Source/WebCore/ChangeLog	2012-11-05 17:33:27 UTC (rev 133488)
@@ -1,3 +1,18 @@
+2012-11-05  Christophe Dumez  <[email protected]>
+
+        [EFL] Use POSIX implementation of SharedBuffer::createWithContentsOfFile()
+        https://bugs.webkit.org/show_bug.cgi?id=101228
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Get rid of EFL-specific implementation of SharedBuffer::createWithContentsOfFile()
+        and reuse the POSIX one since it is pretty much the same.
+
+        No new tests, no behavior change.
+
+        * PlatformEfl.cmake:
+        * platform/efl/SharedBufferEfl.cpp: Removed.
+
 2012-11-05  Kentaro Hara  <[email protected]>
 
         Add a comment about a return value of IDBKey::toV8()

Modified: trunk/Source/WebCore/PlatformEfl.cmake (133487 => 133488)


--- trunk/Source/WebCore/PlatformEfl.cmake	2012-11-05 17:25:15 UTC (rev 133487)
+++ trunk/Source/WebCore/PlatformEfl.cmake	2012-11-05 17:33:27 UTC (rev 133488)
@@ -45,7 +45,6 @@
   platform/efl/ScrollViewEfl.cpp
   platform/efl/ScrollbarEfl.cpp
   platform/efl/ScrollbarThemeEfl.cpp
-  platform/efl/SharedBufferEfl.cpp
   platform/efl/SharedTimerEfl.cpp
   platform/efl/SoundEfl.cpp
   platform/efl/SystemTimeEfl.cpp
@@ -85,6 +84,7 @@
   platform/network/soup/SoupURIUtils.cpp
   platform/PlatformStrategies.cpp
   platform/posix/FileSystemPOSIX.cpp
+  platform/posix/SharedBufferPOSIX.cpp
   platform/text/efl/TextBreakIteratorInternalICUEfl.cpp
   platform/text/enchant/TextCheckerEnchant.cpp
 )

Deleted: trunk/Source/WebCore/platform/efl/SharedBufferEfl.cpp (133487 => 133488)


--- trunk/Source/WebCore/platform/efl/SharedBufferEfl.cpp	2012-11-05 17:25:15 UTC (rev 133487)
+++ trunk/Source/WebCore/platform/efl/SharedBufferEfl.cpp	2012-11-05 17:33:27 UTC (rev 133488)
@@ -1,62 +0,0 @@
-/*
- * Copyright (C) 2008 Holger Hans Peter Freyther
- *               2008 Kenneth Rohde Christiansen
- *               2009-2010 ProFUSION embedded systems
- *               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 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 "SharedBuffer.h"
-
-#include <stdio.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <unistd.h>
-#include <wtf/text/CString.h>
-
-namespace WebCore {
-
-PassRefPtr<SharedBuffer> SharedBuffer::createWithContentsOfFile(const String& filePath)
-{
-    if (filePath.isEmpty())
-        return 0;
-
-    FILE* file = fopen(filePath.utf8().data(), "rb");
-    if (!file)
-        return 0;
-
-    struct stat fileStat;
-    if (fstat(fileno(file), &fileStat)) {
-        fclose(file);
-        return 0;
-    }
-
-    Vector<char> buffer(fileStat.st_size);
-    const size_t bytesRead = fread(buffer.data(), 1, buffer.size(), file);
-    fclose(file);
-
-    return (bytesRead == buffer.size()) ? SharedBuffer::adoptVector(buffer) : 0;
-}
-
-} // namespace WebCore
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to