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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/modules/filesystem/DOMFileSystemBase.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 } 139 }
140 OwnPtr<FileWriterCallback> m_callback; 140 OwnPtr<FileWriterCallback> m_callback;
141 }; 141 };
142 142
143 } 143 }
144 144
145 void DOMFileSystem::createWriter(const FileEntry* fileEntry, PassOwnPtr<FileWrit erCallback> successCallback, PassOwnPtr<ErrorCallback> errorCallback) 145 void DOMFileSystem::createWriter(const FileEntry* fileEntry, PassOwnPtr<FileWrit erCallback> successCallback, PassOwnPtr<ErrorCallback> errorCallback)
146 { 146 {
147 ASSERT(fileEntry); 147 ASSERT(fileEntry);
148 148
149 if (!fileSystem()) {
150 reportError(errorCallback, FileError::create(FileError::ABORT_ERR));
151 return;
152 }
153
149 FileWriter* fileWriter = FileWriter::create(executionContext()); 154 FileWriter* fileWriter = FileWriter::create(executionContext());
150 OwnPtr<FileWriterBaseCallback> conversionCallback = ConvertToFileWriterCallb ack::create(successCallback); 155 OwnPtr<FileWriterBaseCallback> conversionCallback = ConvertToFileWriterCallb ack::create(successCallback);
151 OwnPtr<AsyncFileSystemCallbacks> callbacks = FileWriterBaseCallbacks::create (fileWriter, conversionCallback.release(), errorCallback, m_context); 156 OwnPtr<AsyncFileSystemCallbacks> callbacks = FileWriterBaseCallbacks::create (fileWriter, conversionCallback.release(), errorCallback, m_context);
152 fileSystem()->createFileWriter(createFileSystemURL(fileEntry), fileWriter, c allbacks.release()); 157 fileSystem()->createFileWriter(createFileSystemURL(fileEntry), fileWriter, c allbacks.release());
153 } 158 }
154 159
155 void DOMFileSystem::createFile(const FileEntry* fileEntry, PassOwnPtr<FileCallba ck> successCallback, PassOwnPtr<ErrorCallback> errorCallback) 160 void DOMFileSystem::createFile(const FileEntry* fileEntry, PassOwnPtr<FileCallba ck> successCallback, PassOwnPtr<ErrorCallback> errorCallback)
156 { 161 {
157 KURL fileSystemURL = createFileSystemURL(fileEntry); 162 KURL fileSystemURL = createFileSystemURL(fileEntry);
163 if (!fileSystem()) {
164 reportError(errorCallback, FileError::create(FileError::ABORT_ERR));
165 return;
166 }
167
158 fileSystem()->createSnapshotFileAndReadMetadata(fileSystemURL, SnapshotFileC allback::create(this, fileEntry->name(), fileSystemURL, successCallback, errorCa llback, m_context)); 168 fileSystem()->createSnapshotFileAndReadMetadata(fileSystemURL, SnapshotFileC allback::create(this, fileEntry->name(), fileSystemURL, successCallback, errorCa llback, m_context));
159 } 169 }
160 170
161 } // namespace blink 171 } // namespace blink
OLDNEW
« 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