diff options
author | dumi@chromium.org <dumi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-22 03:29:14 +0000 |
---|---|---|
committer | dumi@chromium.org <dumi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-22 03:29:14 +0000 |
commit | 5746640f419fe2b493ed4e97aa473e96f73c8d73 (patch) | |
tree | 63b222962eb9c5ea5d230d8add24fe72e6281386 /webkit/fileapi/file_system_callback_dispatcher.h | |
parent | ae236193f7b64659caf81ba2a009f8ff4e947693 (diff) | |
download | chromium_src-5746640f419fe2b493ed4e97aa473e96f73c8d73.zip chromium_src-5746640f419fe2b493ed4e97aa473e96f73c8d73.tar.gz chromium_src-5746640f419fe2b493ed4e97aa473e96f73c8d73.tar.bz2 |
Refactor some file_system classes to use chromium types instead of
WebKit API types.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/3406008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60152 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/fileapi/file_system_callback_dispatcher.h')
-rw-r--r-- | webkit/fileapi/file_system_callback_dispatcher.h | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/webkit/fileapi/file_system_callback_dispatcher.h b/webkit/fileapi/file_system_callback_dispatcher.h new file mode 100644 index 0000000..37f22c23 --- /dev/null +++ b/webkit/fileapi/file_system_callback_dispatcher.h @@ -0,0 +1,49 @@ +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef WEBKIT_FILEAPI_FILE_SYSTEM_CALLBACK_DISPATCHER_H_ +#define WEBKIT_FILEAPI_FILE_SYSTEM_CALLBACK_DISPATCHER_H_ + +#include <vector> + +#include "base/file_util_proxy.h" +#include "base/string16.h" + +namespace fileapi { + +// This class mirrors the callbacks in +// third_party/WebKit/WebKit/chromium/public/WebFileSystemCallbacks.h, +// but uses chromium types. +class FileSystemCallbackDispatcher { + public: + // Callback for various operations that don't require return values. + virtual void DidSucceed() = 0; + + // Callback to report information for a file. + virtual void DidReadMetadata(const base::PlatformFileInfo& file_info) = 0; + + // Callback to report the contents of a directory. If the contents of + // the given directory are reported in one batch, then |entries| will have + // the list of all files/directories in the given directory, |has_more| will + // be false, and this callback will be called only once. If the contents of + // the given directory are reported in multiple chunks, then this callback + // will be called multiple times, |entries| will have only a subset of + // all contents (the subsets reported in any two calls are disjoint), and + // |has_more| will be true, except for the last chunk. + virtual void DidReadDirectory( + const std::vector<base::file_util_proxy::Entry>& entries, + bool has_more) = 0; + + // Callback for opening a file system. Called with a name and root path for + // the FileSystem when the request is accepted. Used by WebFileSystem API. + virtual void DidOpenFileSystem(const string16& name, + const FilePath& root_path) = 0; + + // Called with an error code when a requested operation has failed. + virtual void DidFail(base::PlatformFileError error_code) = 0; +}; + +} // namespace fileapi + +#endif // WEBKIT_FILEAPI_FILE_SYSTEM_CALLBACK_DISPATCHER_H_ |