WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Proposed Patch
38228_5 (text/plain), 9.32 KB, created by
Jian Li
on 2010-04-29 13:11:35 PDT
(
hide
)
Description:
Proposed Patch
Filename:
MIME Type:
Creator:
Jian Li
Created:
2010-04-29 13:11:35 PDT
Size:
9.32 KB
patch
obsolete
>diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog >index 13aa069..c20c8ef 100644 >--- a/WebCore/ChangeLog >+++ b/WebCore/ChangeLog >@@ -1,3 +1,19 @@ >+2010-04-28 Jian Li <jianli@chromium.org> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ [chromium] Add WebFileSystem interface and hook up with all FileSystem methods. >+ https://bugs.webkit.org/show_bug.cgi?id=38228 >+ >+ * platform/chromium/ChromiumBridge.h: >+ * platform/chromium/FileSystemChromium.cpp: >+ (WebCore::openFile): >+ (WebCore::closeFile): >+ (WebCore::seekFile): >+ (WebCore::truncateFile): >+ (WebCore::readFromFile): >+ (WebCore::writeToFile): >+ > 2010-04-28 Mike Thole <mthole@apple.com> > > Reviewed by Mark Rowe. >diff --git a/WebCore/platform/chromium/ChromiumBridge.h b/WebCore/platform/chromium/ChromiumBridge.h >index e582241..6eca3eb 100644 >--- a/WebCore/platform/chromium/ChromiumBridge.h >+++ b/WebCore/platform/chromium/ChromiumBridge.h >@@ -109,6 +109,12 @@ namespace WebCore { > static String getAbsolutePath(const String&); > static bool isDirectory(const String&); > static KURL filePathToURL(const String&); >+ static PlatformFileHandle openFile(const String& path, FileOpenMode); >+ static void closeFile(PlatformFileHandle&); >+ static long long seekFile(PlatformFileHandle, long long offset, FileSeekOrigin); >+ static bool truncateFile(PlatformFileHandle, long long offset); >+ static int readFromFile(PlatformFileHandle, char* data, int length); >+ static int writeToFile(PlatformFileHandle, const char* data, int length); > > // Font --------------------------------------------------------------- > #if OS(WINDOWS) >diff --git a/WebCore/platform/chromium/FileSystemChromium.cpp b/WebCore/platform/chromium/FileSystemChromium.cpp >index 30674d9..975caf6 100644 >--- a/WebCore/platform/chromium/FileSystemChromium.cpp >+++ b/WebCore/platform/chromium/FileSystemChromium.cpp >@@ -77,4 +77,34 @@ bool fileExists(const String& path) > return ChromiumBridge::fileExists(path); > } > >+PlatformFileHandle openFile(const String& path, FileOpenMode mode) >+{ >+ return ChromiumBridge::openFile(path, mode); >+} >+ >+void closeFile(PlatformFileHandle& handle) >+{ >+ return ChromiumBridge::closeFile(handle); >+} >+ >+long long seekFile(PlatformFileHandle handle, long long offset, FileSeekOrigin origin) >+{ >+ return ChromiumBridge::seekFile(handle, offset, origin); >+} >+ >+bool truncateFile(PlatformFileHandle handle, long long offset) >+{ >+ return ChromiumBridge::truncateFile(handle, offset); >+} >+ >+int readFromFile(PlatformFileHandle handle, char* data, int length) >+{ >+ return ChromiumBridge::readFromFile(handle, data, length); >+} >+ >+int writeToFile(PlatformFileHandle handle, const char* data, int length) >+{ >+ return ChromiumBridge::writeToFile(handle, data, length); >+} >+ > } // namespace WebCore >diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog >index 1a73eb5..74b098d 100644 >--- a/WebKit/chromium/ChangeLog >+++ b/WebKit/chromium/ChangeLog >@@ -1,3 +1,24 @@ >+2010-04-28 Jian Li <jianli@chromium.org> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ [chromium] Add WebFileSystem interface and hook up with all FileSystem methods. >+ https://bugs.webkit.org/show_bug.cgi?id=38228 >+ >+ For existing file system methods, we still call WebKitClient methods, instead of WebFileSystem methods. >+ We will change the calls once the chromium side change is landed. >+ >+ * public/WebFileSystem.h: Added. >+ * public/WebKitClient.h: >+ (WebKit::WebKitClient::fileSystem): >+ * src/ChromiumBridge.cpp: >+ (WebCore::ChromiumBridge::openFile): >+ (WebCore::ChromiumBridge::closeFile): >+ (WebCore::ChromiumBridge::seekFile): >+ (WebCore::ChromiumBridge::truncateFile): >+ (WebCore::ChromiumBridge::readFromFile): >+ (WebCore::ChromiumBridge::writeToFile): >+ > 2010-04-28 Darin Fisher <darin@chromium.org> > > Reviewed by David Levin. >diff --git a/WebKit/chromium/public/WebFileSystem.h b/WebKit/chromium/public/WebFileSystem.h >new file mode 100755 >index 0000000..af1a7cc >--- /dev/null >+++ b/WebKit/chromium/public/WebFileSystem.h >@@ -0,0 +1,73 @@ >+/* >+ * 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 WebFileSystem_h >+#define WebFileSystem_h >+ >+#include "WebCommon.h" >+ >+namespace WebKit { >+ >+class WebString; >+class WebURL; >+ >+class WebFileSystem { >+public: >+#ifdef WIN32 >+ typedef HANDLE FileHandle; >+#else >+ typedef int FileHandle; >+#endif >+ >+ virtual bool fileExists(const WebString& path) = 0; >+ virtual bool deleteFile(const WebString& path) = 0; >+ virtual bool deleteEmptyDirectory(const WebString& path) = 0; >+ virtual bool getFileSize(const WebString& path, long long& result) = 0; >+ virtual bool getFileModificationTime(const WebString& path, double& result) = 0; >+ virtual WebString directoryName(const WebString& path) = 0; >+ virtual WebString pathByAppendingComponent(const WebString& path, const WebString& component) = 0; >+ virtual bool makeAllDirectories(const WebString& path) = 0; >+ virtual WebString getAbsolutePath(const WebString& path) = 0; >+ virtual bool isDirectory(const WebString& path) = 0; >+ virtual WebURL filePathToURL(const WebString& path) = 0; >+ virtual FileHandle openFile(const WebString& path, int mode) = 0; >+ virtual void closeFile(FileHandle&) = 0; >+ virtual long long seekFile(FileHandle, long long offset, int origin) = 0; >+ virtual bool truncateFile(FileHandle, long long offset) = 0; >+ virtual int readFromFile(FileHandle, char* data, int length) = 0; >+ virtual int writeToFile(FileHandle, const char* data, int length) = 0; >+ >+protected: >+ ~WebFileSystem() {} >+}; >+ >+} // namespace WebKit >+ >+#endif >diff --git a/WebKit/chromium/public/WebKitClient.h b/WebKit/chromium/public/WebKitClient.h >index f199027..ccc7996 100644 >--- a/WebKit/chromium/public/WebKitClient.h >+++ b/WebKit/chromium/public/WebKitClient.h >@@ -49,6 +49,7 @@ class WebApplicationCacheHost; > class WebApplicationCacheHostClient; > class WebClipboard; > class WebCookieJar; >+class WebFileSystem; > class WebGLES2Context; > class WebGraphicsContext3D; > class WebIndexedDatabase; >@@ -70,6 +71,9 @@ public: > // Must return non-null. > virtual WebMimeRegistry* mimeRegistry() { return 0; } > >+ // Must return non-null. >+ virtual WebFileSystem* fileSystem() { return 0; } >+ > // May return null if sandbox support is not necessary > virtual WebSandboxSupport* sandboxSupport() { return 0; } > >diff --git a/WebKit/chromium/src/ChromiumBridge.cpp b/WebKit/chromium/src/ChromiumBridge.cpp >index cffd166..1e882bb 100644 >--- a/WebKit/chromium/src/ChromiumBridge.cpp >+++ b/WebKit/chromium/src/ChromiumBridge.cpp >@@ -40,6 +40,7 @@ > #include "WebCookieJar.h" > #include "WebCursorInfo.h" > #include "WebData.h" >+#include "WebFileSystem.h" > #include "WebFrameClient.h" > #include "WebFrameImpl.h" > #include "WebImage.h" >@@ -327,6 +328,41 @@ KURL ChromiumBridge::filePathToURL(const String& path) > return webKitClient()->filePathToURL(path); > } > >+PlatformFileHandle ChromiumBridge::openFile(const String&, FileOpenMode) >+{ >+ // FIXME: to be implemented. >+ return invalidPlatformFileHandle; >+} >+ >+void ChromiumBridge::closeFile(PlatformFileHandle&) >+{ >+ // FIXME: to be implemented. >+} >+ >+long long ChromiumBridge::seekFile(PlatformFileHandle, long long, FileSeekOrigin) >+{ >+ // FIXME: to be implemented. >+ return 0; >+} >+ >+bool ChromiumBridge::truncateFile(PlatformFileHandle, long long) >+{ >+ // FIXME: to be implemented. >+ return false; >+} >+ >+int ChromiumBridge::readFromFile(PlatformFileHandle, char*, int) >+{ >+ // FIXME: to be implemented. >+ return 0; >+} >+ >+int ChromiumBridge::writeToFile(PlatformFileHandle, const char*, int) >+{ >+ // FIXME: to be implemented. >+ return 0; >+} >+ > // Font ----------------------------------------------------------------------- > > #if OS(WINDOWS)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
fishd
:
review-
jianli
:
commit-queue-
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 38228
:
54474
|
54475
|
54655
|
54720
|
54730
|
54763
|
54764
|
54767
|
54770