Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(305)

Unified Diff: Source/WebCore/fileapi/File.cpp

Issue 13497009: Remove ENABLE(FILE_SYSTEM) compile-time flag. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: added CodeGeneratorInspector.py change Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/WebCore/fileapi/File.h ('k') | Source/WebCore/fileapi/FileError.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/fileapi/File.cpp
diff --git a/Source/WebCore/fileapi/File.cpp b/Source/WebCore/fileapi/File.cpp
index 147b4d48574f1a9e45d8fd1c7b0bac449f715dc5..06527ae904f2d8cc3f7264048f0e6d1225e46dff 100644
--- a/Source/WebCore/fileapi/File.cpp
+++ b/Source/WebCore/fileapi/File.cpp
@@ -68,7 +68,6 @@ static PassOwnPtr<BlobData> createBlobDataForFileWithName(const String& path, co
return createBlobDataForFileWithType(path, getContentTypeFromFileName(fileSystemName, policy));
}
-#if ENABLE(FILE_SYSTEM)
static PassOwnPtr<BlobData> createBlobDataForFileWithMetadata(const String& fileSystemName, const FileMetadata& metadata)
{
OwnPtr<BlobData> blobData = BlobData::create();
@@ -84,7 +83,6 @@ static PassOwnPtr<BlobData> createBlobDataForFileSystemURL(const KURL& fileSyste
blobData->appendURL(fileSystemURL, 0, metadata.length, metadata.modificationTime);
return blobData.release();
}
-#endif
#if ENABLE(DIRECTORY_UPLOAD)
PassRefPtr<File> File::createWithRelativePath(const String& path, const String& relativePath)
@@ -99,20 +97,16 @@ File::File(const String& path, ContentTypeLookupPolicy policy)
: Blob(createBlobDataForFile(path, policy), -1)
, m_path(path)
, m_name(pathGetFileName(path))
-#if ENABLE(FILE_SYSTEM)
, m_snapshotSize(-1)
, m_snapshotModificationTime(invalidFileTime())
-#endif
{
}
File::File(const String& path, const KURL& url, const String& type)
: Blob(url, type, -1)
, m_path(path)
-#if ENABLE(FILE_SYSTEM)
, m_snapshotSize(-1)
, m_snapshotModificationTime(invalidFileTime())
-#endif
{
m_name = pathGetFileName(path);
// FIXME: File object serialization/deserialization does not include
@@ -124,14 +118,11 @@ File::File(const String& path, const String& name, ContentTypeLookupPolicy polic
: Blob(createBlobDataForFileWithName(path, name, policy), -1)
, m_path(path)
, m_name(name)
-#if ENABLE(FILE_SYSTEM)
, m_snapshotSize(-1)
, m_snapshotModificationTime(invalidFileTime())
-#endif
{
}
-#if ENABLE(FILE_SYSTEM)
File::File(const String& name, const FileMetadata& metadata)
: Blob(createBlobDataForFileWithMetadata(name, metadata), metadata.length)
, m_path(metadata.platformPath)
@@ -148,14 +139,11 @@ File::File(const KURL& fileSystemURL, const FileMetadata& metadata)
, m_snapshotModificationTime(metadata.modificationTime)
{
}
-#endif
double File::lastModifiedDate() const
{
-#if ENABLE(FILE_SYSTEM)
if (hasValidSnapshotMetadata() && isValidFileTime(m_snapshotModificationTime))
return m_snapshotModificationTime * msPerSecond;
-#endif
time_t modificationTime;
if (getFileModificationTime(m_path, modificationTime) && isValidFileTime(modificationTime))
@@ -166,10 +154,8 @@ double File::lastModifiedDate() const
unsigned long long File::size() const
{
-#if ENABLE(FILE_SYSTEM)
if (hasValidSnapshotMetadata())
return m_snapshotSize;
-#endif
// FIXME: JavaScript cannot represent sizes as large as unsigned long long, we need to
// come up with an exception to throw if file size is not representable.
@@ -181,13 +167,11 @@ unsigned long long File::size() const
void File::captureSnapshot(long long& snapshotSize, double& snapshotModificationTime) const
{
-#if ENABLE(FILE_SYSTEM)
if (hasValidSnapshotMetadata()) {
snapshotSize = m_snapshotSize;
snapshotModificationTime = m_snapshotModificationTime;
return;
}
-#endif
// Obtains a snapshot of the file by capturing its current size and modification time. This is used when we slice a file for the first time.
// If we fail to retrieve the size or modification time, probably due to that the file has been deleted, 0 size is returned.
« no previous file with comments | « Source/WebCore/fileapi/File.h ('k') | Source/WebCore/fileapi/FileError.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698