Changeset 88844 in webkit


Ignore:
Timestamp:
Jun 14, 2011 1:01:19 PM (13 years ago)
Author:
ericu@chromium.org
Message:

2011-06-14 Eric Uhrhane <ericu@chromium.org>

Reviewed by Darin Fisher.

Clean up filesystem base path code.
https://bugs.webkit.org/show_bug.cgi?id=60218

Change a bunch of url-held-in-a-string parameters into real KURLS and
WebURLs.

No new tests--no change in functionality.

  • fileapi/DOMFileSystem.cpp: (WebCore::DOMFileSystem::createWriter): (WebCore::DOMFileSystem::createFile):
  • fileapi/DOMFileSystemBase.cpp: (WebCore::DOMFileSystemBase::getMetadata): (WebCore::DOMFileSystemBase::move): (WebCore::DOMFileSystemBase::copy): (WebCore::DOMFileSystemBase::remove): (WebCore::DOMFileSystemBase::removeRecursively): (WebCore::DOMFileSystemBase::getParent): (WebCore::DOMFileSystemBase::getFile): (WebCore::DOMFileSystemBase::getDirectory): (WebCore::DOMFileSystemBase::readDirectory):
  • fileapi/DOMFileSystemSync.cpp: (WebCore::DOMFileSystemSync::createFile): (WebCore::DOMFileSystemSync::createWriter):
  • platform/AsyncFileSystem.cpp: (WebCore::AsyncFileSystem::openFileSystem):
  • platform/AsyncFileSystem.h: (WebCore::AsyncFileSystem::AsyncFileSystem):

2011-06-14 Eric Uhrhane <ericu@chromium.org>

Reviewed by Darin Fisher.

Clean up filesystem base path code.
https://bugs.webkit.org/show_bug.cgi?id=60218

Change a bunch of url-held-in-a-string parameters into real KURLS and
WebURLs. Also add a #define to make it easier to stage this change, as
it involves both Chromium and WebKit changes that would ideally be
simultaneous.

No new tests--no change in functionality.

  • public/WebFileSystem.h:
  • public/WebFileSystemCallbacks.h:
  • public/WebFrame.h:
  • src/AsyncFileSystemChromium.cpp:
  • src/AsyncFileSystemChromium.h:
  • src/WebFileSystemCallbacksImpl.cpp:
  • src/WebFileSystemCallbacksImpl.h:
  • src/WebFrameImpl.cpp:
  • src/WorkerAsyncFileSystemChromium.cpp:
  • src/WorkerAsyncFileSystemChromium.h:
  • src/WorkerAsyncFileWriterChromium.cpp:
  • src/WorkerAsyncFileWriterChromium.h:
  • src/WorkerFileSystemCallbacksBridge.cpp:
  • src/WorkerFileSystemCallbacksBridge.h:
  • src/WorkerFileWriterCallbacksBridge.cpp:
  • src/WorkerFileWriterCallbacksBridge.h:
