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

Side by Side Diff: Source/modules/filesystem/DOMFileSystemBase.h

Issue 103083002: Decouple FileSystem and WebSQL callbacks from VoidCallback and it non-refcounted (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 class DirectoryEntry; 47 class DirectoryEntry;
48 class DirectoryReaderBase; 48 class DirectoryReaderBase;
49 class EntriesCallback; 49 class EntriesCallback;
50 class EntryBase; 50 class EntryBase;
51 class EntryCallback; 51 class EntryCallback;
52 class ErrorCallback; 52 class ErrorCallback;
53 class FileError; 53 class FileError;
54 class MetadataCallback; 54 class MetadataCallback;
55 class ExecutionContext; 55 class ExecutionContext;
56 class SecurityOrigin; 56 class SecurityOrigin;
57 class VoidCallback; 57 class FileSystemVoidCallback;
58 58
59 // A common base class for DOMFileSystem and DOMFileSystemSync. 59 // A common base class for DOMFileSystem and DOMFileSystemSync.
60 class DOMFileSystemBase : public RefCounted<DOMFileSystemBase> { 60 class DOMFileSystemBase : public RefCounted<DOMFileSystemBase> {
61 public: 61 public:
62 enum SynchronousType { 62 enum SynchronousType {
63 Synchronous, 63 Synchronous,
64 Asynchronous, 64 Asynchronous,
65 }; 65 };
66 66
67 // Path prefixes that are used in the filesystem URLs (that can be obtained by toURL()). 67 // Path prefixes that are used in the filesystem URLs (that can be obtained by toURL()).
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 bool supportsToURL() const; 100 bool supportsToURL() const;
101 KURL createFileSystemURL(const EntryBase*) const; 101 KURL createFileSystemURL(const EntryBase*) const;
102 KURL createFileSystemURL(const String& fullPath) const; 102 KURL createFileSystemURL(const String& fullPath) const;
103 static bool pathToAbsolutePath(FileSystemType, const EntryBase*, String path , String& absolutePath); 103 static bool pathToAbsolutePath(FileSystemType, const EntryBase*, String path , String& absolutePath);
104 static bool pathPrefixToFileSystemType(const String& pathPrefix, FileSystemT ype&); 104 static bool pathPrefixToFileSystemType(const String& pathPrefix, FileSystemT ype&);
105 105
106 // Actual FileSystem API implementations. All the validity checks on virtual paths are done at this level. 106 // Actual FileSystem API implementations. All the validity checks on virtual paths are done at this level.
107 void getMetadata(const EntryBase*, PassRefPtr<MetadataCallback>, PassRefPtr< ErrorCallback>, SynchronousType = Asynchronous); 107 void getMetadata(const EntryBase*, PassRefPtr<MetadataCallback>, PassRefPtr< ErrorCallback>, SynchronousType = Asynchronous);
108 void move(const EntryBase* source, EntryBase* parent, const String& name, Pa ssRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>, SynchronousType = Asynchrono us); 108 void move(const EntryBase* source, EntryBase* parent, const String& name, Pa ssRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>, SynchronousType = Asynchrono us);
109 void copy(const EntryBase* source, EntryBase* parent, const String& name, Pa ssRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>, SynchronousType = Asynchrono us); 109 void copy(const EntryBase* source, EntryBase* parent, const String& name, Pa ssRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>, SynchronousType = Asynchrono us);
110 void remove(const EntryBase*, PassRefPtr<VoidCallback>, PassRefPtr<ErrorCall back>, SynchronousType = Asynchronous); 110 void remove(const EntryBase*, PassRefPtr<FileSystemVoidCallback>, PassRefPtr <ErrorCallback>, SynchronousType = Asynchronous);
111 void removeRecursively(const EntryBase*, PassRefPtr<VoidCallback>, PassRefPt r<ErrorCallback>, SynchronousType = Asynchronous); 111 void removeRecursively(const EntryBase*, PassRefPtr<FileSystemVoidCallback>, PassRefPtr<ErrorCallback>, SynchronousType = Asynchronous);
112 void getParent(const EntryBase*, PassRefPtr<EntryCallback>, PassRefPtr<Error Callback>); 112 void getParent(const EntryBase*, PassRefPtr<EntryCallback>, PassRefPtr<Error Callback>);
113 void getFile(const EntryBase*, const String& path, const FileSystemFlags&, P assRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>, SynchronousType = Asynchron ous); 113 void getFile(const EntryBase*, const String& path, const FileSystemFlags&, P assRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>, SynchronousType = Asynchron ous);
114 void getDirectory(const EntryBase*, const String& path, const FileSystemFlag s&, PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>, SynchronousType = Asyn chronous); 114 void getDirectory(const EntryBase*, const String& path, const FileSystemFlag s&, PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>, SynchronousType = Asyn chronous);
115 bool readDirectory(PassRefPtr<DirectoryReaderBase>, const String& path, Pass RefPtr<EntriesCallback>, PassRefPtr<ErrorCallback>, SynchronousType = Asynchrono us); 115 bool readDirectory(PassRefPtr<DirectoryReaderBase>, const String& path, Pass RefPtr<EntriesCallback>, PassRefPtr<ErrorCallback>, SynchronousType = Asynchrono us);
116 116
117 protected: 117 protected:
118 DOMFileSystemBase(ExecutionContext*, const String& name, FileSystemType, con st KURL& rootURL); 118 DOMFileSystemBase(ExecutionContext*, const String& name, FileSystemType, con st KURL& rootURL);
119 friend class DOMFileSystemSync; 119 friend class DOMFileSystemSync;
120 120
121 ExecutionContext* m_context; 121 ExecutionContext* m_context;
122 String m_name; 122 String m_name;
123 FileSystemType m_type; 123 FileSystemType m_type;
124 KURL m_filesystemRootURL; 124 KURL m_filesystemRootURL;
125 bool m_clonable; 125 bool m_clonable;
126 }; 126 };
127 127
128 inline bool operator==(const DOMFileSystemBase& a, const DOMFileSystemBase& b) { return a.name() == b.name() && a.type() == b.type() && a.rootURL() == b.rootURL (); } 128 inline bool operator==(const DOMFileSystemBase& a, const DOMFileSystemBase& b) { return a.name() == b.name() && a.type() == b.type() && a.rootURL() == b.rootURL (); }
129 129
130 } // namespace WebCore 130 } // namespace WebCore
131 131
132 #endif // DOMFileSystemBase_h 132 #endif // DOMFileSystemBase_h
OLDNEW
« no previous file with comments | « Source/core/inspector/InspectorFileSystemAgent.cpp ('k') | Source/modules/filesystem/DOMFileSystemBase.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698