Diff
Modified: trunk/Source/WebCore/ChangeLog (119823 => 119824)
--- trunk/Source/WebCore/ChangeLog 2012-06-08 12:29:29 UTC (rev 119823)
+++ trunk/Source/WebCore/ChangeLog 2012-06-08 12:46:06 UTC (rev 119824)
@@ -1,3 +1,38 @@
+2012-06-08 Sheriff Bot <[email protected]>
+
+ Unreviewed, rolling out r119821.
+ http://trac.webkit.org/changeset/119821
+ https://bugs.webkit.org/show_bug.cgi?id=88648
+
+ Seems to have regression on Mac (Requested by kinuko on
+ #webkit).
+
+ * fileapi/File.cpp:
+ (WebCore::File::File):
+ (WebCore::File::lastModifiedDate):
+ (WebCore::File::lastModifiedDateForBinding):
+ (WebCore):
+ (WebCore::File::captureSnapshot):
+ * fileapi/File.h:
+ (File):
+ * fileapi/File.idl:
+ * platform/FileMetadata.h:
+ (WebCore::FileMetadata::FileMetadata):
+ * platform/FileSystem.h:
+ * platform/chromium/support/WebHTTPBody.cpp:
+ (WebKit::WebHTTPBody::elementAt):
+ * platform/network/BlobData.cpp:
+ (WebCore):
+ * platform/network/BlobData.h:
+ (BlobDataItem):
+ (WebCore::BlobDataItem::BlobDataItem):
+ * platform/network/FormData.cpp:
+ (WebCore::FormData::appendFile):
+ * platform/network/cf/FormDataStreamCFNet.cpp:
+ (WebCore::advanceCurrentStream):
+ * platform/network/soup/ResourceHandleSoup.cpp:
+ (WebCore::blobIsOutOfDate):
+
2012-06-08 Kinuko Yasuda <[email protected]>
Unreviewed, removing duplicated entries in gyp.
Modified: trunk/Source/WebCore/fileapi/File.cpp (119823 => 119824)
--- trunk/Source/WebCore/fileapi/File.cpp 2012-06-08 12:29:29 UTC (rev 119823)
+++ trunk/Source/WebCore/fileapi/File.cpp 2012-06-08 12:46:06 UTC (rev 119824)
@@ -86,7 +86,7 @@
, m_name(pathGetFileName(path))
#if ENABLE(FILE_SYSTEM)
, m_snapshotSize(-1)
- , m_snapshotModificationTime(invalidFileTime())
+ , m_snapshotModificationTime(0)
#endif
{
}
@@ -96,7 +96,7 @@
, m_path(path)
#if ENABLE(FILE_SYSTEM)
, m_snapshotSize(-1)
- , m_snapshotModificationTime(invalidFileTime())
+ , m_snapshotModificationTime(0)
#endif
{
m_name = pathGetFileName(path);
@@ -111,7 +111,7 @@
, m_name(name)
#if ENABLE(FILE_SYSTEM)
, m_snapshotSize(-1)
- , m_snapshotModificationTime(invalidFileTime())
+ , m_snapshotModificationTime(0)
#endif
{
}
@@ -136,12 +136,18 @@
time_t modificationTime;
if (!getFileModificationTime(m_path, modificationTime))
- return invalidFileTime();
+ return 0;
// Needs to return epoch time in milliseconds for Date.
return modificationTime * 1000.0;
}
+double File::lastModifiedDateForBinding() const
+{
+ double value = lastModifiedDate();
+ return (!value) ? std::numeric_limits<double>::quiet_NaN() : value;
+}
+
unsigned long long File::size() const
{
#if ENABLE(FILE_SYSTEM)
@@ -172,7 +178,7 @@
FileMetadata metadata;
if (!getFileMetadata(m_path, metadata)) {
snapshotSize = 0;
- snapshotModificationTime = invalidFileTime();
+ snapshotModificationTime = 0;
return;
}
Modified: trunk/Source/WebCore/fileapi/File.h (119823 => 119824)
--- trunk/Source/WebCore/fileapi/File.h 2012-06-08 12:29:29 UTC (rev 119823)
+++ trunk/Source/WebCore/fileapi/File.h 2012-06-08 12:46:06 UTC (rev 119824)
@@ -77,9 +77,12 @@
const String& path() const { return m_path; }
const String& name() const { return m_name; }
- // This may return NaN (which is converted to null Date in _javascript_ layer) if getFileModificationTime() platform call has failed or the information is not available.
+ // This may return zero if getFileModificationTime() platform call has failed or zero snapshot lastModifiedTime is given at construction time.
double lastModifiedDate() const;
+ // For binding. We want to return null Date if we get the value 0 Date (which is used to indicate the information is unavailable).
+ double lastModifiedDateForBinding() const;
+
#if ENABLE(DIRECTORY_UPLOAD)
// Returns the relative path of this file in the context of a directory selection.
const String& webkitRelativePath() const { return m_relativePath; }
Modified: trunk/Source/WebCore/fileapi/File.idl (119823 => 119824)
--- trunk/Source/WebCore/fileapi/File.idl 2012-06-08 12:29:29 UTC (rev 119823)
+++ trunk/Source/WebCore/fileapi/File.idl 2012-06-08 12:46:06 UTC (rev 119824)
@@ -32,7 +32,7 @@
] File : Blob {
readonly attribute DOMString name;
#if !defined(LANGUAGE_GOBJECT) || !LANGUAGE_GOBJECT
- readonly attribute Date lastModifiedDate;
+ readonly attribute [ImplementedAs=lastModifiedDateForBinding] Date lastModifiedDate;
#endif
#if defined(ENABLE_DIRECTORY_UPLOAD) && ENABLE_DIRECTORY_UPLOAD
readonly attribute DOMString webkitRelativePath;
Modified: trunk/Source/WebCore/platform/FileMetadata.h (119823 => 119824)
--- trunk/Source/WebCore/platform/FileMetadata.h 2012-06-08 12:29:29 UTC (rev 119823)
+++ trunk/Source/WebCore/platform/FileMetadata.h 2012-06-08 12:46:06 UTC (rev 119824)
@@ -31,7 +31,6 @@
#ifndef FileMetadata_h
#define FileMetadata_h
-#include "FileSystem.h"
#include <wtf/text/WTFString.h>
namespace WebCore {
@@ -57,7 +56,7 @@
String platformPath;
#endif
- FileMetadata() : modificationTime(invalidFileTime()), length(-1), type(TypeUnknown) { }
+ FileMetadata() : modificationTime(0.0), length(-1), type(TypeUnknown) { }
};
} // namespace WebCore
Modified: trunk/Source/WebCore/platform/FileSystem.h (119823 => 119824)
--- trunk/Source/WebCore/platform/FileSystem.h 2012-06-08 12:29:29 UTC (rev 119823)
+++ trunk/Source/WebCore/platform/FileSystem.h 2012-06-08 12:46:06 UTC (rev 119824)
@@ -33,7 +33,6 @@
#include "PlatformString.h"
#include <time.h>
#include <wtf/Forward.h>
-#include <wtf/MathExtras.h>
#include <wtf/Vector.h>
#if USE(CF)
@@ -175,9 +174,6 @@
inline bool isHandleValid(const PlatformFileHandle& handle) { return handle != invalidPlatformFileHandle; }
-inline double invalidFileTime() { return std::numeric_limits<double>::quiet_NaN(); }
-inline bool isValidFileTime(double time) { return isfinite(time); }
-
// Prefix is what the filename should be prefixed with, not the full path.
String openTemporaryFile(const String& prefix, PlatformFileHandle&);
PlatformFileHandle openFile(const String& path, FileOpenMode);
Modified: trunk/Source/WebCore/platform/chromium/support/WebHTTPBody.cpp (119823 => 119824)
--- trunk/Source/WebCore/platform/chromium/support/WebHTTPBody.cpp 2012-06-08 12:29:29 UTC (rev 119823)
+++ trunk/Source/WebCore/platform/chromium/support/WebHTTPBody.cpp 2012-06-08 12:46:06 UTC (rev 119824)
@@ -31,7 +31,6 @@
#include "config.h"
#include <public/WebHTTPBody.h>
-#include "FileSystem.h"
#include "FormData.h"
using namespace WebCore;
@@ -78,7 +77,7 @@
result.filePath.reset();
result.fileStart = 0;
result.fileLength = 0;
- result.modificationTime = invalidFileTime();
+ result.modificationTime = 0.0;
result.blobURL = KURL();
switch (element.m_type) {
Modified: trunk/Source/WebCore/platform/network/BlobData.cpp (119823 => 119824)
--- trunk/Source/WebCore/platform/network/BlobData.cpp 2012-06-08 12:29:29 UTC (rev 119823)
+++ trunk/Source/WebCore/platform/network/BlobData.cpp 2012-06-08 12:46:06 UTC (rev 119824)
@@ -30,7 +30,6 @@
#include "config.h"
#include "BlobData.h"
-#include "FileSystem.h"
#include <wtf/OwnPtr.h>
#include <wtf/PassOwnPtr.h>
@@ -41,6 +40,7 @@
namespace WebCore {
const long long BlobDataItem::toEndOfFile = -1;
+const double BlobDataItem::doNotCheckFileChange = 0;
RawData::RawData()
{
Modified: trunk/Source/WebCore/platform/network/BlobData.h (119823 => 119824)
--- trunk/Source/WebCore/platform/network/BlobData.h 2012-06-08 12:29:29 UTC (rev 119823)
+++ trunk/Source/WebCore/platform/network/BlobData.h 2012-06-08 12:46:06 UTC (rev 119824)
@@ -31,7 +31,6 @@
#ifndef BlobData_h
#define BlobData_h
-#include "FileSystem.h"
#include "KURL.h"
#include "PlatformString.h"
#include <wtf/Forward.h>
@@ -60,13 +59,14 @@
struct BlobDataItem {
static const long long toEndOfFile;
+ static const double doNotCheckFileChange;
// Default constructor.
BlobDataItem()
: type(Data)
, offset(0)
, length(toEndOfFile)
- , expectedModificationTime(invalidFileTime())
+ , expectedModificationTime(doNotCheckFileChange)
{
}
@@ -76,7 +76,7 @@
, data(data)
, offset(0)
, length(toEndOfFile)
- , expectedModificationTime(invalidFileTime())
+ , expectedModificationTime(doNotCheckFileChange)
{
}
@@ -86,7 +86,7 @@
, path(path)
, offset(0)
, length(toEndOfFile)
- , expectedModificationTime(invalidFileTime())
+ , expectedModificationTime(doNotCheckFileChange)
{
}
@@ -99,14 +99,14 @@
, expectedModificationTime(expectedModificationTime)
{
}
-
+
// Constructor for Blob type.
BlobDataItem(const KURL& url, long long offset, long long length)
: type(Blob)
, url(url)
, offset(offset)
, length(length)
- , expectedModificationTime(invalidFileTime())
+ , expectedModificationTime(doNotCheckFileChange)
{
}
@@ -114,7 +114,7 @@
void detachFromCurrentThread();
enum { Data, File, Blob } type;
-
+
// For Data type.
RefPtr<RawData> data;
@@ -137,7 +137,7 @@
, data(data)
, offset(offset)
, length(length)
- , expectedModificationTime(invalidFileTime())
+ , expectedModificationTime(doNotCheckFileChange)
{
}
};
Modified: trunk/Source/WebCore/platform/network/FormData.cpp (119823 => 119824)
--- trunk/Source/WebCore/platform/network/FormData.cpp 2012-06-08 12:29:29 UTC (rev 119823)
+++ trunk/Source/WebCore/platform/network/FormData.cpp 2012-06-08 12:46:06 UTC (rev 119824)
@@ -164,7 +164,7 @@
void FormData::appendFile(const String& filename, bool shouldGenerateFile)
{
#if ENABLE(BLOB)
- m_elements.append(FormDataElement(filename, 0, BlobDataItem::toEndOfFile, invalidFileTime(), shouldGenerateFile));
+ m_elements.append(FormDataElement(filename, 0, BlobDataItem::toEndOfFile, BlobDataItem::doNotCheckFileChange, shouldGenerateFile));
#else
m_elements.append(FormDataElement(filename, shouldGenerateFile));
#endif
Modified: trunk/Source/WebCore/platform/network/cf/FormDataStreamCFNet.cpp (119823 => 119824)
--- trunk/Source/WebCore/platform/network/cf/FormDataStreamCFNet.cpp 2012-06-08 12:29:29 UTC (rev 119823)
+++ trunk/Source/WebCore/platform/network/cf/FormDataStreamCFNet.cpp 2012-06-08 12:46:06 UTC (rev 119824)
@@ -156,7 +156,7 @@
} else {
#if ENABLE(BLOB)
// Check if the file has been changed or not if required.
- if (isValidFileTime(nextInput.m_expectedFileModificationTime)) {
+ if (nextInput.m_expectedFileModificationTime != BlobDataItem::doNotCheckFileChange) {
time_t fileModificationTime;
if (!getFileModificationTime(nextInput.m_filename, fileModificationTime) || fileModificationTime != static_cast<time_t>(nextInput.m_expectedFileModificationTime))
return false;
Modified: trunk/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp (119823 => 119824)
--- trunk/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp 2012-06-08 12:29:29 UTC (rev 119823)
+++ trunk/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp 2012-06-08 12:46:06 UTC (rev 119824)
@@ -428,7 +428,7 @@
static bool blobIsOutOfDate(const BlobDataItem& blobItem)
{
ASSERT(blobItem.type == BlobDataItem::File);
- if (!isValidFileTime(blobItem.expectedModificationTime))
+ if (blobItem.expectedModificationTime == BlobDataItem::doNotCheckFileChange)
return false;
time_t fileModificationTime;