Location:
trunk/Source
Files:
23 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r88835 r88844  
     12011-06-14  Eric Uhrhane  <ericu@chromium.org>
     2
     3        Reviewed by Darin Fisher.
     4
     5        Clean up filesystem base path code.
     6        https://bugs.webkit.org/show_bug.cgi?id=60218
     7
     8        Change a bunch of url-held-in-a-string parameters into real KURLS and
     9        WebURLs.
     10
     11        No new tests--no change in functionality.
     12
     13        * fileapi/DOMFileSystem.cpp:
     14        (WebCore::DOMFileSystem::createWriter):
     15        (WebCore::DOMFileSystem::createFile):
     16        * fileapi/DOMFileSystemBase.cpp:
     17        (WebCore::DOMFileSystemBase::getMetadata):
     18        (WebCore::DOMFileSystemBase::move):
     19        (WebCore::DOMFileSystemBase::copy):
     20        (WebCore::DOMFileSystemBase::remove):
     21        (WebCore::DOMFileSystemBase::removeRecursively):
     22        (WebCore::DOMFileSystemBase::getParent):
     23        (WebCore::DOMFileSystemBase::getFile):
     24        (WebCore::DOMFileSystemBase::getDirectory):
     25        (WebCore::DOMFileSystemBase::readDirectory):
     26        * fileapi/DOMFileSystemSync.cpp:
     27        (WebCore::DOMFileSystemSync::createFile):
     28        (WebCore::DOMFileSystemSync::createWriter):
     29        * platform/AsyncFileSystem.cpp:
     30        (WebCore::AsyncFileSystem::openFileSystem):
     31        * platform/AsyncFileSystem.h:
     32        (WebCore::AsyncFileSystem::AsyncFileSystem):
     33
    1342011-06-14  James Robinson  <jamesr@chromium.org>
    235
  • trunk/Source/WebCore/fileapi/DOMFileSystem.cpp

    r87095 r88844  
    106106    ASSERT(fileEntry);
    107107
    108     String platformPath = m_asyncFileSystem->virtualToPlatformPath(fileEntry->fullPath());
    109 
    110108    RefPtr<FileWriter> fileWriter = FileWriter::create(scriptExecutionContext());
    111109    RefPtr<FileWriterBaseCallback> conversionCallback = ConvertToFileWriterCallback::create(successCallback);
    112110    OwnPtr<FileWriterBaseCallbacks> callbacks = FileWriterBaseCallbacks::create(fileWriter, conversionCallback, errorCallback);
    113     m_asyncFileSystem->createWriter(fileWriter.get(), platformPath, callbacks.release());
     111    m_asyncFileSystem->createWriter(fileWriter.get(), fileEntry->fullPath(), callbacks.release());
    114112}
    115113
     
    118116class GetPathCallback : public FileSystemCallbacksBase {
    119117public:
    120     static PassOwnPtr<GetPathCallback> create(PassRefPtr<DOMFileSystem> filesystem, const String& path, const String& name, PassRefPtr<FileCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)
     118    static PassOwnPtr<GetPathCallback> create(PassRefPtr<DOMFileSystem> filesystem, const String& name, PassRefPtr<FileCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)
    121119    {
    122         return adoptPtr(new GetPathCallback(filesystem, path, name, successCallback, errorCallback));
     120        return adoptPtr(new GetPathCallback(filesystem, name, successCallback, errorCallback));
    123121    }
    124122
    125123    virtual void didReadMetadata(const FileMetadata& metadata)
    126124    {
    127         if (!metadata.platformPath.isEmpty())
    128             m_path = metadata.platformPath;
    129 
    130         m_filesystem->scheduleCallback(m_successCallback.release(), File::createWithName(m_path, m_name));
     125        ASSERT(!metadata.platformPath.isEmpty());
     126        m_filesystem->scheduleCallback(m_successCallback.release(), File::createWithName(metadata.platformPath, m_name));
    131127    }
    132128
    133129private:
    134     GetPathCallback(PassRefPtr<DOMFileSystem> filesystem, const String& path, const String& name, PassRefPtr<FileCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)
     130    GetPathCallback(PassRefPtr<DOMFileSystem> filesystem, const String& name, PassRefPtr<FileCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)
    135131        : FileSystemCallbacksBase(errorCallback)
    136132        , m_filesystem(filesystem)
    137         , m_path(path)
    138133        , m_name(name)
    139134        , m_successCallback(successCallback)
     
    142137
    143138    RefPtr<DOMFileSystem> m_filesystem;
    144     String m_path;
    145139    String m_name;
    146140    RefPtr<FileCallback> m_successCallback;
     
    151145void DOMFileSystem::createFile(const FileEntry* fileEntry, PassRefPtr<FileCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)
    152146{
    153     String platformPath = m_asyncFileSystem->virtualToPlatformPath(fileEntry->fullPath());
    154 
    155     m_asyncFileSystem->readMetadata(platformPath, GetPathCallback::create(this, platformPath, fileEntry->name(), successCallback, errorCallback));
     147    m_asyncFileSystem->readMetadata(fileEntry->fullPath(), GetPathCallback::create(this, fileEntry->name(), successCallback, errorCallback));
    156148}
    157149
  • trunk/Source/WebCore/fileapi/DOMFileSystemBase.cpp

    r86291 r88844  
    106106bool DOMFileSystemBase::getMetadata(const EntryBase* entry, PassRefPtr<MetadataCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)
    107107{
    108     String platformPath = m_asyncFileSystem->virtualToPlatformPath(entry->fullPath());
    109     m_asyncFileSystem->readMetadata(platformPath, MetadataCallbacks::create(successCallback, errorCallback));
     108    m_asyncFileSystem->readMetadata(entry->fullPath(), MetadataCallbacks::create(successCallback, errorCallback));
    110109    return true;
    111110}
     
    157156        return false;
    158157
    159     String sourcePlatformPath = m_asyncFileSystem->virtualToPlatformPath(source->fullPath());
    160     String destinationPlatformPath = parent->filesystem()->asyncFileSystem()->virtualToPlatformPath(destinationPath);
    161     m_asyncFileSystem->move(sourcePlatformPath, destinationPlatformPath, EntryCallbacks::create(successCallback, errorCallback, this, destinationPath, source->isDirectory()));
     158    m_asyncFileSystem->move(source->fullPath(), destinationPath, EntryCallbacks::create(successCallback, errorCallback, this, destinationPath, source->isDirectory()));
    162159    return true;
    163160}
     
    169166        return false;
    170167
    171     String sourcePlatformPath = m_asyncFileSystem->virtualToPlatformPath(source->fullPath());
    172     String destinationPlatformPath = parent->filesystem()->asyncFileSystem()->virtualToPlatformPath(destinationPath);
    173     m_asyncFileSystem->copy(sourcePlatformPath, destinationPlatformPath, EntryCallbacks::create(successCallback, errorCallback, this, destinationPath, source->isDirectory()));
     168    m_asyncFileSystem->copy(source->fullPath(), destinationPath, EntryCallbacks::create(successCallback, errorCallback, this, destinationPath, source->isDirectory()));
    174169    return true;
    175170}
     
    181176    if (entry->fullPath() == String(DOMFilePath::root))
    182177        return false;
    183     String platformPath = m_asyncFileSystem->virtualToPlatformPath(entry->fullPath());
    184     m_asyncFileSystem->remove(platformPath, VoidCallbacks::create(successCallback, errorCallback));
     178    m_asyncFileSystem->remove(entry->fullPath(), VoidCallbacks::create(successCallback, errorCallback));
    185179    return true;
    186180}
     
    192186    if (entry->fullPath() == String(DOMFilePath::root))
    193187        return false;
    194     String platformPath = m_asyncFileSystem->virtualToPlatformPath(entry->fullPath());
    195     m_asyncFileSystem->removeRecursively(platformPath, VoidCallbacks::create(successCallback, errorCallback));
     188    m_asyncFileSystem->removeRecursively(entry->fullPath(), VoidCallbacks::create(successCallback, errorCallback));
    196189    return true;
    197190}
     
    201194    ASSERT(entry);
    202195    String path = DOMFilePath::getDirectory(entry->fullPath());
    203     String platformPath = m_asyncFileSystem->virtualToPlatformPath(path);
    204     m_asyncFileSystem->directoryExists(platformPath, EntryCallbacks::create(successCallback, errorCallback, this, path, true));
    205     return true;
    206 }
    207 
    208 bool DOMFileSystemBase::getFile(const EntryBase* base, const String& path, PassRefPtr<WebKitFlags> flags, PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)
     196
     197    m_asyncFileSystem->directoryExists(path, EntryCallbacks::create(successCallback, errorCallback, this, path, true));
     198    return true;
     199}
     200
     201bool DOMFileSystemBase::getFile(const EntryBase* entry, const String& path, PassRefPtr<WebKitFlags> flags, PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)
    209202{
    210203    String absolutePath;
    211     if (!pathToAbsolutePath(m_asyncFileSystem->type(), base, path, absolutePath))
    212         return false;
    213 
    214     String platformPath = m_asyncFileSystem->virtualToPlatformPath(absolutePath);
     204    if (!pathToAbsolutePath(m_asyncFileSystem->type(), entry, path, absolutePath))
     205        return false;
     206
    215207    OwnPtr<EntryCallbacks> callbacks = EntryCallbacks::create(successCallback, errorCallback, this, absolutePath, false);
    216208    if (flags && flags->isCreate())
    217         m_asyncFileSystem->createFile(platformPath, flags->isExclusive(), callbacks.release());
     209        m_asyncFileSystem->createFile(absolutePath, flags->isExclusive(), callbacks.release());
    218210    else
    219         m_asyncFileSystem->fileExists(platformPath, callbacks.release());
    220     return true;
    221 }
    222 
    223 bool DOMFileSystemBase::getDirectory(const EntryBase* base, const String& path, PassRefPtr<WebKitFlags> flags, PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)
     211        m_asyncFileSystem->fileExists(absolutePath, callbacks.release());
     212    return true;
     213}
     214
     215bool DOMFileSystemBase::getDirectory(const EntryBase* entry, const String& path, PassRefPtr<WebKitFlags> flags, PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)
    224216{
    225217    String absolutePath;
    226     if (!pathToAbsolutePath(m_asyncFileSystem->type(), base, path, absolutePath))
    227         return false;
    228 
    229     String platformPath = m_asyncFileSystem->virtualToPlatformPath(absolutePath);
     218    if (!pathToAbsolutePath(m_asyncFileSystem->type(), entry, path, absolutePath))
     219        return false;
     220
    230221    OwnPtr<EntryCallbacks> callbacks = EntryCallbacks::create(successCallback, errorCallback, this, absolutePath, true);
    231222    if (flags && flags->isCreate())
    232         m_asyncFileSystem->createDirectory(platformPath, flags->isExclusive(), callbacks.release());
     223        m_asyncFileSystem->createDirectory(absolutePath, flags->isExclusive(), callbacks.release());
    233224    else
    234         m_asyncFileSystem->directoryExists(platformPath, callbacks.release());
     225        m_asyncFileSystem->directoryExists(absolutePath, callbacks.release());
    235226    return true;
    236227}
     
    239230{
    240231    ASSERT(DOMFilePath::isAbsolute(path));
    241     String platformPath = m_asyncFileSystem->virtualToPlatformPath(path);
    242     m_asyncFileSystem->readDirectory(platformPath, EntriesCallbacks::create(successCallback, errorCallback, reader, path));
     232    m_asyncFileSystem->readDirectory(path, EntriesCallbacks::create(successCallback, errorCallback, reader, path));
    243233    return true;
    244234}
  • trunk/Source/WebCore/fileapi/DOMFileSystemSync.cpp

    r87095 r88844  
    157157{
    158158    ec = 0;
    159     String platformPath = m_asyncFileSystem->virtualToPlatformPath(fileEntry->fullPath());
    160159    RefPtr<GetPathHelper::GetPathResult> result(GetPathHelper::GetPathResult::create());
    161     m_asyncFileSystem->readMetadata(platformPath, GetPathHelper::create(result));
     160    m_asyncFileSystem->readMetadata(fileEntry->fullPath(), GetPathHelper::create(result));
    162161    if (!m_asyncFileSystem->waitForOperationToComplete()) {
    163162        ec = FileException::ABORT_ERR;
     
    168167        return 0;
    169168    }
    170     if (!result->m_path.isEmpty())
    171         platformPath = result->m_path;
    172     return File::createWithName(platformPath, fileEntry->name());
     169    ASSERT(!result->m_path.isEmpty());
     170    return File::createWithName(result->m_path, fileEntry->name());
    173171}
    174172
     
    244242    ec = 0;
    245243
    246     String platformPath = m_asyncFileSystem->virtualToPlatformPath(fileEntry->fullPath());
    247244
    248245    RefPtr<FileWriterSync> fileWriter = FileWriterSync::create();
     
    251248
    252249    OwnPtr<FileWriterBaseCallbacks> callbacks = FileWriterBaseCallbacks::create(fileWriter, successCallback, errorCallback);
    253     m_asyncFileSystem->createWriter(fileWriter.get(), platformPath, callbacks.release());
     250    m_asyncFileSystem->createWriter(fileWriter.get(), fileEntry->fullPath(), callbacks.release());
    254251    if (!m_asyncFileSystem->waitForOperationToComplete()) {
    255252        ec = FileException::ABORT_ERR;
  • trunk/Source/WebCore/platform/AsyncFileSystem.cpp

    r78362 r88844  
    5353}
    5454
    55 // Default implementation.
    5655void AsyncFileSystem::openFileSystem(const String& basePath, const String& storageIdentifier, Type type, bool, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
    5756{
    58     String typeString = (type == Persistent) ? "Persistent" : "Temporary";
    59 
    60     String name = storageIdentifier;
    61     name += ":";
    62     name += typeString;
    63 
    64     String rootPath = basePath;
    65     rootPath.append(PlatformFilePathSeparator);
    66     rootPath += storageIdentifier;
    67     rootPath.append(PlatformFilePathSeparator);
    68     rootPath += typeString;
    69     rootPath.append(PlatformFilePathSeparator);
    70 
    71     callbacks->didOpenFileSystem(name, AsyncFileSystem::create(type, rootPath));
     57    notImplemented();
     58    callbacks->didFail(NOT_SUPPORTED_ERR);
    7259}
    7360#endif
    74 
    75 // Default implementation.
    76 String AsyncFileSystem::virtualToPlatformPath(const String& path) const
    77 {
    78     ASSERT(!m_platformRootPath.isEmpty());
    79     String virtualPath = path;
    80     return m_platformRootPath + virtualPath.replace('/', PlatformFilePathSeparator);
    81 }
    8261
    8362} // namespace
  • trunk/Source/WebCore/platform/AsyncFileSystem.h

    r83972 r88844  
    3434#if ENABLE(FILE_SYSTEM)
    3535
     36#include "KURL.h"
    3637#include "PlatformString.h"
    3738#include "Timer.h"
     
    6768
    6869    // Creates and returns a new platform-specific AsyncFileSystem instance if the platform has its own implementation.
    69     static PassOwnPtr<AsyncFileSystem> create(Type, const String& rootPath);
     70    static PassOwnPtr<AsyncFileSystem> create(Type);
    7071
    7172    // Opens a new file system. The create parameter specifies whether or not to create the path if it does not already exists.
     
    128129    virtual void createWriter(AsyncFileWriterClient* client, const String& path, PassOwnPtr<AsyncFileSystemCallbacks>) = 0;
    129130
    130     // Converts a given absolute virtual path to a platform path that starts with the platform root path of this file system.
    131     virtual String virtualToPlatformPath(const String& path) const;
    132 
    133     // Getter for this file system's root path.
    134     String root() const { return m_platformRootPath; }
    135 
    136131    Type type() const { return m_type; }
    137132
    138133protected:
    139     AsyncFileSystem(Type type, const String& platformRootPath)
     134    AsyncFileSystem(Type type)
    140135        : m_type(type)
    141         , m_platformRootPath(platformRootPath)
    142136    {
    143137    }
    144138
    145139    Type m_type;
    146     String m_platformRootPath;
    147140};
    148141
  • trunk/Source/WebKit/chromium/ChangeLog

    r88835 r88844  
     12011-06-14  Eric Uhrhane  <ericu@chromium.org>
     2
     3        Reviewed by Darin Fisher.
     4
     5        Clean up filesystem base path code.
     6        https://bugs.webkit.org/show_bug.cgi?id=60218
     7
     8        Change a bunch of url-held-in-a-string parameters into real KURLS and
     9        WebURLs.  Also add a #define to make it easier to stage this change, as
     10        it involves both Chromium and WebKit changes that would ideally be
     11        simultaneous.
     12
     13        No new tests--no change in functionality.
     14
     15        * public/WebFileSystem.h:
     16        * public/WebFileSystemCallbacks.h:
     17        * public/WebFrame.h:
     18        * src/AsyncFileSystemChromium.cpp:
     19        * src/AsyncFileSystemChromium.h:
     20        * src/WebFileSystemCallbacksImpl.cpp:
     21        * src/WebFileSystemCallbacksImpl.h:
     22        * src/WebFrameImpl.cpp:
     23        * src/WorkerAsyncFileSystemChromium.cpp:
     24        * src/WorkerAsyncFileSystemChromium.h:
     25        * src/WorkerAsyncFileWriterChromium.cpp:
     26        * src/WorkerAsyncFileWriterChromium.h:
     27        * src/WorkerFileSystemCallbacksBridge.cpp:
     28        * src/WorkerFileSystemCallbacksBridge.h:
     29        * src/WorkerFileWriterCallbacksBridge.cpp:
     30        * src/WorkerFileWriterCallbacksBridge.h:
     31
    1322011-06-14  James Robinson  <jamesr@chromium.org>
    233
  • trunk/Source/WebKit/chromium/public/WebFileSystem.h

    r83972 r88844  
    3333
    3434#include "WebCommon.h"
    35 #include "WebString.h"
     35#include "WebURL.h"
    3636
    3737namespace WebKit {
     
    5555    // WebFileSystemCallbacks::didSucceed() must be called when the operation is completed successfully.
    5656    // WebFileSystemCallbacks::didFail() must be called otherwise.
    57     virtual void move(const WebString& srcPath, const WebString& destPath, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
     57    virtual void move(const WebURL& srcPath, const WebURL& destPath, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
    5858
    5959    // Copies a file or directory at |srcPath| to |destPath|.
    6060    // WebFileSystemCallbacks::didSucceed() must be called when the operation is completed successfully.
    6161    // WebFileSystemCallbacks::didFail() must be called otherwise.
    62     virtual void copy(const WebString& srcPath, const WebString& destPath, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
     62    virtual void copy(const WebURL& srcPath, const WebURL& destPath, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
    6363
    6464    // Deletes a file or directory at a given |path|.
     
    6666    // WebFileSystemCallbacks::didSucceed() must be called when the operation is completed successfully.
    6767    // WebFileSystemCallbacks::didFail() must be called otherwise.
    68     virtual void remove(const WebString& path, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
     68    virtual void remove(const WebURL& path, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
    6969
    7070    // Deletes a file or directory recursively at a given |path|.
    7171    // WebFileSystemCallbacks::didSucceed() must be called when the operation is completed successfully.
    7272    // WebFileSystemCallbacks::didFail() must be called otherwise.
    73     virtual void removeRecursively(const WebString& path, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
     73    virtual void removeRecursively(const WebURL& path, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
    7474
    7575    // Retrieves the metadata information of the file or directory at the given |path|.
    7676    // WebFileSystemCallbacks::didReadMetadata() must be called with a valid metadata when the retrieval is completed successfully.
    7777    // WebFileSystemCallbacks::didFail() must be called otherwise.
    78     virtual void readMetadata(const WebString& path, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
     78    virtual void readMetadata(const WebURL& path, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
    7979
    8080    // Creates a file at given |path|.
     
    8686    // WebFileSystemCallbacks::didSucceed() must be called when the operation is completed successfully.
    8787    // WebFileSystemCallbacks::didFail() must be called otherwise.
    88     virtual void createFile(const WebString& path, bool exclusive, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
     88    virtual void createFile(const WebURL& path, bool exclusive, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
    8989
    9090    // Creates a directory at a given |path|.
     
    9696    // the operation is completed successfully.
    9797    // WebFileSystemCallbacks::didFail() must be called otherwise.
    98     virtual void createDirectory(const WebString& path, bool exclusive, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
     98    virtual void createDirectory(const WebURL& path, bool exclusive, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
    9999
    100100    // Checks if a file exists at a given |path|.
    101101    // WebFileSystemCallbacks::didSucceed() must be called when the operation is completed successfully.
    102102    // WebFileSystemCallbacks::didFail() must be called otherwise.
    103     virtual void fileExists(const WebString& path, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
     103    virtual void fileExists(const WebURL& path, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
    104104
    105105    // Checks if a directory exists at a given |path|.
    106106    // WebFileSystemCallbacks::didSucceed() must be called when the operation is completed successfully.
    107107    // WebFileSystemCallbacks::didFail() must be called otherwise.
    108     virtual void directoryExists(const WebString& path, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
     108    virtual void directoryExists(const WebURL& path, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
    109109
    110110    // Reads directory entries of a given directory at |path|.
    111111    // WebFileSystemCallbacks::didReadDirectory() must be called when the operation is completed successfully.
    112112    // WebFileSystemCallbacks::didFail() must be called otherwise.
    113     virtual void readDirectory(const WebString& path, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
     113    virtual void readDirectory(const WebURL& path, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
    114114
    115115    // Creates a WebFileWriter that can be used to write to the given file.
    116116    // This is a fast, synchronous call, and should not stat the filesystem.
    117     virtual WebFileWriter* createFileWriter(const WebString& path, WebFileWriterClient*) { WEBKIT_ASSERT_NOT_REACHED(); return 0; }
     117    virtual WebFileWriter* createFileWriter(const WebURL& path, WebFileWriterClient*) { WEBKIT_ASSERT_NOT_REACHED(); return 0; }
    118118
    119119protected:
  • trunk/Source/WebKit/chromium/public/WebFileSystemCallbacks.h

    r65718 r88844  
    3939
    4040class WebString;
     41class WebURL;
    4142struct WebFileInfo;
     43
     44// Temporary hack to ease a 4-phase Chromium/WebKit commit.
     45#define WEBFILESYSTEMCALLBACKS_USE_URL_NOT_STRING 1
    4246
    4347class WebFileSystemCallbacks {
     
    5862
    5963    // Callback for WebFrameClient::openFileSystem. Called with a name and
    60     // root path for the FileSystem when the request is accepted.
    61     virtual void didOpenFileSystem(const WebString& name, const WebString& rootPath) = 0;
     64    // root URL for the FileSystem when the request is accepted.
     65    virtual void didOpenFileSystem(const WebString& name, const WebURL& rootURL) = 0;
    6266
    6367    // Called with an error code when a requested operation hasn't been
  • trunk/Source/WebKit/chromium/public/WebFrame.h

    r88812 r88844  
    278278    virtual v8::Handle<v8::Value> createFileSystem(WebFileSystem::Type,
    279279                                                   const WebString& name,
    280                                                    const WebString& path) = 0;
     280                                                   const WebString& rootURL) = 0;
    281281    // Creates an instance of file or directory entry object.
    282282    virtual v8::Handle<v8::Value> createFileEntry(WebFileSystem::Type,
    283283                                                  const WebString& fileSystemName,
    284                                                   const WebString& fileSystemPath,
     284                                                  const WebString& fileSystemRootURL,
    285285                                                  const WebString& filePath,
    286286                                                  bool isDirectory) = 0;
  • trunk/Source/WebKit/chromium/src/AsyncFileSystemChromium.cpp

    r78362 r88844  
    5151}
    5252
    53 AsyncFileSystemChromium::AsyncFileSystemChromium(AsyncFileSystem::Type type, const String& rootPath)
    54     : AsyncFileSystem(type, rootPath)
     53AsyncFileSystemChromium::AsyncFileSystemChromium(AsyncFileSystem::Type type, const KURL& rootURL)
     54    : AsyncFileSystem(type)
    5555    , m_webFileSystem(WebKit::webKitClient()->fileSystem())
     56    , m_filesystemRootURL(rootURL)
    5657{
    5758    ASSERT(m_webFileSystem);
     
    6465void AsyncFileSystemChromium::move(const String& sourcePath, const String& destinationPath, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
    6566{
    66     m_webFileSystem->move(sourcePath, destinationPath, new WebKit::WebFileSystemCallbacksImpl(callbacks));
     67    m_webFileSystem->move(virtualPathToFileSystemURL(sourcePath), virtualPathToFileSystemURL(destinationPath), new WebKit::WebFileSystemCallbacksImpl(callbacks));
    6768}
    6869
    6970void AsyncFileSystemChromium::copy(const String& sourcePath, const String& destinationPath, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
    7071{
    71     m_webFileSystem->copy(sourcePath, destinationPath, new WebKit::WebFileSystemCallbacksImpl(callbacks));
     72    m_webFileSystem->copy(virtualPathToFileSystemURL(sourcePath), virtualPathToFileSystemURL(destinationPath), new WebKit::WebFileSystemCallbacksImpl(callbacks));
    7273}
    7374
    7475void AsyncFileSystemChromium::remove(const String& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
    7576{
    76     m_webFileSystem->remove(path, new WebKit::WebFileSystemCallbacksImpl(callbacks));
     77    m_webFileSystem->remove(virtualPathToFileSystemURL(path), new WebKit::WebFileSystemCallbacksImpl(callbacks));
    7778}
    7879
    7980void AsyncFileSystemChromium::removeRecursively(const String& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
    8081{
    81     m_webFileSystem->removeRecursively(path, new WebKit::WebFileSystemCallbacksImpl(callbacks));
     82    m_webFileSystem->removeRecursively(virtualPathToFileSystemURL(path), new WebKit::WebFileSystemCallbacksImpl(callbacks));
    8283}
    8384
    8485void AsyncFileSystemChromium::readMetadata(const String& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
    8586{
    86     m_webFileSystem->readMetadata(path, new WebKit::WebFileSystemCallbacksImpl(callbacks));
     87    m_webFileSystem->readMetadata(virtualPathToFileSystemURL(path), new WebKit::WebFileSystemCallbacksImpl(callbacks));
    8788}
    8889
    8990void AsyncFileSystemChromium::createFile(const String& path, bool exclusive, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
    9091{
    91     m_webFileSystem->createFile(path, exclusive, new WebKit::WebFileSystemCallbacksImpl(callbacks));
     92    m_webFileSystem->createFile(virtualPathToFileSystemURL(path), exclusive, new WebKit::WebFileSystemCallbacksImpl(callbacks));
    9293}
    9394
    9495void AsyncFileSystemChromium::createDirectory(const String& path, bool exclusive, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
    9596{
    96     m_webFileSystem->createDirectory(path, exclusive, new WebKit::WebFileSystemCallbacksImpl(callbacks));
     97    m_webFileSystem->createDirectory(virtualPathToFileSystemURL(path), exclusive, new WebKit::WebFileSystemCallbacksImpl(callbacks));
    9798}
    9899
    99100void AsyncFileSystemChromium::fileExists(const String& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
    100101{
    101     m_webFileSystem->fileExists(path, new WebKit::WebFileSystemCallbacksImpl(callbacks));
     102    m_webFileSystem->fileExists(virtualPathToFileSystemURL(path), new WebKit::WebFileSystemCallbacksImpl(callbacks));
    102103}
    103104
    104105void AsyncFileSystemChromium::directoryExists(const String& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
    105106{
    106     m_webFileSystem->directoryExists(path, new WebKit::WebFileSystemCallbacksImpl(callbacks));
     107    m_webFileSystem->directoryExists(virtualPathToFileSystemURL(path), new WebKit::WebFileSystemCallbacksImpl(callbacks));
    107108}
    108109
    109110void AsyncFileSystemChromium::readDirectory(const String& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
    110111{
    111     m_webFileSystem->readDirectory(path, new WebKit::WebFileSystemCallbacksImpl(callbacks));
     112    m_webFileSystem->readDirectory(virtualPathToFileSystemURL(path), new WebKit::WebFileSystemCallbacksImpl(callbacks));
    112113}
    113114
    114115class FileWriterHelperCallbacks : public WebKit::WebFileSystemCallbacks {
    115116public:
    116     FileWriterHelperCallbacks(AsyncFileWriterClient* client, const String& path, WebKit::WebFileSystem* webFileSystem, PassOwnPtr<WebCore::AsyncFileSystemCallbacks> callbacks)
     117    FileWriterHelperCallbacks(AsyncFileWriterClient* client, const KURL& path, WebKit::WebFileSystem* webFileSystem, PassOwnPtr<WebCore::AsyncFileSystemCallbacks> callbacks)
    117118        : m_client(client)
    118119        , m_path(path)
     
    146147        delete this;
    147148    }
    148     virtual void didOpenFileSystem(const WebKit::WebString& name, const WebKit::WebString& rootPath)
     149    virtual void didOpenFileSystem(const WebKit::WebString& name, const WebKit::WebURL& rootURL)
    149150    {
    150151        ASSERT_NOT_REACHED();
     
    161162private:
    162163    AsyncFileWriterClient* m_client;
    163     String m_path;
     164    KURL m_path;
    164165    WebKit::WebFileSystem* m_webFileSystem;
    165166    OwnPtr<WebCore::AsyncFileSystemCallbacks> m_callbacks;
     
    168169void AsyncFileSystemChromium::createWriter(AsyncFileWriterClient* client, const String& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
    169170{
    170     m_webFileSystem->readMetadata(path, new FileWriterHelperCallbacks(client, path, m_webFileSystem, callbacks));
     171    KURL pathAsURL = virtualPathToFileSystemURL(path);
     172    m_webFileSystem->readMetadata(pathAsURL, new FileWriterHelperCallbacks(client, pathAsURL, m_webFileSystem, callbacks));
     173}
     174
     175KURL AsyncFileSystemChromium::virtualPathToFileSystemURL(const String& virtualPath) const
     176{
     177    ASSERT(!m_filesystemRootURL.isEmpty());
     178    KURL url = m_filesystemRootURL;
     179    // Remove the extra leading slash.
     180    url.setPath(url.path() + virtualPath.substring(1));
     181    return url;
    171182}
    172183
  • trunk/Source/WebKit/chromium/src/AsyncFileSystemChromium.h

    r78362 r88844  
    4444
    4545class AsyncFileSystemCallbacks;
     46class KURL;
    4647
    4748class AsyncFileSystemChromium : public AsyncFileSystem {
    4849public:
    49     static PassOwnPtr<AsyncFileSystem> create(AsyncFileSystem::Type type, const String& rootPath)
     50    static PassOwnPtr<AsyncFileSystem> create(AsyncFileSystem::Type type, const KURL& rootURL)
    5051    {
    51         return adoptPtr(new AsyncFileSystemChromium(type, rootPath));
     52        return adoptPtr(new AsyncFileSystemChromium(type, rootURL));
    5253    }
    5354
     
    6768
    6869private:
    69     AsyncFileSystemChromium(AsyncFileSystem::Type, const String& rootPath);
     70    AsyncFileSystemChromium(AsyncFileSystem::Type, const KURL& rootURL);
    7071    WebKit::WebFileSystem* m_webFileSystem;
     72
     73    // Converts a given absolute virtual path to a full origin-qualified FileSystem URL.
     74    KURL virtualPathToFileSystemURL(const String& virtualPath) const;
     75
     76    KURL m_filesystemRootURL;
    7177};
    7278
  • trunk/Source/WebKit/chromium/src/WebFileSystemCallbacksImpl.cpp

    r87463 r88844  
    8686}
    8787
    88 void WebFileSystemCallbacksImpl::didOpenFileSystem(const WebString& name, const WebString& path)
     88void WebFileSystemCallbacksImpl::didOpenFileSystem(const WebString& name, const WebURL& rootURL)
    8989{
    9090    // This object is intended to delete itself on exit.
     
    9393#if ENABLE(WORKERS)
    9494    if (m_context && m_context->isWorkerContext()) {
    95         m_callbacks->didOpenFileSystem(name, WorkerAsyncFileSystemChromium::create(m_context, m_type, path, m_synchronous));
     95        m_callbacks->didOpenFileSystem(name, WorkerAsyncFileSystemChromium::create(m_context, m_type, rootURL, m_synchronous));
    9696        return;
    9797    }
    9898#endif
    99     m_callbacks->didOpenFileSystem(name, AsyncFileSystemChromium::create(m_type, path));
     99    m_callbacks->didOpenFileSystem(name, AsyncFileSystemChromium::create(m_type, rootURL));
    100100}
    101101
  • trunk/Source/WebKit/chromium/src/WebFileSystemCallbacksImpl.h

    r78362 r88844  
    4949struct WebFileSystemEntry;
    5050class WebString;
     51class WebURL;
    5152
    5253class WebFileSystemCallbacksImpl : public WebFileSystemCallbacks {
     
    5859    virtual void didReadMetadata(const WebFileInfo& info);
    5960    virtual void didReadDirectory(const WebVector<WebFileSystemEntry>& entries, bool hasMore);
    60     virtual void didOpenFileSystem(const WebString& name, const WebString& rootPath);
     61    virtual void didOpenFileSystem(const WebString& name, const WebURL& rootURL);
    6162    virtual void didFail(WebFileError error);
    6263
  • trunk/Source/WebKit/chromium/src/WebFrameImpl.cpp

    r88812 r88844  
    104104#include "IconURL.h"
    105105#include "InspectorController.h"
     106#include "KURL.h"
    106107#include "Page.h"
    107108#include "PageOverlay.h"
     
    861862                                                     const WebString& path)
    862863{
    863     return toV8(DOMFileSystem::create(frame()->document(), name, AsyncFileSystemChromium::create(static_cast<AsyncFileSystem::Type>(type), path)));
     864    return toV8(DOMFileSystem::create(frame()->document(), name, AsyncFileSystemChromium::create(static_cast<AsyncFileSystem::Type>(type), KURL(ParsedURLString, path.utf8().data()))));
    864865}
    865866
     
    870871                                                    bool isDirectory)
    871872{
    872     RefPtr<DOMFileSystemBase> fileSystem = DOMFileSystem::create(frame()->document(), fileSystemName, AsyncFileSystemChromium::create(static_cast<AsyncFileSystem::Type>(type), fileSystemPath));
     873    RefPtr<DOMFileSystemBase> fileSystem = DOMFileSystem::create(frame()->document(), fileSystemName, AsyncFileSystemChromium::create(static_cast<AsyncFileSystem::Type>(type), KURL(ParsedURLString, fileSystemPath.utf8().data())));
    873874    if (isDirectory)
    874875        return toV8(DirectoryEntry::create(fileSystem, filePath));
  • trunk/Source/WebKit/chromium/src/WorkerAsyncFileSystemChromium.cpp

    r87463 r88844  
    5757static const char fileSystemOperationsMode[] = "fileSystemOperationsMode";
    5858
    59 WorkerAsyncFileSystemChromium::WorkerAsyncFileSystemChromium(ScriptExecutionContext* context, AsyncFileSystem::Type type, const String& rootPath, bool synchronous)
    60     : AsyncFileSystem(type, rootPath)
     59WorkerAsyncFileSystemChromium::WorkerAsyncFileSystemChromium(ScriptExecutionContext* context, AsyncFileSystem::Type type, const WebKit::WebURL& rootURL, bool synchronous)
     60    : AsyncFileSystem(type)
    6161    , m_scriptExecutionContext(context)
    6262    , m_webFileSystem(WebKit::webKitClient()->fileSystem())
    6363    , m_workerContext(static_cast<WorkerContext*>(context))
    6464    , m_synchronous(synchronous)
     65    , m_filesystemRootURL(rootURL)
    6566{
    6667    ASSERT(m_webFileSystem);
     
    9091void WorkerAsyncFileSystemChromium::move(const String& sourcePath, const String& destinationPath, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
    9192{
    92     createWorkerFileSystemCallbacksBridge(callbacks)->postMoveToMainThread(m_webFileSystem, sourcePath, destinationPath, m_modeForCurrentOperation);
     93    createWorkerFileSystemCallbacksBridge(callbacks)->postMoveToMainThread(m_webFileSystem, virtualPathToFileSystemURL(sourcePath), virtualPathToFileSystemURL(destinationPath), m_modeForCurrentOperation);
    9394}
    9495
    9596void WorkerAsyncFileSystemChromium::copy(const String& sourcePath, const String& destinationPath, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
    9697{
    97     createWorkerFileSystemCallbacksBridge(callbacks)->postCopyToMainThread(m_webFileSystem, sourcePath, destinationPath, m_modeForCurrentOperation);
     98    createWorkerFileSystemCallbacksBridge(callbacks)->postCopyToMainThread(m_webFileSystem, virtualPathToFileSystemURL(sourcePath), virtualPathToFileSystemURL(destinationPath), m_modeForCurrentOperation);
    9899}
    99100
    100101void WorkerAsyncFileSystemChromium::remove(const String& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
    101102{
    102     createWorkerFileSystemCallbacksBridge(callbacks)->postRemoveToMainThread(m_webFileSystem, path, m_modeForCurrentOperation);
     103    createWorkerFileSystemCallbacksBridge(callbacks)->postRemoveToMainThread(m_webFileSystem, virtualPathToFileSystemURL(path), m_modeForCurrentOperation);
    103104}
    104105
    105106void WorkerAsyncFileSystemChromium::removeRecursively(const String& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
    106107{
    107     createWorkerFileSystemCallbacksBridge(callbacks)->postRemoveRecursivelyToMainThread(m_webFileSystem, path, m_modeForCurrentOperation);
     108    createWorkerFileSystemCallbacksBridge(callbacks)->postRemoveRecursivelyToMainThread(m_webFileSystem, virtualPathToFileSystemURL(path), m_modeForCurrentOperation);
    108109}
    109110
    110111void WorkerAsyncFileSystemChromium::readMetadata(const String& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
    111112{
    112     createWorkerFileSystemCallbacksBridge(callbacks)->postReadMetadataToMainThread(m_webFileSystem, path, m_modeForCurrentOperation);
     113    createWorkerFileSystemCallbacksBridge(callbacks)->postReadMetadataToMainThread(m_webFileSystem, virtualPathToFileSystemURL(path), m_modeForCurrentOperation);
    113114}
    114115
    115116void WorkerAsyncFileSystemChromium::createFile(const String& path, bool exclusive, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
    116117{
    117     createWorkerFileSystemCallbacksBridge(callbacks)->postCreateFileToMainThread(m_webFileSystem, path, exclusive, m_modeForCurrentOperation);
     118    createWorkerFileSystemCallbacksBridge(callbacks)->postCreateFileToMainThread(m_webFileSystem, virtualPathToFileSystemURL(path), exclusive, m_modeForCurrentOperation);
    118119}
    119120
    120121void WorkerAsyncFileSystemChromium::createDirectory(const String& path, bool exclusive, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
    121122{
    122     createWorkerFileSystemCallbacksBridge(callbacks)->postCreateDirectoryToMainThread(m_webFileSystem, path, exclusive, m_modeForCurrentOperation);
     123    createWorkerFileSystemCallbacksBridge(callbacks)->postCreateDirectoryToMainThread(m_webFileSystem, virtualPathToFileSystemURL(path), exclusive, m_modeForCurrentOperation);
    123124}
    124125
    125126void WorkerAsyncFileSystemChromium::fileExists(const String& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
    126127{
    127     createWorkerFileSystemCallbacksBridge(callbacks)->postFileExistsToMainThread(m_webFileSystem, path, m_modeForCurrentOperation);
     128    createWorkerFileSystemCallbacksBridge(callbacks)->postFileExistsToMainThread(m_webFileSystem, virtualPathToFileSystemURL(path), m_modeForCurrentOperation);
    128129}
    129130
    130131void WorkerAsyncFileSystemChromium::directoryExists(const String& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
    131132{
    132     createWorkerFileSystemCallbacksBridge(callbacks)->postDirectoryExistsToMainThread(m_webFileSystem, path, m_modeForCurrentOperation);
     133    createWorkerFileSystemCallbacksBridge(callbacks)->postDirectoryExistsToMainThread(m_webFileSystem, virtualPathToFileSystemURL(path), m_modeForCurrentOperation);
    133134}
    134135
    135136void WorkerAsyncFileSystemChromium::readDirectory(const String& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
    136137{
    137     createWorkerFileSystemCallbacksBridge(callbacks)->postReadDirectoryToMainThread(m_webFileSystem, path, m_modeForCurrentOperation);
     138    createWorkerFileSystemCallbacksBridge(callbacks)->postReadDirectoryToMainThread(m_webFileSystem, virtualPathToFileSystemURL(path), m_modeForCurrentOperation);
    138139}
    139140
    140141class WorkerFileWriterHelperCallbacks : public AsyncFileSystemCallbacks {
    141142public:
    142     static PassOwnPtr<WorkerFileWriterHelperCallbacks> create(AsyncFileWriterClient* client, const String& path, WebKit::WebFileSystem* webFileSystem, PassOwnPtr<WebCore::AsyncFileSystemCallbacks> callbacks, WorkerContext* workerContext)
     143    static PassOwnPtr<WorkerFileWriterHelperCallbacks> create(AsyncFileWriterClient* client, const WebURL& path, WebKit::WebFileSystem* webFileSystem, PassOwnPtr<WebCore::AsyncFileSystemCallbacks> callbacks, WorkerContext* workerContext)
    143144    {
    144145        return adoptPtr(new WorkerFileWriterHelperCallbacks(client, path, webFileSystem, callbacks, workerContext));
     
    189190
    190191private:
    191     WorkerFileWriterHelperCallbacks(AsyncFileWriterClient* client, const String& path, WebKit::WebFileSystem* webFileSystem, PassOwnPtr<WebCore::AsyncFileSystemCallbacks> callbacks, WorkerContext* workerContext)
     192    WorkerFileWriterHelperCallbacks(AsyncFileWriterClient* client, const WebURL& path, WebKit::WebFileSystem* webFileSystem, PassOwnPtr<WebCore::AsyncFileSystemCallbacks> callbacks, WorkerContext* workerContext)
    192193        : m_client(client)
    193194        , m_path(path)
     
    199200
    200201    AsyncFileWriterClient* m_client;
    201     String m_path;
     202    WebURL m_path;
    202203    WebKit::WebFileSystem* m_webFileSystem;
    203204    OwnPtr<WebCore::AsyncFileSystemCallbacks> m_callbacks;
     
    207208void WorkerAsyncFileSystemChromium::createWriter(AsyncFileWriterClient* client, const String& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
    208209{
    209     createWorkerFileSystemCallbacksBridge(WorkerFileWriterHelperCallbacks::create(client, path, m_webFileSystem, callbacks, m_workerContext))->postReadMetadataToMainThread(m_webFileSystem, path, m_modeForCurrentOperation);
     210    KURL pathAsURL = virtualPathToFileSystemURL(path);
     211    createWorkerFileSystemCallbacksBridge(WorkerFileWriterHelperCallbacks::create(client, pathAsURL, m_webFileSystem, callbacks, m_workerContext))->postReadMetadataToMainThread(m_webFileSystem, pathAsURL, m_modeForCurrentOperation);
    210212}
    211213
     
    221223}
    222224
     225KURL WorkerAsyncFileSystemChromium::virtualPathToFileSystemURL(const String& virtualPath) const
     226{
     227    ASSERT(!m_filesystemRootURL.isEmpty());
     228    KURL url = m_filesystemRootURL;
     229    // Remove the extra leading slash.
     230    url.setPath(url.path() + virtualPath.substring(1));
     231    return url;
     232}
     233
    223234} // namespace WebCore
    224235
  • trunk/Source/WebKit/chromium/src/WorkerAsyncFileSystemChromium.h

    r87463 r88844  
    4141namespace WebKit {
    4242class WebFileSystem;
     43class WebURL;
    4344class WebWorkerBase;
    4445class WorkerFileSystemCallbacksBridge;
     
    5354class WorkerAsyncFileSystemChromium : public AsyncFileSystem {
    5455public:
    55     static PassOwnPtr<AsyncFileSystem> create(ScriptExecutionContext* context, AsyncFileSystem::Type type, const String& rootPath, bool synchronous)
     56    static PassOwnPtr<AsyncFileSystem> create(ScriptExecutionContext* context, AsyncFileSystem::Type type, const WebKit::WebURL& rootURL, bool synchronous)
    5657    {
    57         return adoptPtr(new WorkerAsyncFileSystemChromium(context, type, rootPath, synchronous));
     58        return adoptPtr(new WorkerAsyncFileSystemChromium(context, type, rootURL, synchronous));
    5859    }
    5960
     
    7677
    7778private:
    78     WorkerAsyncFileSystemChromium(ScriptExecutionContext*, AsyncFileSystem::Type, const String& rootPath, bool synchronous);
     79    WorkerAsyncFileSystemChromium(ScriptExecutionContext*, AsyncFileSystem::Type, const WebKit::WebURL& rootURL, bool synchronous);
    7980
    8081    PassRefPtr<WebKit::WorkerFileSystemCallbacksBridge> createWorkerFileSystemCallbacksBridge(PassOwnPtr<AsyncFileSystemCallbacks>);
     82
     83    // Converts a given absolute virtual path to a full origin-qualified FileSystem URL.
     84    KURL virtualPathToFileSystemURL(const String& virtualPath) const;
    8185
    8286    ScriptExecutionContext* m_scriptExecutionContext;
     
    8791    String m_modeForCurrentOperation;
    8892    bool m_synchronous;
     93    KURL m_filesystemRootURL;
    8994};
    9095
  • trunk/Source/WebKit/chromium/src/WorkerAsyncFileWriterChromium.cpp

    r87463 r88844  
    5151namespace WebCore {
    5252
    53 WorkerAsyncFileWriterChromium::WorkerAsyncFileWriterChromium(WebFileSystem* webFileSystem, const String& path, WorkerContext* workerContext, AsyncFileWriterClient* client, WriterType type)
     53WorkerAsyncFileWriterChromium::WorkerAsyncFileWriterChromium(WebFileSystem* webFileSystem, const WebURL& path, WorkerContext* workerContext, AsyncFileWriterClient* client, WriterType type)
    5454    : m_type(type)
    5555{
  • trunk/Source/WebKit/chromium/src/WorkerAsyncFileWriterChromium.h

    r87463 r88844  
    4040    class WebFileSystem;
    4141    class WebFileWriter;
     42    class WebURL;
    4243    class WorkerFileWriterCallbacksBridge;
    4344}
     
    6263    };
    6364
    64     static PassOwnPtr<WorkerAsyncFileWriterChromium> create(WebKit::WebFileSystem* webFileSystem, const String& path, WorkerContext* workerContext, AsyncFileWriterClient* client, WriterType type)
     65    static PassOwnPtr<WorkerAsyncFileWriterChromium> create(WebKit::WebFileSystem* webFileSystem, const WebKit::WebURL& path, WorkerContext* workerContext, AsyncFileWriterClient* client, WriterType type)
    6566    {
    6667        return adoptPtr(new WorkerAsyncFileWriterChromium(webFileSystem, path, workerContext, client, type));
     
    7778private:
    7879
    79     WorkerAsyncFileWriterChromium(WebKit::WebFileSystem*, const String& path, WorkerContext*, AsyncFileWriterClient*, WriterType);
     80    WorkerAsyncFileWriterChromium(WebKit::WebFileSystem*, const WebKit::WebURL& path, WorkerContext*, AsyncFileWriterClient*, WriterType);
    8081    RefPtr<WebKit::WorkerFileWriterCallbacksBridge> m_bridge;
    8182    WriterType m_type;
  • trunk/Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.cpp

    r87463 r88844  
    3535
    3636#include "CrossThreadTask.h"
     37#include "KURL.h"
    3738#include "WebCommonWorkerClient.h"
    3839#include "WebFileInfo.h"
     
    4041#include "WebFileSystemEntry.h"
    4142#include "WebString.h"
     43#include "WebURL.h"
    4244#include "WebWorkerBase.h"
    4345#include "WorkerContext.h"
     
    98100    }
    99101
    100     virtual void didOpenFileSystem(const WebString& name, const WebString& path)
    101     {
    102         m_bridge->didOpenFileSystemOnMainThread(name, path, m_mode);
     102    virtual void didOpenFileSystem(const WebString& name, const WebURL& rootURL)
     103    {
     104        m_bridge->didOpenFileSystemOnMainThread(name, rootURL, m_mode);
    103105        delete this;
    104106    }
     
    162164}
    163165
    164 void WorkerFileSystemCallbacksBridge::postMoveToMainThread(WebFileSystem* fileSystem, const String& sourcePath, const String& destinationPath, const String& mode)
     166void WorkerFileSystemCallbacksBridge::postMoveToMainThread(WebFileSystem* fileSystem, const KURL& sourcePath, const KURL& destinationPath, const String& mode)
    165167{
    166168    dispatchTaskToMainThread(
     
    170172}
    171173
    172 void WorkerFileSystemCallbacksBridge::postCopyToMainThread(WebFileSystem* fileSystem, const String& sourcePath, const String& destinationPath, const String& mode)
     174void WorkerFileSystemCallbacksBridge::postCopyToMainThread(WebFileSystem* fileSystem, const KURL& sourcePath, const KURL& destinationPath, const String& mode)
    173175{
    174176    dispatchTaskToMainThread(
     
    178180}
    179181
    180 void WorkerFileSystemCallbacksBridge::postRemoveToMainThread(WebFileSystem* fileSystem, const String& path, const String& mode)
     182void WorkerFileSystemCallbacksBridge::postRemoveToMainThread(WebFileSystem* fileSystem, const KURL& path, const String& mode)
    181183{
    182184    ASSERT(fileSystem);
     
    187189}
    188190
    189 void WorkerFileSystemCallbacksBridge::postRemoveRecursivelyToMainThread(WebFileSystem* fileSystem, const String& path, const String& mode)
     191void WorkerFileSystemCallbacksBridge::postRemoveRecursivelyToMainThread(WebFileSystem* fileSystem, const KURL& path, const String& mode)
    190192{
    191193    ASSERT(fileSystem);
     
    196198}
    197199
    198 void WorkerFileSystemCallbacksBridge::postReadMetadataToMainThread(WebFileSystem* fileSystem, const String& path, const String& mode)
     200void WorkerFileSystemCallbacksBridge::postReadMetadataToMainThread(WebFileSystem* fileSystem, const KURL& path, const String& mode)
    199201{
    200202    ASSERT(fileSystem);
     
    205207}
    206208
    207 void WorkerFileSystemCallbacksBridge::postCreateFileToMainThread(WebFileSystem* fileSystem, const String& path, bool exclusive, const String& mode)
     209void WorkerFileSystemCallbacksBridge::postCreateFileToMainThread(WebFileSystem* fileSystem, const KURL& path, bool exclusive, const String& mode)
    208210{
    209211    dispatchTaskToMainThread(
     
    213215}
    214216
    215 void WorkerFileSystemCallbacksBridge::postCreateDirectoryToMainThread(WebFileSystem* fileSystem, const String& path, bool exclusive, const String& mode)
     217void WorkerFileSystemCallbacksBridge::postCreateDirectoryToMainThread(WebFileSystem* fileSystem, const KURL& path, bool exclusive, const String& mode)
    216218{
    217219    ASSERT(fileSystem);
     
    222224}
    223225
    224 void WorkerFileSystemCallbacksBridge::postFileExistsToMainThread(WebFileSystem* fileSystem, const String& path, const String& mode)
     226void WorkerFileSystemCallbacksBridge::postFileExistsToMainThread(WebFileSystem* fileSystem, const KURL& path, const String& mode)
    225227{
    226228    ASSERT(fileSystem);
     
    231233}
    232234
    233 void WorkerFileSystemCallbacksBridge::postDirectoryExistsToMainThread(WebFileSystem* fileSystem, const String& path, const String& mode)
     235void WorkerFileSystemCallbacksBridge::postDirectoryExistsToMainThread(WebFileSystem* fileSystem, const KURL& path, const String& mode)
    234236{
    235237    ASSERT(fileSystem);
     
    240242}
    241243
    242 void WorkerFileSystemCallbacksBridge::postReadDirectoryToMainThread(WebFileSystem* fileSystem, const String& path, const String& mode)
     244void WorkerFileSystemCallbacksBridge::postReadDirectoryToMainThread(WebFileSystem* fileSystem, const KURL& path, const String& mode)
    243245{
    244246    ASSERT(fileSystem);
     
    258260}
    259261
    260 void WorkerFileSystemCallbacksBridge::moveOnMainThread(WebCore::ScriptExecutionContext*, WebFileSystem* fileSystem, const String& sourcePath, const String& destinationPath, WorkerFileSystemCallbacksBridge* bridge, const String& mode)
     262void WorkerFileSystemCallbacksBridge::moveOnMainThread(WebCore::ScriptExecutionContext*, WebFileSystem* fileSystem, const KURL& sourcePath, const KURL& destinationPath, WorkerFileSystemCallbacksBridge* bridge, const String& mode)
    261263{
    262264    fileSystem->move(sourcePath, destinationPath, MainThreadFileSystemCallbacks::createLeakedPtr(bridge, mode));
    263265}
    264266
    265 void WorkerFileSystemCallbacksBridge::copyOnMainThread(WebCore::ScriptExecutionContext*, WebFileSystem* fileSystem, const String& sourcePath, const String& destinationPath, WorkerFileSystemCallbacksBridge* bridge, const String& mode)
     267void WorkerFileSystemCallbacksBridge::copyOnMainThread(WebCore::ScriptExecutionContext*, WebFileSystem* fileSystem, const KURL& sourcePath, const KURL& destinationPath, WorkerFileSystemCallbacksBridge* bridge, const String& mode)
    266268{
    267269    fileSystem->copy(sourcePath, destinationPath, MainThreadFileSystemCallbacks::createLeakedPtr(bridge, mode));
    268270}
    269271
    270 void WorkerFileSystemCallbacksBridge::removeOnMainThread(WebCore::ScriptExecutionContext*, WebFileSystem* fileSystem, const String& path, WorkerFileSystemCallbacksBridge* bridge, const String& mode)
     272void WorkerFileSystemCallbacksBridge::removeOnMainThread(WebCore::ScriptExecutionContext*, WebFileSystem* fileSystem, const KURL& path, WorkerFileSystemCallbacksBridge* bridge, const String& mode)
    271273{
    272274    fileSystem->remove(path, MainThreadFileSystemCallbacks::createLeakedPtr(bridge, mode));
    273275}
    274276
    275 void WorkerFileSystemCallbacksBridge::removeRecursivelyOnMainThread(WebCore::ScriptExecutionContext*, WebFileSystem* fileSystem, const String& path, WorkerFileSystemCallbacksBridge* bridge, const String& mode)
     277void WorkerFileSystemCallbacksBridge::removeRecursivelyOnMainThread(WebCore::ScriptExecutionContext*, WebFileSystem* fileSystem, const KURL& path, WorkerFileSystemCallbacksBridge* bridge, const String& mode)
    276278{
    277279    fileSystem->removeRecursively(path, MainThreadFileSystemCallbacks::createLeakedPtr(bridge, mode));
    278280}
    279281
    280 void WorkerFileSystemCallbacksBridge::readMetadataOnMainThread(WebCore::ScriptExecutionContext*, WebFileSystem* fileSystem, const String& path, WorkerFileSystemCallbacksBridge* bridge, const String& mode)
     282void WorkerFileSystemCallbacksBridge::readMetadataOnMainThread(WebCore::ScriptExecutionContext*, WebFileSystem* fileSystem, const KURL& path, WorkerFileSystemCallbacksBridge* bridge, const String& mode)
    281283{
    282284    fileSystem->readMetadata(path, MainThreadFileSystemCallbacks::createLeakedPtr(bridge, mode));
    283285}
    284286
    285 void WorkerFileSystemCallbacksBridge::createFileOnMainThread(WebCore::ScriptExecutionContext*, WebFileSystem* fileSystem, const String& path, bool exclusive, WorkerFileSystemCallbacksBridge* bridge, const String& mode)
     287void WorkerFileSystemCallbacksBridge::createFileOnMainThread(WebCore::ScriptExecutionContext*, WebFileSystem* fileSystem, const KURL& path, bool exclusive, WorkerFileSystemCallbacksBridge* bridge, const String& mode)
    286288{
    287289    fileSystem->createFile(path, exclusive, MainThreadFileSystemCallbacks::createLeakedPtr(bridge, mode));
    288290}
    289291
    290 void WorkerFileSystemCallbacksBridge::createDirectoryOnMainThread(WebCore::ScriptExecutionContext*, WebFileSystem* fileSystem, const String& path, bool exclusive, WorkerFileSystemCallbacksBridge* bridge, const String& mode)
     292void WorkerFileSystemCallbacksBridge::createDirectoryOnMainThread(WebCore::ScriptExecutionContext*, WebFileSystem* fileSystem, const KURL& path, bool exclusive, WorkerFileSystemCallbacksBridge* bridge, const String& mode)
    291293{
    292294    fileSystem->createDirectory(path, exclusive, MainThreadFileSystemCallbacks::createLeakedPtr(bridge, mode));
    293295}
    294296
    295 void WorkerFileSystemCallbacksBridge::fileExistsOnMainThread(WebCore::ScriptExecutionContext*, WebFileSystem* fileSystem, const String& path, WorkerFileSystemCallbacksBridge* bridge, const String& mode)
     297void WorkerFileSystemCallbacksBridge::fileExistsOnMainThread(WebCore::ScriptExecutionContext*, WebFileSystem* fileSystem, const KURL& path, WorkerFileSystemCallbacksBridge* bridge, const String& mode)
    296298{
    297299    fileSystem->fileExists(path, MainThreadFileSystemCallbacks::createLeakedPtr(bridge, mode));
    298300}
    299301
    300 void WorkerFileSystemCallbacksBridge::directoryExistsOnMainThread(WebCore::ScriptExecutionContext*, WebFileSystem* fileSystem, const String& path, WorkerFileSystemCallbacksBridge* bridge, const String& mode)
     302void WorkerFileSystemCallbacksBridge::directoryExistsOnMainThread(WebCore::ScriptExecutionContext*, WebFileSystem* fileSystem, const KURL& path, WorkerFileSystemCallbacksBridge* bridge, const String& mode)
    301303{
    302304    fileSystem->directoryExists(path, MainThreadFileSystemCallbacks::createLeakedPtr(bridge, mode));
    303305}
    304306
    305 void WorkerFileSystemCallbacksBridge::readDirectoryOnMainThread(WebCore::ScriptExecutionContext*, WebFileSystem* fileSystem, const String& path, WorkerFileSystemCallbacksBridge* bridge, const String& mode)
     307void WorkerFileSystemCallbacksBridge::readDirectoryOnMainThread(WebCore::ScriptExecutionContext*, WebFileSystem* fileSystem, const KURL& path, WorkerFileSystemCallbacksBridge* bridge, const String& mode)
    306308{
    307309    fileSystem->readDirectory(path, MainThreadFileSystemCallbacks::createLeakedPtr(bridge, mode));
     
    313315}
    314316
    315 void WorkerFileSystemCallbacksBridge::didOpenFileSystemOnMainThread(const String& name, const String& rootPath, const String& mode)
     317void WorkerFileSystemCallbacksBridge::didOpenFileSystemOnMainThread(const String& name, const KURL& rootURL, const String& mode)
    316318{
    317319    mayPostTaskToWorker(createCallbackTask(&didOpenFileSystemOnWorkerThread,
    318                                            AllowCrossThreadAccess(this), name, rootPath), mode);
     320                                           AllowCrossThreadAccess(this), name, rootURL), mode);
    319321}
    320322
     
    355357}
    356358
    357 void WorkerFileSystemCallbacksBridge::didOpenFileSystemOnWorkerThread(ScriptExecutionContext*, WorkerFileSystemCallbacksBridge* bridge, const String& name, const String& rootPath)
    358 {
    359     bridge->m_callbacksOnWorkerThread->didOpenFileSystem(name, rootPath);
     359void WorkerFileSystemCallbacksBridge::didOpenFileSystemOnWorkerThread(ScriptExecutionContext*, WorkerFileSystemCallbacksBridge* bridge, const String& name, const KURL& rootURL)
     360{
     361    bridge->m_callbacksOnWorkerThread->didOpenFileSystem(name, rootURL);
    360362}
    361363
  • trunk/Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.h

    r87463 r88844  
    8686    // Methods that create an instance and post an initial request task to the main thread. They must be called on the worker thread.
    8787    void postOpenFileSystemToMainThread(WebCommonWorkerClient*, WebFileSystem::Type, long long size, bool create, const String& mode);
    88     void postMoveToMainThread(WebFileSystem*, const String& srcPath, const String& destPath, const String& mode);
    89     void postCopyToMainThread(WebFileSystem*, const String& srcPath, const String& destPath, const String& mode);
    90     void postRemoveToMainThread(WebFileSystem*, const String& path, const String& mode);
    91     void postRemoveRecursivelyToMainThread(WebFileSystem*, const String& path, const String& mode);
    92     void postReadMetadataToMainThread(WebFileSystem*, const String& path, const String& mode);
    93     void postCreateFileToMainThread(WebFileSystem*, const String& path, bool exclusive, const String& mode);
    94     void postCreateDirectoryToMainThread(WebFileSystem*, const String& path, bool exclusive, const String& mode);
    95     void postFileExistsToMainThread(WebFileSystem*, const String& path, const String& mode);
    96     void postDirectoryExistsToMainThread(WebFileSystem*, const String& path, const String& mode);
    97     void postReadDirectoryToMainThread(WebFileSystem*, const String& path, const String& mode);
     88    void postMoveToMainThread(WebFileSystem*, const WebCore::KURL& srcPath, const WebCore::KURL& destPath, const String& mode);
     89    void postCopyToMainThread(WebFileSystem*, const WebCore::KURL& srcPath, const WebCore::KURL& destPath, const String& mode);
     90    void postRemoveToMainThread(WebFileSystem*, const WebCore::KURL& path, const String& mode);
     91    void postRemoveRecursivelyToMainThread(WebFileSystem*, const WebCore::KURL& path, const String& mode);
     92    void postReadMetadataToMainThread(WebFileSystem*, const WebCore::KURL& path, const String& mode);
     93    void postCreateFileToMainThread(WebFileSystem*, const WebCore::KURL& path, bool exclusive, const String& mode);
     94    void postCreateDirectoryToMainThread(WebFileSystem*, const WebCore::KURL& path, bool exclusive, const String& mode);
     95    void postFileExistsToMainThread(WebFileSystem*, const WebCore::KURL& path, const String& mode);
     96    void postDirectoryExistsToMainThread(WebFileSystem*, const WebCore::KURL& path, const String& mode);
     97    void postReadDirectoryToMainThread(WebFileSystem*, const WebCore::KURL& path, const String& mode);
    9898
    9999    // Callback methods that are called on the main thread.
    100100    void didFailOnMainThread(WebFileError, const String& mode);
    101     void didOpenFileSystemOnMainThread(const String& name, const String& rootPath, const String& mode);
     101    void didOpenFileSystemOnMainThread(const String& name, const WebCore::KURL& rootURL, const String& mode);
    102102    void didSucceedOnMainThread(const String& mode);
    103103    void didReadMetadataOnMainThread(const WebFileInfo&, const String& mode);
     
    109109    // Methods that are to be called on the main thread.
    110110    static void openFileSystemOnMainThread(WebCore::ScriptExecutionContext*, WebCommonWorkerClient*, WebFileSystem::Type, long long size, bool create, WorkerFileSystemCallbacksBridge*, const String& mode);
    111     static void moveOnMainThread(WebCore::ScriptExecutionContext*, WebFileSystem*, const String& srcPath, const String& destPath, WorkerFileSystemCallbacksBridge*, const String& mode);
    112     static void copyOnMainThread(WebCore::ScriptExecutionContext*, WebFileSystem*, const String& srcPath, const String& destPath, WorkerFileSystemCallbacksBridge*, const String& mode);
    113     static void removeOnMainThread(WebCore::ScriptExecutionContext*, WebFileSystem*, const String& path, WorkerFileSystemCallbacksBridge*, const String& mode);
    114     static void removeRecursivelyOnMainThread(WebCore::ScriptExecutionContext*, WebFileSystem*, const String& path, WorkerFileSystemCallbacksBridge*, const String& mode);
    115     static void readMetadataOnMainThread(WebCore::ScriptExecutionContext*, WebFileSystem*, const String& path, WorkerFileSystemCallbacksBridge*, const String& mode);
    116     static void createFileOnMainThread(WebCore::ScriptExecutionContext*, WebFileSystem*, const String& path, bool exclusive, WorkerFileSystemCallbacksBridge*, const String& mode);
    117     static void createDirectoryOnMainThread(WebCore::ScriptExecutionContext*, WebFileSystem*, const String& path, bool exclusive, WorkerFileSystemCallbacksBridge*, const String& mode);
    118     static void fileExistsOnMainThread(WebCore::ScriptExecutionContext*, WebFileSystem*, const String& path, WorkerFileSystemCallbacksBridge*, const String& mode);
    119     static void directoryExistsOnMainThread(WebCore::ScriptExecutionContext*, WebFileSystem*, const String& path, WorkerFileSystemCallbacksBridge*, const String& mode);
    120     static void readDirectoryOnMainThread(WebCore::ScriptExecutionContext*, WebFileSystem*, const String& path, WorkerFileSystemCallbacksBridge*, const String& mode);
     111    static void moveOnMainThread(WebCore::ScriptExecutionContext*, WebFileSystem*, const WebCore::KURL& srcPath, const WebCore::KURL& destPath, WorkerFileSystemCallbacksBridge*, const String& mode);
     112    static void copyOnMainThread(WebCore::ScriptExecutionContext*, WebFileSystem*, const WebCore::KURL& srcPath, const WebCore::KURL& destPath, WorkerFileSystemCallbacksBridge*, const String& mode);
     113    static void removeOnMainThread(WebCore::ScriptExecutionContext*, WebFileSystem*, const WebCore::KURL& path, WorkerFileSystemCallbacksBridge*, const String& mode);
     114    static void removeRecursivelyOnMainThread(WebCore::ScriptExecutionContext*, WebFileSystem*, const WebCore::KURL& path, WorkerFileSystemCallbacksBridge*, const String& mode);
     115    static void readMetadataOnMainThread(WebCore::ScriptExecutionContext*, WebFileSystem*, const WebCore::KURL& path, WorkerFileSystemCallbacksBridge*, const String& mode);
     116    static void createFileOnMainThread(WebCore::ScriptExecutionContext*, WebFileSystem*, const WebCore::KURL& path, bool exclusive, WorkerFileSystemCallbacksBridge*, const String& mode);
     117    static void createDirectoryOnMainThread(WebCore::ScriptExecutionContext*, WebFileSystem*, const WebCore::KURL& path, bool exclusive, WorkerFileSystemCallbacksBridge*, const String& mode);
     118    static void fileExistsOnMainThread(WebCore::ScriptExecutionContext*, WebFileSystem*, const WebCore::KURL& path, WorkerFileSystemCallbacksBridge*, const String& mode);
     119    static void directoryExistsOnMainThread(WebCore::ScriptExecutionContext*, WebFileSystem*, const WebCore::KURL& path, WorkerFileSystemCallbacksBridge*, const String& mode);
     120    static void readDirectoryOnMainThread(WebCore::ScriptExecutionContext*, WebFileSystem*, const WebCore::KURL& path, WorkerFileSystemCallbacksBridge*, const String& mode);
    121121
    122122    friend class MainThreadFileSystemCallbacks;
     
    124124    // Methods that dispatch WebFileSystemCallbacks on the worker threads.
    125125    static void didFailOnWorkerThread(WebCore::ScriptExecutionContext*, WorkerFileSystemCallbacksBridge*, WebFileError);
    126     static void didOpenFileSystemOnWorkerThread(WebCore::ScriptExecutionContext*, WorkerFileSystemCallbacksBridge*, const String& name, const String& rootPath);
     126    static void didOpenFileSystemOnWorkerThread(WebCore::ScriptExecutionContext*, WorkerFileSystemCallbacksBridge*, const String& name, const WebCore::KURL& rootPath);
    127127    static void didSucceedOnWorkerThread(WebCore::ScriptExecutionContext*, WorkerFileSystemCallbacksBridge*);
    128128    static void didReadMetadataOnWorkerThread(WebCore::ScriptExecutionContext*, WorkerFileSystemCallbacksBridge*, const WebFileInfo&);
  • trunk/Source/WebKit/chromium/src/WorkerFileWriterCallbacksBridge.cpp

    r87463 r88844  
    102102}
    103103
    104 void WorkerFileWriterCallbacksBridge::initOnMainThread(ScriptExecutionContext*, PassRefPtr<WorkerFileWriterCallbacksBridge> bridge, const String& path)
     104void WorkerFileWriterCallbacksBridge::initOnMainThread(ScriptExecutionContext*, PassRefPtr<WorkerFileWriterCallbacksBridge> bridge, const KURL& path)
    105105{
    106106    ASSERT(!bridge->m_writer);
     
    131131static const char fileWriterOperationsMode[] = "fileWriterOperationsMode";
    132132
    133 WorkerFileWriterCallbacksBridge::WorkerFileWriterCallbacksBridge(const String& path, WorkerLoaderProxy* proxy, ScriptExecutionContext* scriptExecutionContext, AsyncFileWriterClient* client)
     133WorkerFileWriterCallbacksBridge::WorkerFileWriterCallbacksBridge(const KURL& path, WorkerLoaderProxy* proxy, ScriptExecutionContext* scriptExecutionContext, AsyncFileWriterClient* client)
    134134    : WorkerContext::Observer(static_cast<WorkerContext*>(scriptExecutionContext))
    135135    , m_proxy(proxy)
     
    145145}
    146146
    147 void WorkerFileWriterCallbacksBridge::postInitToMainThread(const String& path)
     147void WorkerFileWriterCallbacksBridge::postInitToMainThread(const KURL& path)
    148148{
    149149    dispatchTaskToMainThread(
  • trunk/Source/WebKit/chromium/src/WorkerFileWriterCallbacksBridge.h

    r87463 r88844  
    3434#if ENABLE(FILE_SYSTEM) && ENABLE(WORKERS)
    3535
     36#include "KURL.h"
    3637#include "WebFileError.h"
    3738#include "WebFileWriterClient.h"
     
    5758class WebFileWriter;
    5859class WebFileWriterClient;
     60class WebURL;
    5961class WebWorkerBase;
    6062
     
    8789    virtual void notifyStop();
    8890
    89     static PassRefPtr<WorkerFileWriterCallbacksBridge> create(const String& path, WebCore::WorkerLoaderProxy* proxy, WebCore::ScriptExecutionContext* workerContext, WebCore::AsyncFileWriterClient* client)
     91    static PassRefPtr<WorkerFileWriterCallbacksBridge> create(const WebCore::KURL& path, WebCore::WorkerLoaderProxy* proxy, WebCore::ScriptExecutionContext* workerContext, WebCore::AsyncFileWriterClient* client)
    9092    {
    9193        return adoptRef(new WorkerFileWriterCallbacksBridge(path, proxy, workerContext, client));
     
    111113
    112114private:
    113     WorkerFileWriterCallbacksBridge(const String& path, WebCore::WorkerLoaderProxy*, WebCore::ScriptExecutionContext*, WebCore::AsyncFileWriterClient*);
     115    WorkerFileWriterCallbacksBridge(const WebCore::KURL& path, WebCore::WorkerLoaderProxy*, WebCore::ScriptExecutionContext*, WebCore::AsyncFileWriterClient*);
    114116
    115     void postInitToMainThread(const String& path);
     117    void postInitToMainThread(const WebCore::KURL& path);
    116118
    117119    // Methods that are to be called on the main thread.
     
    119121    static void truncateOnMainThread(WebCore::ScriptExecutionContext*, PassRefPtr<WorkerFileWriterCallbacksBridge>, long long length);
    120122    static void abortOnMainThread(WebCore::ScriptExecutionContext*, PassRefPtr<WorkerFileWriterCallbacksBridge>);
    121     static void initOnMainThread(WebCore::ScriptExecutionContext*, PassRefPtr<WorkerFileWriterCallbacksBridge>, const String& path);
     123    static void initOnMainThread(WebCore::ScriptExecutionContext*, PassRefPtr<WorkerFileWriterCallbacksBridge>, const WebCore::KURL& path);
    122124    static void shutdownOnMainThread(WebCore::ScriptExecutionContext*, PassRefPtr<WorkerFileWriterCallbacksBridge>);
    123125
Note: See TracChangeset for help on using the changeset viewer.