Title: [118597] trunk/Source
Revision
118597
Author
[email protected]
Date
2012-05-25 18:43:14 -0700 (Fri, 25 May 2012)

Log Message

[chromium] Deprecate FileUtilities::getFileSize and getFileModifiedTime in favor of getFileMetadata
https://bugs.webkit.org/show_bug.cgi?id=87492

Reviewed by Adam Barth.

Source/Platform:

* chromium/public/WebFileUtilities.h:

Source/WebCore:

No new tests: existing tests (http/tests/local/fileapi/* and fast/files/*) should pass.

* platform/chromium/FileSystemChromium.cpp:
(WebCore::getFileSize):
(WebCore::getFileModificationTime):
(WebCore::getFileMetadata):
* platform/chromium/PlatformSupport.h:
(PlatformSupport):

Source/WebKit/chromium:

* src/PlatformSupport.cpp:
(WebCore::PlatformSupport::getFileMetadata):

Modified Paths

Diff

Modified: trunk/Source/Platform/ChangeLog (118596 => 118597)


--- trunk/Source/Platform/ChangeLog	2012-05-26 01:25:18 UTC (rev 118596)
+++ trunk/Source/Platform/ChangeLog	2012-05-26 01:43:14 UTC (rev 118597)
@@ -1,3 +1,12 @@
+2012-05-25  Kinuko Yasuda  <[email protected]>
+
+        [chromium] Deprecate FileUtilities::getFileSize and getFileModifiedTime in favor of getFileMetadata
+        https://bugs.webkit.org/show_bug.cgi?id=87492
+
+        Reviewed by Adam Barth.
+
+        * chromium/public/WebFileUtilities.h:
+
 2012-05-25  Mark Pilgrim  <[email protected]>
 
         [Chomium] Move sandboxSupport to Platform.h

Modified: trunk/Source/Platform/chromium/public/WebFileUtilities.h (118596 => 118597)


--- trunk/Source/Platform/chromium/public/WebFileUtilities.h	2012-05-26 01:25:18 UTC (rev 118596)
+++ trunk/Source/Platform/chromium/public/WebFileUtilities.h	2012-05-26 01:43:14 UTC (rev 118597)
@@ -53,9 +53,6 @@
     virtual bool fileExists(const WebString& path) { return false; }
     virtual bool deleteFile(const WebString& path) { return false; }
     virtual bool deleteEmptyDirectory(const WebString& path) { return false; }
-    // FIXME: Deprecate getFileSize and getFileModificationTime once getFileInfo is implemented.
-    virtual bool getFileSize(const WebString& path, long long& result) { return false; }
-    virtual bool getFileModificationTime(const WebString& path, double& result) { return false; }
     virtual bool getFileInfo(const WebString& path, WebFileInfo& result) { return false; }
     virtual WebString directoryName(const WebString& path)  { return WebString(); }
     virtual WebString pathByAppendingComponent(const WebString& path, const WebString& component)  { return WebString(); }

Modified: trunk/Source/WebCore/ChangeLog (118596 => 118597)


--- trunk/Source/WebCore/ChangeLog	2012-05-26 01:25:18 UTC (rev 118596)
+++ trunk/Source/WebCore/ChangeLog	2012-05-26 01:43:14 UTC (rev 118597)
@@ -1,3 +1,19 @@
+2012-05-25  Kinuko Yasuda  <[email protected]>
+
+        [chromium] Deprecate FileUtilities::getFileSize and getFileModifiedTime in favor of getFileMetadata
+        https://bugs.webkit.org/show_bug.cgi?id=87492
+
+        Reviewed by Adam Barth.
+
+        No new tests: existing tests (http/tests/local/fileapi/* and fast/files/*) should pass.
+
+        * platform/chromium/FileSystemChromium.cpp:
+        (WebCore::getFileSize):
+        (WebCore::getFileModificationTime):
+        (WebCore::getFileMetadata):
+        * platform/chromium/PlatformSupport.h:
+        (PlatformSupport):
+
 2012-05-25  Abhishek Arya  <[email protected]>
 
         Crash in RenderTableSection::paintCell.

Modified: trunk/Source/WebCore/platform/chromium/FileSystemChromium.cpp (118596 => 118597)


--- trunk/Source/WebCore/platform/chromium/FileSystemChromium.cpp	2012-05-26 01:25:18 UTC (rev 118596)
+++ trunk/Source/WebCore/platform/chromium/FileSystemChromium.cpp	2012-05-26 01:43:14 UTC (rev 118597)
@@ -50,25 +50,25 @@
 
 bool getFileSize(const String& path, long long& result)
 {
-    return PlatformSupport::getFileSize(path, result);
+    FileMetadata metadata;
+    if (!PlatformSupport::getFileMetadata(path, metadata))
+        return false;
+    result = metadata.length;
+    return true;
 }
 
 bool getFileModificationTime(const String& path, time_t& result)
 {
-    return PlatformSupport::getFileModificationTime(path, result);
+    FileMetadata metadata;
+    if (!PlatformSupport::getFileMetadata(path, metadata))
+        return false;
+    result = metadata.modificationTime;
+    return true;
 }
 
 bool getFileMetadata(const String& path, FileMetadata& metadata)
 {
-    // FIXME: Call PlatformSupport::getFileMetadata once it is implemented.
-    // return PlatformSupport::getFileMetadata(path, metadata);
-    if (!PlatformSupport::getFileSize(path, metadata.length))
-        return false;
-    time_t modificationTime;
-    if (!PlatformSupport::getFileModificationTime(path, modificationTime))
-        return false;
-    metadata.modificationTime = modificationTime;
-    return true;
+    return PlatformSupport::getFileMetadata(path, metadata);
 }
 
 String directoryName(const String& path)

Modified: trunk/Source/WebCore/platform/chromium/PlatformSupport.h (118596 => 118597)


--- trunk/Source/WebCore/platform/chromium/PlatformSupport.h	2012-05-26 01:25:18 UTC (rev 118596)
+++ trunk/Source/WebCore/platform/chromium/PlatformSupport.h	2012-05-26 01:43:14 UTC (rev 118597)
@@ -126,8 +126,6 @@
     static bool fileExists(const String&);
     static bool deleteFile(const String&);
     static bool deleteEmptyDirectory(const String&);
-    static bool getFileSize(const String&, long long& result);
-    static bool getFileModificationTime(const String&, time_t& result);
     static bool getFileMetadata(const String&, FileMetadata& result);
     static String directoryName(const String& path);
     static String pathByAppendingComponent(const String& path, const String& component);

Modified: trunk/Source/WebKit/chromium/ChangeLog (118596 => 118597)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-05-26 01:25:18 UTC (rev 118596)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-05-26 01:43:14 UTC (rev 118597)
@@ -1,3 +1,13 @@
+2012-05-25  Kinuko Yasuda  <[email protected]>
+
+        [chromium] Deprecate FileUtilities::getFileSize and getFileModifiedTime in favor of getFileMetadata
+        https://bugs.webkit.org/show_bug.cgi?id=87492
+
+        Reviewed by Adam Barth.
+
+        * src/PlatformSupport.cpp:
+        (WebCore::PlatformSupport::getFileMetadata):
+
 2012-05-25  Ryosuke Niwa  <[email protected]>
 
         Roll Chromium DEPS from r139024 to r139156 in an attempt to fix Chromium Win builds.

Modified: trunk/Source/WebKit/chromium/src/PlatformSupport.cpp (118596 => 118597)


--- trunk/Source/WebKit/chromium/src/PlatformSupport.cpp	2012-05-26 01:25:18 UTC (rev 118596)
+++ trunk/Source/WebKit/chromium/src/PlatformSupport.cpp	2012-05-26 01:43:14 UTC (rev 118597)
@@ -317,20 +317,6 @@
     return WebKit::Platform::current()->fileUtilities()->deleteEmptyDirectory(path);
 }
 
-bool PlatformSupport::getFileSize(const String& path, long long& result)
-{
-    return WebKit::Platform::current()->fileUtilities()->getFileSize(path, result);
-}
-
-bool PlatformSupport::getFileModificationTime(const String& path, time_t& result)
-{
-    double modificationTime;
-    if (!WebKit::Platform::current()->fileUtilities()->getFileModificationTime(path, modificationTime))
-        return false;
-    result = static_cast<time_t>(modificationTime);
-    return true;
-}
-
 bool PlatformSupport::getFileMetadata(const String& path, FileMetadata& result)
 {
     WebFileInfo webFileInfo;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to