Changeset 116336 in webkit


Ignore:
Timestamp:
May 7, 2012 12:11:53 PM (12 years ago)
Author:
pilgrim@chromium.org
Message:

[Chromium] Move fileSystem to Platform.h
https://bugs.webkit.org/show_bug.cgi?id=85760

Reviewed by Adam Barth.

Part of a refactoring series. See tracking bug 82948.

Source/Platform:

  • Platform.gypi:
  • chromium/public/Platform.h:

(WebKit):
(Platform):
(WebKit::Platform::fileSystem):

  • chromium/public/WebFileSystem.h: Added.

(WebKit):
(WebFileSystem):
(WebKit::WebFileSystem::move):
(WebKit::WebFileSystem::copy):
(WebKit::WebFileSystem::remove):
(WebKit::WebFileSystem::removeRecursively):
(WebKit::WebFileSystem::readMetadata):
(WebKit::WebFileSystem::createFile):
(WebKit::WebFileSystem::createDirectory):
(WebKit::WebFileSystem::fileExists):
(WebKit::WebFileSystem::directoryExists):
(WebKit::WebFileSystem::readDirectory):
(WebKit::WebFileSystem::createFileWriter):
(WebKit::WebFileSystem::createSnapshotFileAndReadMetadata):
(WebKit::WebFileSystem::~WebFileSystem):

Source/WebKit/chromium:

  • WebKit.gyp:
  • public/platform/WebFileSystem.h:
  • public/platform/WebKitPlatformSupport.h:

(WebKit):
(WebKitPlatformSupport):

  • src/AssertMatchingEnums.cpp:
  • src/AsyncFileSystemChromium.cpp:

(WebCore::AsyncFileSystemChromium::AsyncFileSystemChromium):

  • src/LocalFileSystemChromium.cpp:
  • src/WebFileSystemCallbacksImpl.cpp:
  • src/WebFileSystemCallbacksImpl.h:
  • src/WebFrameImpl.cpp:
  • src/WebWorkerClientImpl.h:
  • src/WorkerAsyncFileSystemChromium.cpp:
  • src/WorkerAsyncFileWriterChromium.cpp:
  • src/WorkerFileSystemCallbacksBridge.h:
  • src/WorkerFileWriterCallbacksBridge.cpp:

(WebKit::WorkerFileWriterCallbacksBridge::initOnMainThread):

