summaryrefslogtreecommitdiffstats
path: root/webkit/tools/test_shell
diff options
context:
space:
mode:
authorericu@chromium.org <ericu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-02 01:58:54 +0000
committerericu@chromium.org <ericu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-02 01:58:54 +0000
commit556279d6e1889d3699da241540f13c7140efa9a7 (patch)
tree4394086714a1d37df3ee69c7fe8aaca12955bb95 /webkit/tools/test_shell
parent274775983b7f912c1e8f6dfee140babe906ed5df (diff)
downloadchromium_src-556279d6e1889d3699da241540f13c7140efa9a7.zip
chromium_src-556279d6e1889d3699da241540f13c7140efa9a7.tar.gz
chromium_src-556279d6e1889d3699da241540f13c7140efa9a7.tar.bz2
This goes in first, followed by a webkit change that defines WEBFILESYSTEMCALLBACKS_USE_URL_NOT_STRING, followed by a cleanup in Chromium [deletions only], followed by deleting that definition in webkit.
Here's the first webkit change: https://bugs.webkit.org/show_bug.cgi?id=60218. BUG=NONE TEST=existing tests; no functionality change is intended Review URL: http://codereview.chromium.org/6904063 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87572 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/tools/test_shell')
-rw-r--r--webkit/tools/test_shell/simple_file_system.cc108
-rw-r--r--webkit/tools/test_shell/simple_file_system.h51
2 files changed, 137 insertions, 22 deletions
diff --git a/webkit/tools/test_shell/simple_file_system.cc b/webkit/tools/test_shell/simple_file_system.cc
index 77a7a21..31de57f 100644
--- a/webkit/tools/test_shell/simple_file_system.cc
+++ b/webkit/tools/test_shell/simple_file_system.cc
@@ -16,6 +16,7 @@
#include "third_party/WebKit/Source/WebKit/chromium/public/WebFileSystemEntry.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebURL.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebVector.h"
#include "webkit/fileapi/file_system_callback_dispatcher.h"
#include "webkit/fileapi/file_system_context.h"
@@ -37,6 +38,7 @@ using WebKit::WebFileWriterClient;
using WebKit::WebFrame;
using WebKit::WebSecurityOrigin;
using WebKit::WebString;
+using WebKit::WebURL;
using WebKit::WebVector;
using fileapi::FileSystemCallbackDispatcher;
@@ -100,8 +102,13 @@ class SimpleFileSystemCallbackDispatcher
if (!root.is_valid())
callbacks_->didFail(WebKit::WebFileErrorSecurity);
else
+// Temporary hack to ease a 4-phase Chromium/WebKit commit.
+#ifdef WEBFILESYSTEMCALLBACKS_USE_URL_NOT_STRING
+ callbacks_->didOpenFileSystem(WebString::fromUTF8(name), root);
+#else
callbacks_->didOpenFileSystem(
WebString::fromUTF8(name), WebString::fromUTF8(root.spec()));
+#endif
}
virtual void DidFail(base::PlatformFileError error_code) {
@@ -169,61 +176,120 @@ void SimpleFileSystem::OpenFileSystem(
GetNewOperation(callbacks)->OpenFileSystem(origin_url, type, create);
}
+void SimpleFileSystem::move(const WebString& src_path,
+ const WebString& dest_path,
+ WebFileSystemCallbacks* callbacks) {
+ move(GURL(src_path), GURL(dest_path), callbacks);
+}
+
+void SimpleFileSystem::copy(const WebString& src_path,
+ const WebString& dest_path,
+ WebFileSystemCallbacks* callbacks) {
+ copy(GURL(src_path), GURL(dest_path), callbacks);
+}
+
+void SimpleFileSystem::remove(const WebString& path,
+ WebFileSystemCallbacks* callbacks) {
+ remove(GURL(path), callbacks);
+}
+
+void SimpleFileSystem::removeRecursively(const WebString& path,
+ WebFileSystemCallbacks* callbacks) {
+ removeRecursively(GURL(path), callbacks);
+}
+
+void SimpleFileSystem::readMetadata(const WebString& path,
+ WebFileSystemCallbacks* callbacks) {
+ readMetadata(GURL(path), callbacks);
+}
+
+void SimpleFileSystem::createFile(const WebString& path,
+ bool exclusive,
+ WebFileSystemCallbacks* callbacks) {
+ createFile(GURL(path), exclusive, callbacks);
+}
+
+void SimpleFileSystem::createDirectory(const WebString& path,
+ bool exclusive,
+ WebFileSystemCallbacks* callbacks) {
+ createDirectory(GURL(path), exclusive, callbacks);
+}
+
+void SimpleFileSystem::fileExists(const WebString& path,
+ WebFileSystemCallbacks* callbacks) {
+ fileExists(GURL(path), callbacks);
+}
+
+void SimpleFileSystem::directoryExists(const WebString& path,
+ WebFileSystemCallbacks* callbacks) {
+ directoryExists(GURL(path), callbacks);
+}
+
+void SimpleFileSystem::readDirectory(const WebString& path,
+ WebFileSystemCallbacks* callbacks) {
+ readDirectory(GURL(path), callbacks);
+}
+
+WebKit::WebFileWriter* SimpleFileSystem::createFileWriter(
+ const WebString& path, WebKit::WebFileWriterClient* client) {
+ return createFileWriter(GURL(path), client);
+}
+
void SimpleFileSystem::move(
- const WebString& src_path,
- const WebString& dest_path, WebFileSystemCallbacks* callbacks) {
+ const WebURL& src_path,
+ const WebURL& dest_path, WebFileSystemCallbacks* callbacks) {
GetNewOperation(callbacks)->Move(GURL(src_path), GURL(dest_path));
}
void SimpleFileSystem::copy(
- const WebString& src_path, const WebString& dest_path,
+ const WebURL& src_path, const WebURL& dest_path,
WebFileSystemCallbacks* callbacks) {
GetNewOperation(callbacks)->Copy(GURL(src_path), GURL(dest_path));
}
void SimpleFileSystem::remove(
- const WebString& path, WebFileSystemCallbacks* callbacks) {
- GetNewOperation(callbacks)->Remove(GURL(path), false /* recursive */);
+ const WebURL& path, WebFileSystemCallbacks* callbacks) {
+ GetNewOperation(callbacks)->Remove(path, false /* recursive */);
}
void SimpleFileSystem::removeRecursively(
- const WebString& path, WebFileSystemCallbacks* callbacks) {
- GetNewOperation(callbacks)->Remove(GURL(path), true /* recursive */);
+ const WebURL& path, WebFileSystemCallbacks* callbacks) {
+ GetNewOperation(callbacks)->Remove(path, true /* recursive */);
}
void SimpleFileSystem::readMetadata(
- const WebString& path, WebFileSystemCallbacks* callbacks) {
- GetNewOperation(callbacks)->GetMetadata(GURL(path));
+ const WebURL& path, WebFileSystemCallbacks* callbacks) {
+ GetNewOperation(callbacks)->GetMetadata(path);
}
void SimpleFileSystem::createFile(
- const WebString& path, bool exclusive, WebFileSystemCallbacks* callbacks) {
- GetNewOperation(callbacks)->CreateFile(GURL(path), exclusive);
+ const WebURL& path, bool exclusive, WebFileSystemCallbacks* callbacks) {
+ GetNewOperation(callbacks)->CreateFile(path, exclusive);
}
void SimpleFileSystem::createDirectory(
- const WebString& path, bool exclusive, WebFileSystemCallbacks* callbacks) {
- GetNewOperation(callbacks)->CreateDirectory(GURL(path), exclusive, false);
+ const WebURL& path, bool exclusive, WebFileSystemCallbacks* callbacks) {
+ GetNewOperation(callbacks)->CreateDirectory(path, exclusive, false);
}
void SimpleFileSystem::fileExists(
- const WebString& path, WebFileSystemCallbacks* callbacks) {
- GetNewOperation(callbacks)->FileExists(GURL(path));
+ const WebURL& path, WebFileSystemCallbacks* callbacks) {
+ GetNewOperation(callbacks)->FileExists(path);
}
void SimpleFileSystem::directoryExists(
- const WebString& path, WebFileSystemCallbacks* callbacks) {
- GetNewOperation(callbacks)->DirectoryExists(GURL(path));
+ const WebURL& path, WebFileSystemCallbacks* callbacks) {
+ GetNewOperation(callbacks)->DirectoryExists(path);
}
void SimpleFileSystem::readDirectory(
- const WebString& path, WebFileSystemCallbacks* callbacks) {
- GetNewOperation(callbacks)->ReadDirectory(GURL(path));
+ const WebURL& path, WebFileSystemCallbacks* callbacks) {
+ GetNewOperation(callbacks)->ReadDirectory(path);
}
WebFileWriter* SimpleFileSystem::createFileWriter(
- const WebString& path, WebFileWriterClient* client) {
- return new SimpleFileWriter(GURL(path), client, file_system_context_.get());
+ const WebURL& path, WebFileWriterClient* client) {
+ return new SimpleFileWriter(path, client, file_system_context_.get());
}
FileSystemOperation* SimpleFileSystem::GetNewOperation(
diff --git a/webkit/tools/test_shell/simple_file_system.h b/webkit/tools/test_shell/simple_file_system.h
index ddc4fce..1cd983c 100644
--- a/webkit/tools/test_shell/simple_file_system.h
+++ b/webkit/tools/test_shell/simple_file_system.h
@@ -16,6 +16,7 @@
namespace WebKit {
class WebFileSystemCallbacks;
class WebFrame;
+class WebURL;
}
namespace fileapi {
@@ -40,7 +41,55 @@ class SimpleFileSystem
return file_system_context_.get();
}
- // WebKit::WebFileSystem methods.
+ // New WebKit::WebFileSystem overrides.
+ virtual void move(
+ const WebKit::WebURL& src_path,
+ const WebKit::WebURL& dest_path,
+ WebKit::WebFileSystemCallbacks*);
+
+ virtual void copy(
+ const WebKit::WebURL& src_path,
+ const WebKit::WebURL& dest_path,
+ WebKit::WebFileSystemCallbacks*);
+
+ virtual void remove(
+ const WebKit::WebURL& path,
+ WebKit::WebFileSystemCallbacks*);
+
+ virtual void removeRecursively(
+ const WebKit::WebURL& path,
+ WebKit::WebFileSystemCallbacks*);
+
+ virtual void readMetadata(
+ const WebKit::WebURL& path,
+ WebKit::WebFileSystemCallbacks*);
+
+ virtual void createFile(
+ const WebKit::WebURL& path,
+ bool exclusive,
+ WebKit::WebFileSystemCallbacks*);
+
+ virtual void createDirectory(
+ const WebKit::WebURL& path,
+ bool exclusive,
+ WebKit::WebFileSystemCallbacks*);
+
+ virtual void fileExists(
+ const WebKit::WebURL& path,
+ WebKit::WebFileSystemCallbacks*);
+
+ virtual void directoryExists(
+ const WebKit::WebURL& path,
+ WebKit::WebFileSystemCallbacks*);
+
+ virtual void readDirectory(
+ const WebKit::WebURL& path,
+ WebKit::WebFileSystemCallbacks*);
+
+ virtual WebKit::WebFileWriter* createFileWriter(
+ const WebKit::WebURL& path, WebKit::WebFileWriterClient*);
+
+ // Old WebKit::WebFileSystem overrides, soon to go away.
virtual void move(const WebKit::WebString& src_path,
const WebKit::WebString& dest_path,
WebKit::WebFileSystemCallbacks* callbacks);