https://bugs.webkit.org/show_bug.cgi?id=86777
Reviewed by Adam Barth.
Part of a refactoring series. See tracking bug 82948.
Source/Platform:
* Platform.gypi:
* chromium/public/Platform.h:
(WebKit):
(Platform):
(WebKit::Platform::fileUtilities):
* chromium/public/WebFileUtilities.h: Added.
(WebKit):
(WebFileUtilities):
(WebKit::WebFileUtilities::revealFolderInOS):
(WebKit::WebFileUtilities::fileExists):
(WebKit::WebFileUtilities::deleteFile):
(WebKit::WebFileUtilities::deleteEmptyDirectory):
(WebKit::WebFileUtilities::getFileSize):
(WebKit::WebFileUtilities::getFileModificationTime):
(WebKit::WebFileUtilities::directoryName):
(WebKit::WebFileUtilities::pathByAppendingComponent):
(WebKit::WebFileUtilities::makeAllDirectories):
(WebKit::WebFileUtilities::getAbsolutePath):
(WebKit::WebFileUtilities::isDirectory):
(WebKit::WebFileUtilities::filePathToURL):
(WebKit::WebFileUtilities::openFile):
(WebKit::WebFileUtilities::closeFile):
(WebKit::WebFileUtilities::seekFile):
(WebKit::WebFileUtilities::truncateFile):
(WebKit::WebFileUtilities::readFromFile):
(WebKit::WebFileUtilities::writeToFile):
(WebKit::WebFileUtilities::~WebFileUtilities):
Source/WebKit/chromium:
* WebKit.gyp:
* public/WebFileUtilities.h:
* public/platform/WebKitPlatformSupport.h:
(WebKit):
(WebKitPlatformSupport):
* src/PlatformSupport.cpp:
(WebCore::PlatformSupport::fileExists):
(WebCore::PlatformSupport::deleteFile):
(WebCore::PlatformSupport::deleteEmptyDirectory):
(WebCore::PlatformSupport::getFileSize):
(WebCore::PlatformSupport::revealFolderInOS):
(WebCore::PlatformSupport::getFileModificationTime):
(WebCore::PlatformSupport::directoryName):
(WebCore::PlatformSupport::pathByAppendingComponent):
(WebCore::PlatformSupport::makeAllDirectories):
(WebCore::PlatformSupport::getAbsolutePath):
(WebCore::PlatformSupport::isDirectory):
(WebCore::PlatformSupport::filePathToURL):
(WebCore::PlatformSupport::openFile):
(WebCore::PlatformSupport::closeFile):
(WebCore::PlatformSupport::seekFile):
(WebCore::PlatformSupport::truncateFile):
(WebCore::PlatformSupport::readFromFile):
(WebCore::PlatformSupport::writeToFile):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@117520
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-05-17 Mark Pilgrim <pilgrim@chromium.org>
+
+ [Chromium] Move fileUtilities to Platform.h
+ https://bugs.webkit.org/show_bug.cgi?id=86777
+
+ Reviewed by Adam Barth.
+
+ Part of a refactoring series. See tracking bug 82948.
+
+ * Platform.gypi:
+ * chromium/public/Platform.h:
+ (WebKit):
+ (Platform):
+ (WebKit::Platform::fileUtilities):
+ * chromium/public/WebFileUtilities.h: Added.
+ (WebKit):
+ (WebFileUtilities):
+ (WebKit::WebFileUtilities::revealFolderInOS):
+ (WebKit::WebFileUtilities::fileExists):
+ (WebKit::WebFileUtilities::deleteFile):
+ (WebKit::WebFileUtilities::deleteEmptyDirectory):
+ (WebKit::WebFileUtilities::getFileSize):
+ (WebKit::WebFileUtilities::getFileModificationTime):
+ (WebKit::WebFileUtilities::directoryName):
+ (WebKit::WebFileUtilities::pathByAppendingComponent):
+ (WebKit::WebFileUtilities::makeAllDirectories):
+ (WebKit::WebFileUtilities::getAbsolutePath):
+ (WebKit::WebFileUtilities::isDirectory):
+ (WebKit::WebFileUtilities::filePathToURL):
+ (WebKit::WebFileUtilities::openFile):
+ (WebKit::WebFileUtilities::closeFile):
+ (WebKit::WebFileUtilities::seekFile):
+ (WebKit::WebFileUtilities::truncateFile):
+ (WebKit::WebFileUtilities::readFromFile):
+ (WebKit::WebFileUtilities::writeToFile):
+ (WebKit::WebFileUtilities::~WebFileUtilities):
+
2012-05-11 James Robinson <jamesr@chromium.org>
[chromium] Convert GraphicsLayerChromium to use WebLayer types
'chromium/public/WebDragData.h',
'chromium/public/WebExternalTextureLayer.h',
'chromium/public/WebFileSystem.h',
+ 'chromium/public/WebFileUtilities.h',
'chromium/public/WebFilterOperation.h',
'chromium/public/WebFilterOperations.h',
'chromium/public/WebFloatPoint.h',
class WebBlobRegistry;
class WebClipboard;
class WebFileSystem;
+class WebFileUtilities;
class WebMediaStreamCenter;
class WebMediaStreamCenterClient;
class WebMimeRegistry;
virtual WebClipboard* clipboard() { return 0; }
// Must return non-null.
+ virtual WebFileUtilities* fileUtilities() { return 0; }
+
+ // Must return non-null.
virtual WebMimeRegistry* mimeRegistry() { return 0; }
--- /dev/null
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * 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.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * 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.
+ */
+
+#ifndef WebFileUtilities_h
+#define WebFileUtilities_h
+
+#include "WebCommon.h"
+#include "WebString.h"
+#include "WebURL.h"
+
+#ifdef WIN32
+typedef void *HANDLE;
+#endif
+
+namespace WebKit {
+
+class WebFileUtilities {
+public:
+#ifdef WIN32
+ typedef HANDLE FileHandle;
+#else
+ typedef int FileHandle;
+#endif
+ virtual void revealFolderInOS(const WebString& path) { }
+ virtual bool fileExists(const WebString& path) { return false; }
+ virtual bool deleteFile(const WebString& path) { return false; }
+ virtual bool deleteEmptyDirectory(const WebString& path) { return false; }
+ virtual bool getFileSize(const WebString& path, long long& result) { return false; }
+ virtual bool getFileModificationTime(const WebString& path, double& result) { return false; }
+ virtual WebString directoryName(const WebString& path) { return WebString(); }
+ virtual WebString pathByAppendingComponent(const WebString& path, const WebString& component) { return WebString(); }
+ virtual bool makeAllDirectories(const WebString& path) { return false; }
+ virtual WebString getAbsolutePath(const WebString& path) { return WebString(); }
+ virtual bool isDirectory(const WebString& path) { return false; }
+ virtual WebURL filePathToURL(const WebString& path) { return WebURL(); }
+ virtual FileHandle openFile(const WebString& path, int mode) { return FileHandle(); }
+ // Should set the FileHandle to a invalid value if the file is closed successfully.
+ virtual void closeFile(FileHandle&) { }
+ virtual long long seekFile(FileHandle, long long offset, int origin) { return 0; }
+ virtual bool truncateFile(FileHandle, long long offset) { return false; }
+ virtual int readFromFile(FileHandle, char* data, int length) { return 0; }
+ virtual int writeToFile(FileHandle, const char* data, int length) { return 0; }
+
+protected:
+ ~WebFileUtilities() { }
+};
+
+} // namespace WebKit
+
+#endif
+2012-05-17 Mark Pilgrim <pilgrim@chromium.org>
+
+ [Chromium] Move fileUtilities to Platform.h
+ https://bugs.webkit.org/show_bug.cgi?id=86777
+
+ Reviewed by Adam Barth.
+
+ Part of a refactoring series. See tracking bug 82948.
+
+ * WebKit.gyp:
+ * public/WebFileUtilities.h:
+ * public/platform/WebKitPlatformSupport.h:
+ (WebKit):
+ (WebKitPlatformSupport):
+ * src/PlatformSupport.cpp:
+ (WebCore::PlatformSupport::fileExists):
+ (WebCore::PlatformSupport::deleteFile):
+ (WebCore::PlatformSupport::deleteEmptyDirectory):
+ (WebCore::PlatformSupport::getFileSize):
+ (WebCore::PlatformSupport::revealFolderInOS):
+ (WebCore::PlatformSupport::getFileModificationTime):
+ (WebCore::PlatformSupport::directoryName):
+ (WebCore::PlatformSupport::pathByAppendingComponent):
+ (WebCore::PlatformSupport::makeAllDirectories):
+ (WebCore::PlatformSupport::getAbsolutePath):
+ (WebCore::PlatformSupport::isDirectory):
+ (WebCore::PlatformSupport::filePathToURL):
+ (WebCore::PlatformSupport::openFile):
+ (WebCore::PlatformSupport::closeFile):
+ (WebCore::PlatformSupport::seekFile):
+ (WebCore::PlatformSupport::truncateFile):
+ (WebCore::PlatformSupport::readFromFile):
+ (WebCore::PlatformSupport::writeToFile):
+
2012-05-17 Joshua Bell <jsbell@chromium.org>
IndexedDB: Remove IDBIndex.storeName
'public/WebFileInfo.h',
'public/WebFileSystemCallbacks.h',
'public/WebFileSystemEntry.h',
- 'public/WebFileUtilities.h',
'public/WebFileWriter.h',
'public/WebFileWriterClient.h',
'public/WebFindOptions.h',
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef WebFileUtilities_h
-#define WebFileUtilities_h
-
-#include "platform/WebCommon.h"
-#include "platform/WebString.h"
-#include "platform/WebURL.h"
-
-#ifdef WIN32
-typedef void *HANDLE;
-#endif
-
-namespace WebKit {
-
-class WebFileUtilities {
-public:
-#ifdef WIN32
- typedef HANDLE FileHandle;
-#else
- typedef int FileHandle;
-#endif
- virtual void revealFolderInOS(const WebString& path) { }
- virtual bool fileExists(const WebString& path) { return false; }
- virtual bool deleteFile(const WebString& path) { return false; }
- virtual bool deleteEmptyDirectory(const WebString& path) { return false; }
- virtual bool getFileSize(const WebString& path, long long& result) { return false; }
- virtual bool getFileModificationTime(const WebString& path, double& result) { return false; }
- virtual WebString directoryName(const WebString& path) { return WebString(); }
- virtual WebString pathByAppendingComponent(const WebString& path, const WebString& component) { return WebString(); }
- virtual bool makeAllDirectories(const WebString& path) { return false; }
- virtual WebString getAbsolutePath(const WebString& path) { return WebString(); }
- virtual bool isDirectory(const WebString& path) { return false; }
- virtual WebURL filePathToURL(const WebString& path) { return WebURL(); }
- virtual FileHandle openFile(const WebString& path, int mode) { return FileHandle(); }
- // Should set the FileHandle to a invalid value if the file is closed successfully.
- virtual void closeFile(FileHandle&) { }
- virtual long long seekFile(FileHandle, long long offset, int origin) { return 0; }
- virtual bool truncateFile(FileHandle, long long offset) { return false; }
- virtual int readFromFile(FileHandle, char* data, int length) { return 0; }
- virtual int writeToFile(FileHandle, const char* data, int length) { return 0; }
-
-protected:
- ~WebFileUtilities() {}
-};
-
-} // namespace WebKit
-
-#endif
+#include "../../../Platform/chromium/public/WebFileUtilities.h"
class WebApplicationCacheHost; // FIXME: Does this belong in platform?
class WebApplicationCacheHostClient; // FIXME: Does this belong in platform?
class WebCookieJar;
-class WebFileUtilities;
class WebIDBFactory; // FIXME: Does this belong in platform?
class WebIDBKey; // FIXME: Does this belong in platform?
class WebMessagePortChannel; // FIXME: Does this belong in platform?
// FIXME: Eventually all these API will need to move to WebKit::Platform.
class WebKitPlatformSupport : public Platform {
public:
- // Must return non-null.
- virtual WebFileUtilities* fileUtilities() { return 0; }
-
// May return null if sandbox support is not necessary
virtual WebSandboxSupport* sandboxSupport() { return 0; }
bool PlatformSupport::fileExists(const String& path)
{
- return webKitPlatformSupport()->fileUtilities()->fileExists(path);
+ return WebKit::Platform::current()->fileUtilities()->fileExists(path);
}
bool PlatformSupport::deleteFile(const String& path)
{
- return webKitPlatformSupport()->fileUtilities()->deleteFile(path);
+ return WebKit::Platform::current()->fileUtilities()->deleteFile(path);
}
bool PlatformSupport::deleteEmptyDirectory(const String& path)
{
- return webKitPlatformSupport()->fileUtilities()->deleteEmptyDirectory(path);
+ return WebKit::Platform::current()->fileUtilities()->deleteEmptyDirectory(path);
}
bool PlatformSupport::getFileSize(const String& path, long long& result)
{
- return webKitPlatformSupport()->fileUtilities()->getFileSize(path, result);
+ return WebKit::Platform::current()->fileUtilities()->getFileSize(path, result);
}
void PlatformSupport::revealFolderInOS(const String& path)
{
- webKitPlatformSupport()->fileUtilities()->revealFolderInOS(path);
+ WebKit::Platform::current()->fileUtilities()->revealFolderInOS(path);
}
bool PlatformSupport::getFileModificationTime(const String& path, time_t& result)
{
double modificationTime;
- if (!webKitPlatformSupport()->fileUtilities()->getFileModificationTime(path, modificationTime))
+ if (!WebKit::Platform::current()->fileUtilities()->getFileModificationTime(path, modificationTime))
return false;
result = static_cast<time_t>(modificationTime);
return true;
String PlatformSupport::directoryName(const String& path)
{
- return webKitPlatformSupport()->fileUtilities()->directoryName(path);
+ return WebKit::Platform::current()->fileUtilities()->directoryName(path);
}
String PlatformSupport::pathByAppendingComponent(const String& path, const String& component)
{
- return webKitPlatformSupport()->fileUtilities()->pathByAppendingComponent(path, component);
+ return WebKit::Platform::current()->fileUtilities()->pathByAppendingComponent(path, component);
}
bool PlatformSupport::makeAllDirectories(const String& path)
{
- return webKitPlatformSupport()->fileUtilities()->makeAllDirectories(path);
+ return WebKit::Platform::current()->fileUtilities()->makeAllDirectories(path);
}
String PlatformSupport::getAbsolutePath(const String& path)
{
- return webKitPlatformSupport()->fileUtilities()->getAbsolutePath(path);
+ return WebKit::Platform::current()->fileUtilities()->getAbsolutePath(path);
}
bool PlatformSupport::isDirectory(const String& path)
{
- return webKitPlatformSupport()->fileUtilities()->isDirectory(path);
+ return WebKit::Platform::current()->fileUtilities()->isDirectory(path);
}
KURL PlatformSupport::filePathToURL(const String& path)
{
- return webKitPlatformSupport()->fileUtilities()->filePathToURL(path);
+ return WebKit::Platform::current()->fileUtilities()->filePathToURL(path);
}
PlatformFileHandle PlatformSupport::openFile(const String& path, FileOpenMode mode)
{
- return webKitPlatformSupport()->fileUtilities()->openFile(path, mode);
+ return WebKit::Platform::current()->fileUtilities()->openFile(path, mode);
}
void PlatformSupport::closeFile(PlatformFileHandle& handle)
{
- webKitPlatformSupport()->fileUtilities()->closeFile(handle);
+ WebKit::Platform::current()->fileUtilities()->closeFile(handle);
}
long long PlatformSupport::seekFile(PlatformFileHandle handle, long long offset, FileSeekOrigin origin)
{
- return webKitPlatformSupport()->fileUtilities()->seekFile(handle, offset, origin);
+ return WebKit::Platform::current()->fileUtilities()->seekFile(handle, offset, origin);
}
bool PlatformSupport::truncateFile(PlatformFileHandle handle, long long offset)
{
- return webKitPlatformSupport()->fileUtilities()->truncateFile(handle, offset);
+ return WebKit::Platform::current()->fileUtilities()->truncateFile(handle, offset);
}
int PlatformSupport::readFromFile(PlatformFileHandle handle, char* data, int length)
{
- return webKitPlatformSupport()->fileUtilities()->readFromFile(handle, data, length);
+ return WebKit::Platform::current()->fileUtilities()->readFromFile(handle, data, length);
}
int PlatformSupport::writeToFile(PlatformFileHandle handle, const char* data, int length)
{
- return webKitPlatformSupport()->fileUtilities()->writeToFile(handle, data, length);
+ return WebKit::Platform::current()->fileUtilities()->writeToFile(handle, data, length);
}
#if ENABLE(FILE_SYSTEM)