Location:
trunk/Source
Files:
18 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/Source/Platform/ChangeLog

    r116321 r116336  
     12012-05-07  Mark Pilgrim  <pilgrim@chromium.org>
     2
     3        [Chromium] Move fileSystem to Platform.h
     4        https://bugs.webkit.org/show_bug.cgi?id=85760
     5
     6        Reviewed by Adam Barth.
     7
     8        Part of a refactoring series. See tracking bug 82948.
     9
     10        * Platform.gypi:
     11        * chromium/public/Platform.h:
     12        (WebKit):
     13        (Platform):
     14        (WebKit::Platform::fileSystem):
     15        * chromium/public/WebFileSystem.h: Added.
     16        (WebKit):
     17        (WebFileSystem):
     18        (WebKit::WebFileSystem::move):
     19        (WebKit::WebFileSystem::copy):
     20        (WebKit::WebFileSystem::remove):
     21        (WebKit::WebFileSystem::removeRecursively):
     22        (WebKit::WebFileSystem::readMetadata):
     23        (WebKit::WebFileSystem::createFile):
     24        (WebKit::WebFileSystem::createDirectory):
     25        (WebKit::WebFileSystem::fileExists):
     26        (WebKit::WebFileSystem::directoryExists):
     27        (WebKit::WebFileSystem::readDirectory):
     28        (WebKit::WebFileSystem::createFileWriter):
     29        (WebKit::WebFileSystem::createSnapshotFileAndReadMetadata):
     30        (WebKit::WebFileSystem::~WebFileSystem):
     31
    1322012-05-07  Tommy Widenflycht  <tommyw@google.com>
    233
  • trunk/Source/Platform/Platform.gypi

    r115703 r116336  
    4343            'chromium/public/WebData.h',
    4444            'chromium/public/WebExternalTextureLayer.h',
     45            'chromium/public/WebFileSystem.h',
    4546            'chromium/public/WebFilterOperation.h',
    4647            'chromium/public/WebFilterOperations.h',
  • trunk/Source/Platform/chromium/public/Platform.h

    r112846 r116336  
    4141
    4242class WebAudioBus;
     43class WebFileSystem;
    4344class WebMediaStreamCenter;
    4445class WebMediaStreamCenterClient;
     
    6970    virtual WebAudioDevice* createAudioDevice(size_t bufferSize, unsigned numberOfChannels, double sampleRate, WebAudioDevice::RenderCallback*) { return 0; }
    7071
     72
     73    // FileSystem ----------------------------------------------------------
     74
     75    // Must return non-null.
     76    virtual WebFileSystem* fileSystem() { return 0; }
    7177
    7278    // Gamepad -------------------------------------------------------------
  • trunk/Source/WebKit/chromium/ChangeLog

    r116334 r116336  
     12012-05-07  Mark Pilgrim  <pilgrim@chromium.org>
     2
     3        [Chromium] Move fileSystem to Platform.h
     4        https://bugs.webkit.org/show_bug.cgi?id=85760
     5
     6        Reviewed by Adam Barth.
     7
     8        Part of a refactoring series. See tracking bug 82948.
     9
     10        * WebKit.gyp:
     11        * public/platform/WebFileSystem.h:
     12        * public/platform/WebKitPlatformSupport.h:
     13        (WebKit):
     14        (WebKitPlatformSupport):
     15        * src/AssertMatchingEnums.cpp:
     16        * src/AsyncFileSystemChromium.cpp:
     17        (WebCore::AsyncFileSystemChromium::AsyncFileSystemChromium):
     18        * src/LocalFileSystemChromium.cpp:
     19        * src/WebFileSystemCallbacksImpl.cpp:
     20        * src/WebFileSystemCallbacksImpl.h:
     21        * src/WebFrameImpl.cpp:
     22        * src/WebWorkerClientImpl.h:
     23        * src/WorkerAsyncFileSystemChromium.cpp:
     24        * src/WorkerAsyncFileWriterChromium.cpp:
     25        * src/WorkerFileSystemCallbacksBridge.h:
     26        * src/WorkerFileWriterCallbacksBridge.cpp:
     27        (WebKit::WorkerFileWriterCallbacksBridge::initOnMainThread):
     28
    1292012-05-07  W. James MacLean  <wjmaclean@chromium.org>
    230
  • trunk/Source/WebKit/chromium/WebKit.gyp

    r115733 r116336  
    310310                'public/platform/WebDragData.h',
    311311                'public/platform/WebExternalTextureLayer.h',
    312                 'public/platform/WebFileSystem.h',
    313312                'public/platform/WebFloatPoint.h',
    314313                'public/platform/WebFloatQuad.h',
  • trunk/Source/WebKit/chromium/public/platform/WebFileSystem.h

    r112510 r116336  
    2929 */
    3030
    31 #ifndef WebFileSystem_h
    32 #define WebFileSystem_h
    33 
    34 #include "WebCommon.h"
    35 #include "WebURL.h"
    36 
    37 namespace WebKit {
    38 
    39 // FIXME: Move these classes into platform.
    40 class WebFileSystemCallbacks;
    41 class WebFileWriter;
    42 class WebFileWriterClient;
    43 
    44 class WebFileSystem {
    45 public:
    46     enum Type {
    47         TypeTemporary,
    48         TypePersistent,
    49 
    50         // Indicates an isolated filesystem which only exposes a set of files.
    51         TypeIsolated,
    52 
    53         // Indicates a non-sandboxed filesystem.
    54         TypeExternal,
    55     };
    56 
    57     // Moves a file or directory at |srcPath| to |destPath|.
    58     // WebFileSystemCallbacks::didSucceed() must be called when the operation is completed successfully.
    59     // WebFileSystemCallbacks::didFail() must be called otherwise.
    60     virtual void move(const WebURL& srcPath, const WebURL& destPath, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
    61 
    62     // Copies a file or directory at |srcPath| to |destPath|.
    63     // WebFileSystemCallbacks::didSucceed() must be called when the operation is completed successfully.
    64     // WebFileSystemCallbacks::didFail() must be called otherwise.
    65     virtual void copy(const WebURL& srcPath, const WebURL& destPath, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
    66 
    67     // Deletes a file or directory at a given |path|.
    68     // It is an error to try to remove a directory that is not empty.
    69     // WebFileSystemCallbacks::didSucceed() must be called when the operation is completed successfully.
    70     // WebFileSystemCallbacks::didFail() must be called otherwise.
    71     virtual void remove(const WebURL& path, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
    72 
    73     // Deletes a file or directory recursively at a given |path|.
    74     // WebFileSystemCallbacks::didSucceed() must be called when the operation is completed successfully.
    75     // WebFileSystemCallbacks::didFail() must be called otherwise.
    76     virtual void removeRecursively(const WebURL& path, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
    77 
    78     // Retrieves the metadata information of the file or directory at the given |path|.
    79     // This may not always return the local platform path in remote filesystem cases.
    80     // WebFileSystemCallbacks::didReadMetadata() must be called with a valid metadata when the retrieval is completed successfully.
    81     // WebFileSystemCallbacks::didFail() must be called otherwise.
    82     virtual void readMetadata(const WebURL& path, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
    83 
    84     // Creates a file at given |path|.
    85     // If the |path| doesn't exist, it creates a new file at |path|.
    86     // If |exclusive| is true, it fails if the |path| already exists.
    87     // If |exclusive| is false, it succeeds if the |path| already exists or
    88     // it has successfully created a new file at |path|.
    89     //
    90     // WebFileSystemCallbacks::didSucceed() must be called when the operation is completed successfully.
    91     // WebFileSystemCallbacks::didFail() must be called otherwise.
    92     virtual void createFile(const WebURL& path, bool exclusive, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
    93 
    94     // Creates a directory at a given |path|.
    95     // If the |path| doesn't exist, it creates a new directory at |path|.
    96     // If |exclusive| is true, it fails if the |path| already exists.
    97     // If |exclusive| is false, it succeeds if the |path| already exists or it has successfully created a new directory at |path|.
    98     //
    99     // WebFileSystemCallbacks::didSucceed() must be called when
    100     // the operation is completed successfully.
    101     // WebFileSystemCallbacks::didFail() must be called otherwise.
    102     virtual void createDirectory(const WebURL& path, bool exclusive, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
    103 
    104     // Checks if a file exists at a given |path|.
    105     // WebFileSystemCallbacks::didSucceed() must be called when the operation is completed successfully.
    106     // WebFileSystemCallbacks::didFail() must be called otherwise.
    107     virtual void fileExists(const WebURL& path, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
    108 
    109     // Checks if a directory exists at a given |path|.
    110     // WebFileSystemCallbacks::didSucceed() must be called when the operation is completed successfully.
    111     // WebFileSystemCallbacks::didFail() must be called otherwise.
    112     virtual void directoryExists(const WebURL& path, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
    113 
    114     // Reads directory entries of a given directory at |path|.
    115     // WebFileSystemCallbacks::didReadDirectory() must be called when the operation is completed successfully.
    116     // WebFileSystemCallbacks::didFail() must be called otherwise.
    117     virtual void readDirectory(const WebURL& path, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
    118 
    119     // Creates a WebFileWriter that can be used to write to the given file.
    120     // This is a fast, synchronous call, and should not stat the filesystem.
    121     virtual WebFileWriter* createFileWriter(const WebURL& path, WebFileWriterClient*) { WEBKIT_ASSERT_NOT_REACHED(); return 0; }
    122 
    123     // Creates a snapshot file for a given file specified by |path| and registers the file with the |blobURL|. It returns the metadata of the created snapshot file.
    124     // The returned metadata should include a local platform path to the snapshot image.
    125     // In local filesystem cases the backend may simply return the metadata of the file itself (as well as readMetadata does), while in remote filesystem case the backend may download the file into a temporary snapshot file and return the metadata of the temporary file.
    126     // The returned metadata is used to create a File object for the |path|.
    127     // The snapshot file is supposed to be deleted when the last reference to the |blobURL| is dropped.
    128     // WebFileSystemCallbacks::didReadMetadata() with the metadata of the snapshot file must be called when the operation is completed successfully.
    129     // WebFileSystemCallbacks::didFail() must be called otherwise.
    130     virtual void createSnapshotFileAndReadMetadata(const WebURL& blobURL, const WebURL& path, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); }
    131 
    132 protected:
    133     virtual ~WebFileSystem() { }
    134 };
    135 
    136 } // namespace WebKit
    137 
    138 #endif
     31#include "../../../../Platform/chromium/public/WebFileSystem.h"
  • trunk/Source/WebKit/chromium/public/platform/WebKitPlatformSupport.h

    r115339 r116336  
    5454class WebClipboard;
    5555class WebCookieJar;
    56 class WebFileSystem;
    5756class WebFileUtilities;
    5857class WebIDBFactory; // FIXME: Does this belong in platform?
     
    178177
    179178
    180     // FileSystem ----------------------------------------------------------
    181 
    182     // Must return non-null.
    183     virtual WebFileSystem* fileSystem() { return 0; }
    184 
    185179    // WebWorker ----------------------------------------------------------
    186180
  • trunk/Source/WebKit/chromium/src/AssertMatchingEnums.cpp

    r116280 r116336  
    101101#include "WebView.h"
    102102#include "platform/WebClipboard.h"
    103 #include "platform/WebFileSystem.h"
    104103#include "platform/WebICEOptions.h"
    105104#include "platform/WebMediaStreamSource.h"
    106105#include "platform/WebPeerConnection00Handler.h"
    107106#include "platform/WebPeerConnection00HandlerClient.h"
     107#include <public/WebFileSystem.h>
    108108#include <public/WebFilterOperation.h>
    109109#include <public/WebReferrerPolicy.h>
  • trunk/Source/WebKit/chromium/src/AsyncFileSystemChromium.cpp

    r116283 r116336  
    4343#include "WebFileWriter.h"
    4444#include "WebKit.h"
    45 #include "platform/WebFileSystem.h"
    46 #include "platform/WebKitPlatformSupport.h"
     45#include <public/Platform.h>
     46#include <public/WebFileSystem.h>
    4747#include <wtf/text/CString.h>
    4848#include <wtf/text/StringBuilder.h>
     
    132132AsyncFileSystemChromium::AsyncFileSystemChromium(FileSystemType type, const KURL& rootURL)
    133133    : AsyncFileSystem(type)
    134     , m_webFileSystem(WebKit::webKitPlatformSupport()->fileSystem())
     134    , m_webFileSystem(WebKit::Platform::current()->fileSystem())
    135135    , m_filesystemRootURL(rootURL)
    136136{
  • trunk/Source/WebKit/chromium/src/LocalFileSystemChromium.cpp

    r116283 r116336  
    4242#include "PlatformString.h"
    4343#include "WebFileError.h"
    44 #include "platform/WebFileSystem.h"
    4544#include "WebFileSystemCallbacksImpl.h"
    4645#include "WebFrameClient.h"
     
    5251#include "WorkerFileSystemCallbacksBridge.h"
    5352#include "WorkerThread.h"
     53#include <public/WebFileSystem.h>
    5454#include <wtf/Threading.h>
    5555
  • trunk/Source/WebKit/chromium/src/WebFileSystemCallbacksImpl.cpp

    r116287 r116336  
    3838#include "ScriptExecutionContext.h"
    3939#include "WebFileInfo.h"
    40 #include "platform/WebFileSystem.h"
    4140#include "WebFileSystemEntry.h"
    4241#include "platform/WebString.h"
    4342#include "WorkerAsyncFileSystemChromium.h"
     43#include <public/WebFileSystem.h>
    4444#include <wtf/Vector.h>
    4545
  • trunk/Source/WebKit/chromium/src/WebFileSystemCallbacksImpl.h

    r116283 r116336  
    3434#include "FileSystemType.h"
    3535#include "WebFileSystemCallbacks.h"
    36 #include "platform/WebFileSystem.h"
    3736#include "platform/WebVector.h"
     37#include <public/WebFileSystem.h>
    3838#include <wtf/OwnPtr.h>
    3939#include <wtf/PassOwnPtr.h>
  • trunk/Source/WebKit/chromium/src/WebFrameImpl.cpp

    r116290 r116336  
    179179#include "V8DOMFileSystem.h"
    180180#include "V8FileEntry.h"
    181 #include "platform/WebFileSystem.h"
     181#include <public/WebFileSystem.h>
    182182#endif
    183183
  • trunk/Source/WebKit/chromium/src/WebWorkerClientImpl.h

    r113138 r116336  
    4040#include "WorkerObjectProxy.h"
    4141
    42 #include "platform/WebFileSystem.h"
    4342#include "WebWorkerBase.h"
     43#include <public/WebFileSystem.h>
    4444#include <wtf/OwnPtr.h>
    4545#include <wtf/PassOwnPtr.h>
  • trunk/Source/WebKit/chromium/src/WorkerAsyncFileSystemChromium.cpp

    r116283 r116336  
    3939#include "FileSystem.h"
    4040#include "NotImplemented.h"
    41 #include "platform/WebFileSystem.h"
    4241#include "WebFileSystemCallbacksImpl.h"
    4342#include "WebFileWriter.h"
     
    5049#include "WorkerScriptController.h"
    5150#include "WorkerThread.h"
     51#include <public/WebFileSystem.h>
    5252#include <wtf/text/CString.h>
    5353
  • trunk/Source/WebKit/chromium/src/WorkerAsyncFileWriterChromium.cpp

    r102044 r116336  
    3737#include "Blob.h"
    3838#include "ScriptExecutionContext.h"
    39 #include "platform/WebFileSystem.h"
    4039#include "WebFileWriter.h"
    4140#include "platform/WebURL.h"
     
    4544#include "WorkerLoaderProxy.h"
    4645#include "WorkerThread.h"
     46#include <public/WebFileSystem.h>
    4747#include <wtf/Assertions.h>
    4848
  • trunk/Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.h

    r109324 r116336  
    3737#include "ScriptExecutionContext.h"
    3838#include "WebFileError.h"
    39 #include "platform/WebFileSystem.h"
    4039#include "platform/WebVector.h"
     40#include <public/WebFileSystem.h>
    4141#include <wtf/PassOwnPtr.h>
    4242#include <wtf/PassRefPtr.h>
  • trunk/Source/WebKit/chromium/src/WorkerFileWriterCallbacksBridge.cpp

    r102044 r116336  
    3737#include "CrossThreadTask.h"
    3838#include "platform/WebCString.h"
    39 #include "platform/WebFileSystem.h"
    4039#include "WebFileWriter.h"
    4140#include "WebKit.h"
    42 #include "platform/WebKitPlatformSupport.h"
    4341#include "WebWorkerBase.h"
    4442#include "WorkerContext.h"
    4543#include "WorkerLoaderProxy.h"
    4644#include "WorkerThread.h"
     45#include <public/Platform.h>
     46#include <public/WebFileSystem.h>
    4747#include <wtf/MainThread.h>
    4848#include <wtf/Threading.h>
     
    105105{
    106106    ASSERT(!bridge->m_writer);
    107     bridge->m_writer = adoptPtr(webKitPlatformSupport()->fileSystem()->createFileWriter(path, bridge.get()));
     107    bridge->m_writer = adoptPtr(WebKit::Platform::current()->fileSystem()->createFileWriter(path, bridge.get()));
    108108}
    109109
Note: See TracChangeset for help on using the changeset viewer.