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

Unified Diff: Source/modules/filesystem/DOMFileSystem.cpp

Issue 461543002: [FileAPI] Check Platform availablity before using it in DOMFileSystem (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: move fileSystem() check above Created 6 years, 4 months 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
« no previous file with comments | « no previous file | Source/modules/filesystem/DOMFileSystemBase.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/filesystem/DOMFileSystem.cpp
diff --git a/Source/modules/filesystem/DOMFileSystem.cpp b/Source/modules/filesystem/DOMFileSystem.cpp
index fb312ed1406dc8d79ab25080aa609b29b493c936..94a35385c4751740a0efd4f2f2916ad451c9f091 100644
--- a/Source/modules/filesystem/DOMFileSystem.cpp
+++ b/Source/modules/filesystem/DOMFileSystem.cpp
@@ -146,6 +146,11 @@ void DOMFileSystem::createWriter(const FileEntry* fileEntry, PassOwnPtr<FileWrit
{
ASSERT(fileEntry);
+ if (!fileSystem()) {
+ reportError(errorCallback, FileError::create(FileError::ABORT_ERR));
+ return;
+ }
+
FileWriter* fileWriter = FileWriter::create(executionContext());
OwnPtr<FileWriterBaseCallback> conversionCallback = ConvertToFileWriterCallback::create(successCallback);
OwnPtr<AsyncFileSystemCallbacks> callbacks = FileWriterBaseCallbacks::create(fileWriter, conversionCallback.release(), errorCallback, m_context);
@@ -155,6 +160,11 @@ void DOMFileSystem::createWriter(const FileEntry* fileEntry, PassOwnPtr<FileWrit
void DOMFileSystem::createFile(const FileEntry* fileEntry, PassOwnPtr<FileCallback> successCallback, PassOwnPtr<ErrorCallback> errorCallback)
{
KURL fileSystemURL = createFileSystemURL(fileEntry);
+ if (!fileSystem()) {
+ reportError(errorCallback, FileError::create(FileError::ABORT_ERR));
+ return;
+ }
+
fileSystem()->createSnapshotFileAndReadMetadata(fileSystemURL, SnapshotFileCallback::create(this, fileEntry->name(), fileSystemURL, successCallback, errorCallback, m_context));
}
« no previous file with comments | « no previous file | Source/modules/filesystem/DOMFileSystemBase.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698