Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1245)

Unified Diff: third_party/WebKit/Source/modules/filesystem/FileSystemCallbacks.h

Issue 2297043002: Web expose FileSystemFileEntry, FileSystemDirectoryEntry and friends (Closed)
Patch Set: Rebased Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/filesystem/FileSystemCallbacks.h
diff --git a/third_party/WebKit/Source/modules/filesystem/FileSystemCallbacks.h b/third_party/WebKit/Source/modules/filesystem/FileSystemCallbacks.h
index 4f2ec8193df739a0995f19783e4811ac457bab36..69aa9f752147022ba82b40d7c609ae8a8009f2bf 100644
--- a/third_party/WebKit/Source/modules/filesystem/FileSystemCallbacks.h
+++ b/third_party/WebKit/Source/modules/filesystem/FileSystemCallbacks.h
@@ -32,7 +32,7 @@
#define FileSystemCallbacks_h
#include "core/fileapi/FileError.h"
-#include "modules/filesystem/EntriesCallback.h"
+#include "modules/filesystem/FileSystemEntriesCallback.h"
#include "platform/AsyncFileSystemCallbacks.h"
#include "platform/FileSystemType.h"
#include "wtf/Vector.h"
@@ -41,21 +41,21 @@
namespace blink {
-class DOMFileSystemBase;
-class DirectoryReaderBase;
class BlobCallback;
-class EntriesCallback;
-class EntryCallback;
class ErrorCallback;
+class ExecutionContext;
class FileMetadata;
+class FileSystemBase;
class FileSystemCallback;
+class FileSystemDirectoryReaderBase;
+class FileSystemEntriesCallback;
+class FileSystemEntryCallback;
+class FileSystemMetadataCallback;
class FileWriterBase;
class FileWriterBaseCallback;
-class MetadataCallback;
-class ExecutionContext;
class VoidCallback;
-// Passed to DOMFileSystem implementations that may report errors. Subclasses
+// Passed to FileSystem implementations that may report errors. Subclasses
// may capture the error for throwing on return to script (for synchronous APIs)
// or call an actual script callback (for asynchronous APIs).
class ErrorCallbackBase : public GarbageCollectedFinalized<ErrorCallbackBase> {
@@ -76,7 +76,7 @@ class FileSystemCallbacksBase : public AsyncFileSystemCallbacks {
protected:
FileSystemCallbacksBase(ErrorCallbackBase*,
- DOMFileSystemBase*,
+ FileSystemBase*,
ExecutionContext*);
bool shouldScheduleCallback() const;
@@ -91,14 +91,14 @@ class FileSystemCallbacksBase : public AsyncFileSystemCallbacks {
void handleEventOrScheduleCallback(CB*);
Persistent<ErrorCallbackBase> m_errorCallback;
- Persistent<DOMFileSystemBase> m_fileSystem;
+ Persistent<FileSystemBase> m_fileSystem;
Persistent<ExecutionContext> m_executionContext;
int m_asyncOperationId;
};
// Subclasses ----------------------------------------------------------------
-// Wraps a script-provided callback for use in DOMFileSystem operations.
+// Wraps a script-provided callback for use in FileSystem operations.
class ScriptErrorCallback final : public ErrorCallbackBase {
public:
static ScriptErrorCallback* wrap(ErrorCallback*);
@@ -115,22 +115,22 @@ class ScriptErrorCallback final : public ErrorCallbackBase {
class EntryCallbacks final : public FileSystemCallbacksBase {
public:
static std::unique_ptr<AsyncFileSystemCallbacks> create(
- EntryCallback*,
+ FileSystemEntryCallback*,
ErrorCallbackBase*,
ExecutionContext*,
- DOMFileSystemBase*,
+ FileSystemBase*,
const String& expectedPath,
bool isDirectory);
void didSucceed() override;
private:
- EntryCallbacks(EntryCallback*,
+ EntryCallbacks(FileSystemEntryCallback*,
ErrorCallbackBase*,
ExecutionContext*,
- DOMFileSystemBase*,
+ FileSystemBase*,
const String& expectedPath,
bool isDirectory);
- Persistent<EntryCallback> m_successCallback;
+ Persistent<FileSystemEntryCallback> m_successCallback;
String m_expectedPath;
bool m_isDirectory;
};
@@ -138,24 +138,24 @@ class EntryCallbacks final : public FileSystemCallbacksBase {
class EntriesCallbacks final : public FileSystemCallbacksBase {
public:
static std::unique_ptr<AsyncFileSystemCallbacks> create(
- EntriesCallback*,
+ FileSystemEntriesCallback*,
ErrorCallbackBase*,
ExecutionContext*,
- DirectoryReaderBase*,
+ FileSystemDirectoryReaderBase*,
const String& basePath);
void didReadDirectoryEntry(const String& name, bool isDirectory) override;
void didReadDirectoryEntries(bool hasMore) override;
private:
- EntriesCallbacks(EntriesCallback*,
+ EntriesCallbacks(FileSystemEntriesCallback*,
ErrorCallbackBase*,
ExecutionContext*,
- DirectoryReaderBase*,
+ FileSystemDirectoryReaderBase*,
const String& basePath);
- Persistent<EntriesCallback> m_successCallback;
- Persistent<DirectoryReaderBase> m_directoryReader;
+ Persistent<FileSystemEntriesCallback> m_successCallback;
+ Persistent<FileSystemDirectoryReaderBase> m_directoryReader;
String m_basePath;
- PersistentHeapVector<Member<Entry>> m_entries;
+ PersistentHeapVector<Member<FileSystemEntry>> m_entries;
};
class FileSystemCallbacks final : public FileSystemCallbacksBase {
@@ -177,9 +177,8 @@ class FileSystemCallbacks final : public FileSystemCallbacksBase {
class ResolveURICallbacks final : public FileSystemCallbacksBase {
public:
- static std::unique_ptr<AsyncFileSystemCallbacks> create(EntryCallback*,
- ErrorCallbackBase*,
- ExecutionContext*);
+ static std::unique_ptr<AsyncFileSystemCallbacks>
+ create(FileSystemEntryCallback*, ErrorCallbackBase*, ExecutionContext*);
void didResolveURL(const String& name,
const KURL& rootURL,
FileSystemType,
@@ -187,24 +186,27 @@ class ResolveURICallbacks final : public FileSystemCallbacksBase {
bool isDirectry) override;
private:
- ResolveURICallbacks(EntryCallback*, ErrorCallbackBase*, ExecutionContext*);
- Persistent<EntryCallback> m_successCallback;
+ ResolveURICallbacks(FileSystemEntryCallback*,
+ ErrorCallbackBase*,
+ ExecutionContext*);
+ Persistent<FileSystemEntryCallback> m_successCallback;
};
class MetadataCallbacks final : public FileSystemCallbacksBase {
public:
- static std::unique_ptr<AsyncFileSystemCallbacks> create(MetadataCallback*,
- ErrorCallbackBase*,
- ExecutionContext*,
- DOMFileSystemBase*);
+ static std::unique_ptr<AsyncFileSystemCallbacks> create(
+ FileSystemMetadataCallback*,
+ ErrorCallbackBase*,
+ ExecutionContext*,
+ FileSystemBase*);
void didReadMetadata(const FileMetadata&) override;
private:
- MetadataCallbacks(MetadataCallback*,
+ MetadataCallbacks(FileSystemMetadataCallback*,
ErrorCallbackBase*,
ExecutionContext*,
- DOMFileSystemBase*);
- Persistent<MetadataCallback> m_successCallback;
+ FileSystemBase*);
+ Persistent<FileSystemMetadataCallback> m_successCallback;
};
class FileWriterBaseCallbacks final : public FileSystemCallbacksBase {
@@ -228,7 +230,7 @@ class FileWriterBaseCallbacks final : public FileSystemCallbacksBase {
class SnapshotFileCallback final : public FileSystemCallbacksBase {
public:
- static std::unique_ptr<AsyncFileSystemCallbacks> create(DOMFileSystemBase*,
+ static std::unique_ptr<AsyncFileSystemCallbacks> create(FileSystemBase*,
const String& name,
const KURL&,
BlobCallback*,
@@ -238,7 +240,7 @@ class SnapshotFileCallback final : public FileSystemCallbacksBase {
PassRefPtr<BlobDataHandle> snapshot);
private:
- SnapshotFileCallback(DOMFileSystemBase*,
+ SnapshotFileCallback(FileSystemBase*,
const String& name,
const KURL&,
BlobCallback*,
@@ -254,14 +256,14 @@ class VoidCallbacks final : public FileSystemCallbacksBase {
static std::unique_ptr<AsyncFileSystemCallbacks> create(VoidCallback*,
ErrorCallbackBase*,
ExecutionContext*,
- DOMFileSystemBase*);
+ FileSystemBase*);
void didSucceed() override;
private:
VoidCallbacks(VoidCallback*,
ErrorCallbackBase*,
ExecutionContext*,
- DOMFileSystemBase*);
+ FileSystemBase*);
Persistent<VoidCallback> m_successCallback;
};

Powered by Google App Engine
This is Rietveld 408576698