Changeset 65718 in webkit


Ignore:
Timestamp:
Aug 19, 2010 5:47:31 PM (14 years ago)
Author:
kinuko@chromium.org
Message:

2010-08-19 Kinuko Yasuda <kinuko@chromium.org>

Reviewed by Darin Fisher.

Add WebKit API for FileSystem API
https://bugs.webkit.org/show_bug.cgi?id=43151

Add asynchronous FileSystem interface to WebKit API for
FileSystem API.
http://dev.w3.org/2009/dap/file-system/file-dir-sys.html

  • WebKit.gyp:
  • public/WebFileError.h: Added.
  • public/WebFileSystem.h: Added.
  • public/WebFileSystemEntry.h: Added.
  • public/WebFileSystemCallbacks.h: Added.
  • public/WebKitClient.h: (WebKit::WebKitClient::fileSystem):
  • public/WebFrameClient.h: (WebKit::WebFrameClient::openFileSystem):
Location:
trunk/WebKit/chromium
Files:
3 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit/chromium/ChangeLog

    r65715 r65718  
     12010-08-19  Kinuko Yasuda  <kinuko@chromium.org>
     2
     3        Reviewed by Darin Fisher.
     4
     5        Add WebKit API for FileSystem API
     6        https://bugs.webkit.org/show_bug.cgi?id=43151
     7
     8        Add asynchronous FileSystem interface to WebKit API for
     9        FileSystem API.
     10        http://dev.w3.org/2009/dap/file-system/file-dir-sys.html
     11
     12        * WebKit.gyp:
     13        * public/WebFileError.h: Added.
     14        * public/WebFileSystem.h: Added.
     15        * public/WebFileSystemEntry.h: Added.
     16        * public/WebFileSystemCallbacks.h: Added.
     17        * public/WebKitClient.h:
     18        (WebKit::WebKitClient::fileSystem):
     19        * public/WebFrameClient.h:
     20        (WebKit::WebFrameClient::openFileSystem):
     21
    1222010-08-19  Kinuko Yasuda  <kinuko@chromium.org>
    223
  • trunk/WebKit/chromium/WebKit.gyp

    r65688 r65718  
    164164                'public/WebFileChooserCompletion.h',
    165165                'public/WebFileChooserParams.h',
     166                'public/WebFileError.h',
    166167                'public/WebFileInfo.h',
    167168                'public/WebFileSystem.h',
     169                'public/WebFileSystemCallbacks.h',
     170                'public/WebFileSystemEntry.h',
    168171                'public/WebFileUtilities.h',
    169172                'public/WebFindOptions.h',
  • trunk/WebKit/chromium/public/WebFileSystem.h

    r65482 r65718  
    3232#define WebFileSystem_h
    3333
    34 #include "WebFileUtilities.h"
     34#include "WebCommon.h"
     35#include "WebString.h"
    3536
    3637namespace WebKit {
    3738
    38 // FIXME: Clean up this class once the renaming to WebFileUtilities is done.
    39 class WebFileSystem : public WebFileUtilities {
     39class WebFileSystemCallbacks;
     40
     41class WebFileSystem {
     42public:
     43    enum Type {
     44        TypeTemporary,
     45        TypePersistent,
     46    };
     47
     48    // Moves a file or directory at |srcPath| to |destPath|.
     49    // WebFileSystemCallbacks::didSucceed() must be called when the operation is completed successfully.
     50    // WebFileSystemCallbacks::didFail() must be called otherwise.
     51    virtual void move(const WebString& srcPath, const WebString& destPath, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
     52
     53    // Copies a file or directory at |srcPath| to |destPath|.
     54    // WebFileSystemCallbacks::didSucceed() must be called when the operation is completed successfully.
     55    // WebFileSystemCallbacks::didFail() must be called otherwise.
     56    virtual void copy(const WebString& srcPath, const WebString& destPath, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
     57
     58    // Deletes a file or directory at a given |path|.
     59    // WebFileSystemCallbacks::didSucceed() must be called when the operation is completed successfully.
     60    // WebFileSystemCallbacks::didFail() must be called otherwise.
     61    virtual void remove(const WebString& path, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
     62
     63    // Retrieves the metadata information of the file or directory at the given |path|.
     64    // WebFileSystemCallbacks::didReadMetadata() must be called with a valid metadata when the retrieval is completed successfully.
     65    // WebFileSystemCallbacks::didFail() must be called otherwise.
     66    virtual void readMetadata(const WebString& path, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
     67
     68    // Creates a file at given |path|.
     69    // If the |path| doesn't exist, it creates a new file at |path|.
     70    // If |exclusive| is true, it fails if the |path| already exists.
     71    // If |exclusive| is false, it succeeds if the |path| already exists or
     72    // it has successfully created a new file at |path|.
     73    //
     74    // WebFileSystemCallbacks::didSucceed() must be called when the operation is completed successfully.
     75    // WebFileSystemCallbacks::didFail() must be called otherwise.
     76    virtual void createFile(const WebString& path, bool exclusive, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
     77
     78    // Creates a directory at a given |path|.
     79    // If the |path| doesn't exist, it creates a new directory at |path|.
     80    // If |exclusive| is true, it fails if the |path| already exists.
     81    // If |exclusive| is false, it succeeds if the |path| already exists or it has successfully created a new directory at |path|.
     82    //
     83    // WebFileSystemCallbacks::didSucceed() must be called when
     84    // the operation is completed successfully.
     85    // WebFileSystemCallbacks::didFail() must be called otherwise.
     86    virtual void createDirectory(const WebString& path, bool exclusive, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
     87
     88    // Checks if a file exists at a given |path|.
     89    // WebFileSystemCallbacks::didSucceed() must be called when the operation is completed successfully.
     90    // WebFileSystemCallbacks::didFail() must be called otherwise.
     91    virtual void fileExists(const WebString& path, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
     92
     93    // Checks if a directory exists at a given |path|.
     94    // WebFileSystemCallbacks::didSucceed() must be called when the operation is completed successfully.
     95    // WebFileSystemCallbacks::didFail() must be called otherwise.
     96    virtual void directoryExists(const WebString& path, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
     97
     98    // Reads directory entries of a given directory at |path|.
     99    // WebFileSystemCallbacks::didReadDirectory() must be called when the operation is completed successfully.
     100    // WebFileSystemCallbacks::didFail() must be called otherwise.
     101    virtual void readDirectory(const WebString& path, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
     102
     103protected:
     104    virtual ~WebFileSystem() { }
    40105};
    41106
  • trunk/WebKit/chromium/public/WebFrameClient.h

    r65604 r65718  
    3333
    3434#include "WebCommon.h"
     35#include "WebFileSystem.h"
    3536#include "WebNavigationPolicy.h"
    3637#include "WebNavigationType.h"
     
    334335        int identifier, int activeMatchOrdinal, const WebRect& selection) { }
    335336
     337    // FileSystem ----------------------------------------------------
     338
     339    // Requests to open a FileSystem.
     340    // |size| indicates how much storage space (in bytes) the caller expects
     341    // to need.
     342    // WebFileSystemCallbacks::didOpenFileSystem() must be called with
     343    // a name and root path for the requested FileSystem when the operation
     344    // is completed successfully. WebFileSystemCallbacks::didFail() must be
     345    // called otherwise.
     346    virtual void openFileSystem(
     347        WebFrame*, WebFileSystem::Type, long long size,
     348        WebFileSystemCallbacks*) { }
     349
    336350protected:
    337351    ~WebFrameClient() { }
  • trunk/WebKit/chromium/public/WebKitClient.h

    r65637 r65718  
    3434#include "WebCommon.h"
    3535#include "WebData.h"
    36 #include "WebFileSystem.h"
    3736#include "WebLocalizedString.h"
    3837#include "WebString.h"
     
    5251class WebClipboard;
    5352class WebCookieJar;
     53class WebFileSystem;
    5454class WebFileUtilities;
    5555class WebGLES2Context;
     
    7575
    7676    // Must return non-null.
    77     // FIXME: Clean up this one once the renaming to WebFileUtilities is done.
    78     virtual WebFileSystem* fileSystem() { return 0; }
    79 
    80     // Must return non-null.
    81     // FIXME: Clean up this one once the renaming from WebFileSystem is done.
    82     virtual WebFileUtilities* fileUtilities() { return fileSystem(); }
     77    virtual WebFileUtilities* fileUtilities() { return 0; }
    8378
    8479    // May return null if sandbox support is not necessary
     
    275270    virtual WebGLES2Context* createGLES2Context() { return 0; }
    276271
     272    // FileSystem ----------------------------------------------------------
     273
     274    // Must return non-null.
     275    virtual WebFileSystem* fileSystem() { return 0; }
     276
    277277protected:
    278278    ~WebKitClient() { }
Note: See TracChangeset for help on using the changeset viewer.