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

Side by Side Diff: third_party/WebKit/Source/modules/filesystem/FileSystemCallbacks.cpp

Issue 1609313002: Use BlobCallback in toBlob instead of FileCallback (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase master and Renamed mimeType to contentType to match other bits in Blob.h Created 4 years, 11 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
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 13 matching lines...) Expand all
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #include "modules/filesystem/FileSystemCallbacks.h" 31 #include "modules/filesystem/FileSystemCallbacks.h"
32 32
33 #include "core/dom/ExecutionContext.h" 33 #include "core/dom/ExecutionContext.h"
34 #include "core/fileapi/BlobCallback.h"
34 #include "core/fileapi/File.h" 35 #include "core/fileapi/File.h"
35 #include "core/fileapi/FileCallback.h"
36 #include "core/fileapi/FileError.h" 36 #include "core/fileapi/FileError.h"
37 #include "core/html/VoidCallback.h" 37 #include "core/html/VoidCallback.h"
38 #include "core/inspector/InspectorInstrumentation.h" 38 #include "core/inspector/InspectorInstrumentation.h"
39 #include "modules/filesystem/DOMFilePath.h" 39 #include "modules/filesystem/DOMFilePath.h"
40 #include "modules/filesystem/DOMFileSystem.h" 40 #include "modules/filesystem/DOMFileSystem.h"
41 #include "modules/filesystem/DOMFileSystemBase.h" 41 #include "modules/filesystem/DOMFileSystemBase.h"
42 #include "modules/filesystem/DirectoryEntry.h" 42 #include "modules/filesystem/DirectoryEntry.h"
43 #include "modules/filesystem/DirectoryReader.h" 43 #include "modules/filesystem/DirectoryReader.h"
44 #include "modules/filesystem/Entry.h" 44 #include "modules/filesystem/Entry.h"
45 #include "modules/filesystem/EntryCallback.h" 45 #include "modules/filesystem/EntryCallback.h"
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 260
261 void FileWriterBaseCallbacks::didCreateFileWriter(PassOwnPtr<WebFileWriter> file Writer, long long length) 261 void FileWriterBaseCallbacks::didCreateFileWriter(PassOwnPtr<WebFileWriter> file Writer, long long length)
262 { 262 {
263 m_fileWriter->initialize(fileWriter, length); 263 m_fileWriter->initialize(fileWriter, length);
264 if (m_successCallback) 264 if (m_successCallback)
265 handleEventOrScheduleCallback(m_successCallback.release(), m_fileWriter. release().get()); 265 handleEventOrScheduleCallback(m_successCallback.release(), m_fileWriter. release().get());
266 } 266 }
267 267
268 // SnapshotFileCallback ------------------------------------------------------- 268 // SnapshotFileCallback -------------------------------------------------------
269 269
270 PassOwnPtr<AsyncFileSystemCallbacks> SnapshotFileCallback::create(DOMFileSystemB ase* filesystem, const String& name, const KURL& url, FileCallback* successCallb ack, ErrorCallback* errorCallback, ExecutionContext* context) 270 PassOwnPtr<AsyncFileSystemCallbacks> SnapshotFileCallback::create(DOMFileSystemB ase* filesystem, const String& name, const KURL& url, BlobCallback* successCallb ack, ErrorCallback* errorCallback, ExecutionContext* context)
271 { 271 {
272 return adoptPtr(new SnapshotFileCallback(filesystem, name, url, successCallb ack, errorCallback, context)); 272 return adoptPtr(new SnapshotFileCallback(filesystem, name, url, successCallb ack, errorCallback, context));
273 } 273 }
274 274
275 SnapshotFileCallback::SnapshotFileCallback(DOMFileSystemBase* filesystem, const String& name, const KURL& url, FileCallback* successCallback, ErrorCallback* err orCallback, ExecutionContext* context) 275 SnapshotFileCallback::SnapshotFileCallback(DOMFileSystemBase* filesystem, const String& name, const KURL& url, BlobCallback* successCallback, ErrorCallback* err orCallback, ExecutionContext* context)
276 : FileSystemCallbacksBase(errorCallback, filesystem, context) 276 : FileSystemCallbacksBase(errorCallback, filesystem, context)
277 , m_name(name) 277 , m_name(name)
278 , m_url(url) 278 , m_url(url)
279 , m_successCallback(successCallback) 279 , m_successCallback(successCallback)
280 { 280 {
281 } 281 }
282 282
283 void SnapshotFileCallback::didCreateSnapshotFile(const FileMetadata& metadata, P assRefPtr<BlobDataHandle> snapshot) 283 void SnapshotFileCallback::didCreateSnapshotFile(const FileMetadata& metadata, P assRefPtr<BlobDataHandle> snapshot)
284 { 284 {
285 if (!m_successCallback) 285 if (!m_successCallback)
(...skipping 20 matching lines...) Expand all
306 { 306 {
307 } 307 }
308 308
309 void VoidCallbacks::didSucceed() 309 void VoidCallbacks::didSucceed()
310 { 310 {
311 if (m_successCallback) 311 if (m_successCallback)
312 handleEventOrScheduleCallback(m_successCallback.release()); 312 handleEventOrScheduleCallback(m_successCallback.release());
313 } 313 }
314 314
315 } // namespace blink 315 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698