Changeset 71206 in webkit


Ignore:
Timestamp:
Nov 2, 2010 7:59:03 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2010-11-02 Kavita Kanetkar <kkanetkar@chromium.org>

Reviewed by Dumitru Daniliuc.

[FileSystem] Support not creating directories when queried by inspector.
https://bugs.webkit.org/show_bug.cgi?id=48169

  • fileapi/LocalFileSystem.cpp: (WebCore::openFileSystem): (WebCore::LocalFileSystem::readFileSystem): (WebCore::LocalFileSystem::requestFileSystem):
  • fileapi/LocalFileSystem.h:
  • platform/AsyncFileSystem.cpp: (WebCore::AsyncFileSystem::openFileSystem):
  • platform/AsyncFileSystem.h:

2010-11-02 Kavita Kanetkar <kkanetkar@chromium.org>

Reviewed by Dumitru Daniliuc.

[FileSystem] Support not creating directories when queried by inspector.
https://bugs.webkit.org/show_bug.cgi?id=48169

  • src/LocalFileSystemChromium.cpp: (WebCore::LocalFileSystem::readFileSystem): (WebCore::LocalFileSystem::requestFileSystem):
Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r71205 r71206  
     12010-11-02  Kavita Kanetkar  <kkanetkar@chromium.org>
     2
     3        Reviewed by Dumitru Daniliuc.
     4
     5        [FileSystem] Support not creating directories when queried by inspector.
     6        https://bugs.webkit.org/show_bug.cgi?id=48169
     7
     8        * fileapi/LocalFileSystem.cpp:
     9        (WebCore::openFileSystem):
     10        (WebCore::LocalFileSystem::readFileSystem):
     11        (WebCore::LocalFileSystem::requestFileSystem):
     12        * fileapi/LocalFileSystem.h:
     13        * platform/AsyncFileSystem.cpp:
     14        (WebCore::AsyncFileSystem::openFileSystem):
     15        * platform/AsyncFileSystem.h:
     16
    1172010-11-02  Chris Rogers  <crogers@google.com>
    218
  • trunk/WebCore/fileapi/LocalFileSystem.cpp

    r69249 r71206  
    7777}
    7878
    79 static void openFileSystem(ScriptExecutionContext*, const String& basePath, const String& identifier, AsyncFileSystem::Type type, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
     79static void openFileSystem(ScriptExecutionContext*, const String& basePath, const String& identifier, AsyncFileSystem::Type type, bool create, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
    8080{
    81     AsyncFileSystem::openFileSystem(basePath, identifier, type, callbacks);
     81    AsyncFileSystem::openFileSystem(basePath, identifier, type, create, callbacks);
     82}
     83
     84void LocalFileSystem::readFileSystem(ScriptExecutionContext* context, AsyncFileSystem::Type type, long long, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
     85{
     86    // AsyncFileSystem::openFileSystem calls callbacks synchronously, so the method needs to be called asynchronously.
     87    context->postTask(createCallbackTask(&openFileSystem, fileSystemBasePath(), context->securityOrigin()->databaseIdentifier(), type, false, callbacks));
    8288}
    8389
     
    8591{
    8692    // AsyncFileSystem::openFileSystem calls callbacks synchronously, so the method needs to be called asynchronously.
    87     context->postTask(createCallbackTask(&openFileSystem, fileSystemBasePath(), context->securityOrigin()->databaseIdentifier(), type, callbacks));
     93    context->postTask(createCallbackTask(&openFileSystem, fileSystemBasePath(), context->securityOrigin()->databaseIdentifier(), type, true, callbacks));
    8894}
    8995
  • trunk/WebCore/fileapi/LocalFileSystem.h

    r69249 r71206  
    5353    static LocalFileSystem& localFileSystem();
    5454
     55    // Does not create the root path for file system, just reads it if available.
     56    void readFileSystem(ScriptExecutionContext*, AsyncFileSystem::Type, long long size, PassOwnPtr<AsyncFileSystemCallbacks>);
     57
    5558    void requestFileSystem(ScriptExecutionContext*, AsyncFileSystem::Type, long long size, PassOwnPtr<AsyncFileSystemCallbacks>, bool synchronous = false);
    5659
  • trunk/WebCore/platform/AsyncFileSystem.cpp

    r68222 r71206  
    5454
    5555// Default implementation.
    56 void AsyncFileSystem::openFileSystem(const String& basePath, const String& storageIdentifier, Type type, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
     56void AsyncFileSystem::openFileSystem(const String& basePath, const String& storageIdentifier, Type type, bool, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
    5757{
    5858    String typeString = (type == Persistent) ? "Persistent" : "Temporary";
  • trunk/WebCore/platform/AsyncFileSystem.h

    r70956 r71206  
    6767    static PassOwnPtr<AsyncFileSystem> create(const String& rootPath);
    6868
    69     // Opens a new file system.
    70     static void openFileSystem(const String& basePath, const String& storageIdentifier, Type, PassOwnPtr<AsyncFileSystemCallbacks>);
     69    // Opens a new file system. The create parameter specifies whether or not to create the path if it does not already exists.
     70    static void openFileSystem(const String& basePath, const String& storageIdentifier, Type, bool create, PassOwnPtr<AsyncFileSystemCallbacks>);
    7171
    7272    // Moves a file or directory from srcPath to destPath.
  • trunk/WebKit/chromium/ChangeLog

    r71198 r71206  
     12010-11-02  Kavita Kanetkar  <kkanetkar@chromium.org>
     2
     3        Reviewed by Dumitru Daniliuc.
     4
     5        [FileSystem] Support not creating directories when queried by inspector.
     6        https://bugs.webkit.org/show_bug.cgi?id=48169
     7
     8        * src/LocalFileSystemChromium.cpp:
     9        (WebCore::LocalFileSystem::readFileSystem):
     10        (WebCore::LocalFileSystem::requestFileSystem):
     11
    1122010-11-02  Chris Guillory  <chris.guillory@google.com>
    213
  • trunk/WebKit/chromium/src/LocalFileSystemChromium.cpp

    r69249 r71206  
    5858}
    5959
     60void LocalFileSystem::readFileSystem(ScriptExecutionContext* context, AsyncFileSystem::Type type, long long size, PassOwnPtr<AsyncFileSystemCallbacks> callbacks)
     61{
     62    ASSERT(context && context->isDocument());
     63    Document* document = static_cast<Document*>(context);
     64    WebFrameImpl* webFrame = WebFrameImpl::fromFrame(document->frame());
     65    webFrame->client()->openFileSystem(webFrame, static_cast<WebFileSystem::Type>(type), size, false, new WebFileSystemCallbacksImpl(callbacks));
     66}
     67
    6068void LocalFileSystem::requestFileSystem(ScriptExecutionContext* context, AsyncFileSystem::Type type, long long size, PassOwnPtr<AsyncFileSystemCallbacks> callbacks, bool synchronous)
    6169{
     
    6472        Document* document = static_cast<Document*>(context);
    6573        WebFrameImpl* webFrame = WebFrameImpl::fromFrame(document->frame());
    66         webFrame->client()->openFileSystem(webFrame, static_cast<WebFileSystem::Type>(type), size, new WebFileSystemCallbacksImpl(callbacks));
     74        webFrame->client()->openFileSystem(webFrame, static_cast<WebFileSystem::Type>(type), size, true, new WebFileSystemCallbacksImpl(callbacks));
    6775    } else {
    6876        WorkerContext* workerContext = static_cast<WorkerContext*>(context);
Note: See TracChangeset for help on using the changeset viewer.