Changeset 112510 in webkit
- Timestamp:
- Mar 29, 2012 2:40:41 AM (12 years ago)
- Location:
- trunk/Source
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r112506 r112510 1 2012-03-28 Kinuko Yasuda <kinuko@chromium.org> 2 3 [chromium] Add isolated filesystem type and WebDragData::filesystem_id for drag-and-drop using File/DirectoryEntry. 4 https://bugs.webkit.org/show_bug.cgi?id=76826 5 6 Add two helper methods for creating isolated filesystem to the 7 PlatformSupport interface. 8 9 Reviewed by David Levin. 10 11 No new tests: tests will be added when app-facing code is added. 12 13 * platform/chromium/PlatformSupport.h: 14 (PlatformSupport): 15 1 16 2012-03-29 Vineet Chaudhary <rgf748@motorola.com> 2 17 -
trunk/Source/WebCore/platform/chromium/PlatformSupport.h
r111258 r112510 67 67 namespace WebCore { 68 68 69 class AsyncFileSystem; 69 70 class Clipboard; 70 71 class Color; … … 147 148 static int readFromFile(PlatformFileHandle, char* data, int length); 148 149 static int writeToFile(PlatformFileHandle, const char* data, int length); 150 151 #if ENABLE(FILE_SYSTEM) 152 static String createIsolatedFileSystemName(const String& storageIdentifier, const String& filesystemId); 153 static PassOwnPtr<AsyncFileSystem> createIsolatedFileSystem(const String& originString, const String& filesystemId); 154 #endif 149 155 150 156 // Font --------------------------------------------------------------- -
trunk/Source/WebKit/chromium/ChangeLog
r112507 r112510 1 2012-03-28 Kinuko Yasuda <kinuko@chromium.org> 2 3 [chromium] Add isolated filesystem type and WebDragData::filesystem_id for drag-and-drop using File/DirectoryEntry. 4 https://bugs.webkit.org/show_bug.cgi?id=76826 5 6 As proposed on whatwg (http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2011-November/033814.html) 7 we are implementing better drag-and-drop support using File/Directory 8 Entry objects in FileSystem API, and for the purpose this patch adds 9 a new filesystem type: Isolated filesystem. 10 11 Each filesystem can be distinguished by a filesystem ID that is given 12 by chromium platform code via WebDragData when set of 13 files/directories are dropped. 14 15 This is all platform-specific implementation detail and all the changes 16 are in chromium directory. 17 18 Reviewed by David Levin. 19 20 * public/platform/WebDragData.h: 21 (WebDragData): 22 * public/platform/WebFileSystem.h: Added Isolated type. 23 * src/AsyncFileSystemChromium.cpp: 24 (WebCore::AsyncFileSystemChromium::createIsolatedFileSystemName): Added. 25 (WebCore::AsyncFileSystemChromium::createIsolatedFileSystem): Added. 26 (WebCore::AsyncFileSystemChromium::toURL): Made it not to return URL 27 for isolated filesystem (as we do not support it for now). 28 * src/AsyncFileSystemChromium.h: 29 * src/PlatformSupport.cpp: 30 (WebCore::PlatformSupport::createIsolatedFileSystem): Added. 31 * src/WebDragData.cpp: 32 (WebKit::WebDragData::filesystemId): Added. 33 (WebKit::WebDragData::setFilesystemId): Added. 34 1 35 2012-03-29 Kinuko Yasuda <kinuko@chromium.org> 2 36 -
trunk/Source/WebKit/chromium/public/platform/WebDragData.h
r108554 r112510 103 103 WEBKIT_EXPORT void addItem(const Item&); 104 104 105 WEBKIT_EXPORT WebString filesystemId() const; 106 WEBKIT_EXPORT void setFilesystemId(const WebString&); 107 105 108 #if WEBKIT_IMPLEMENTATION 106 109 WebDragData(const WTF::PassRefPtr<WebCore::ChromiumDataObject>&); -
trunk/Source/WebKit/chromium/public/platform/WebFileSystem.h
r109070 r112510 47 47 TypeTemporary, 48 48 TypePersistent, 49 50 // Indicates an isolated filesystem which only exposes a set of files. 51 TypeIsolated, 52 53 // Indicates a non-sandboxed filesystem. 49 54 TypeExternal, 50 55 }; -
trunk/Source/WebKit/chromium/src/AsyncFileSystemChromium.cpp
r109324 r112510 52 52 namespace { 53 53 54 // ChromeOS-specific filesystem type. 54 // For isolated filesystem. 55 const AsyncFileSystem::Type isolatedType = static_cast<AsyncFileSystem::Type>(WebKit::WebFileSystem::TypeIsolated); 56 const char isolatedPathPrefix[] = "isolated"; 57 58 // For external filesystem. 55 59 const AsyncFileSystem::Type externalType = static_cast<AsyncFileSystem::Type>(WebKit::WebFileSystem::TypeExternal); 56 60 const char externalPathPrefix[] = "external"; … … 162 166 } 163 167 168 // static 169 String AsyncFileSystemChromium::createIsolatedFileSystemName(const String& storageIdentifier, const String& filesystemId) 170 { 171 StringBuilder filesystemName; 172 filesystemName.append(storageIdentifier); 173 filesystemName.append(":"); 174 filesystemName.append(isolatedPathPrefix); 175 filesystemName.append("_"); 176 filesystemName.append(filesystemId); 177 return filesystemName.toString(); 178 } 179 180 // static 181 PassOwnPtr<AsyncFileSystem> AsyncFileSystemChromium::createIsolatedFileSystem(const String& originString, const String& filesystemId) 182 { 183 // The rootURL is used in succeeding filesystem requests sent to the 184 // chromium and is validated each time in the browser process. 185 StringBuilder rootURL; 186 rootURL.append("filesystem:"); 187 rootURL.append(originString); 188 rootURL.append("/"); 189 rootURL.append(isolatedPathPrefix); 190 rootURL.append("/"); 191 rootURL.append(filesystemId); 192 rootURL.append("/"); 193 194 return AsyncFileSystemChromium::create(isolatedType, KURL(ParsedURLString, rootURL.toString())); 195 } 196 164 197 AsyncFileSystemChromium::~AsyncFileSystemChromium() 165 198 { … … 170 203 ASSERT(!originString.isEmpty()); 171 204 if (originString == "null") 205 return String(); 206 207 // For now we don't support toURL for isolated filesystem (until we resolve the isolated filesystem lifetime issue). 208 if (type() == isolatedType) 172 209 return String(); 173 210 -
trunk/Source/WebKit/chromium/src/AsyncFileSystemChromium.h
r109324 r112510 53 53 } 54 54 55 static String createIsolatedFileSystemName(const String& storageIdentifier, const String& filesystemId); 56 static PassOwnPtr<AsyncFileSystem> createIsolatedFileSystem(const String& originString, const String& filesystemId); 57 55 58 virtual ~AsyncFileSystemChromium(); 56 59 -
trunk/Source/WebKit/chromium/src/PlatformSupport.cpp
r110716 r112510 87 87 #endif 88 88 89 #include "AsyncFileSystemChromium.h" 89 90 #include "BitmapImage.h" 90 91 #include "ClipboardChromium.h" … … 417 418 return webKitPlatformSupport()->fileUtilities()->writeToFile(handle, data, length); 418 419 } 420 421 #if ENABLE(FILE_SYSTEM) 422 String PlatformSupport::createIsolatedFileSystemName(const String& storageIdentifier, const String& filesystemId) 423 { 424 return AsyncFileSystemChromium::createIsolatedFileSystemName(storageIdentifier, filesystemId); 425 } 426 427 PassOwnPtr<AsyncFileSystem> PlatformSupport::createIsolatedFileSystem(const String& originString, const String& filesystemId) 428 { 429 return AsyncFileSystemChromium::createIsolatedFileSystem(originString, filesystemId); 430 } 431 #endif 419 432 420 433 // Font ----------------------------------------------------------------------- -
trunk/Source/WebKit/chromium/src/WebDragData.cpp
r112448 r112510 129 129 } 130 130 131 WebString WebDragData::filesystemId() const 132 { 133 // FIXME: Should return the ID set by setFileSystemId(). 134 return WebString(); 135 } 136 137 void WebDragData::setFilesystemId(const WebString& filesystemId) 138 { 139 // FIXME: The given value should be stored internally and is to be used 140 // to instantiate an isolated filesystem for providing FileSystem Entry 141 // access to the dragged files/directories. 142 // The ID is an opaque string, given by and validated by chromium port. 143 } 144 131 145 WebDragData::WebDragData(const WTF::PassRefPtr<WebCore::ChromiumDataObject>& data) 132 146 : m_private(static_cast<WebDragDataPrivate*>(data.leakRef()))
Note: See TracChangeset
for help on using the changeset viewer.