| OLD | NEW |
| 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 23 matching lines...) Expand all Loading... |
| 34 #include "bindings/v8/ExceptionState.h" | 34 #include "bindings/v8/ExceptionState.h" |
| 35 #include "core/dom/ExceptionCode.h" | 35 #include "core/dom/ExceptionCode.h" |
| 36 #include "core/fileapi/Blob.h" | 36 #include "core/fileapi/Blob.h" |
| 37 #include "core/fileapi/FileError.h" | 37 #include "core/fileapi/FileError.h" |
| 38 #include "core/fileapi/FileReaderLoader.h" | 38 #include "core/fileapi/FileReaderLoader.h" |
| 39 #include "wtf/ArrayBuffer.h" | 39 #include "wtf/ArrayBuffer.h" |
| 40 #include "wtf/PassRefPtr.h" | 40 #include "wtf/PassRefPtr.h" |
| 41 | 41 |
| 42 namespace WebCore { | 42 namespace WebCore { |
| 43 | 43 |
| 44 DEFINE_GC_INFO(FileReaderSync); |
| 45 |
| 44 FileReaderSync::FileReaderSync() | 46 FileReaderSync::FileReaderSync() |
| 45 { | 47 { |
| 46 ScriptWrappable::init(this); | 48 ScriptWrappable::init(this); |
| 47 } | 49 } |
| 48 | 50 |
| 49 PassRefPtr<ArrayBuffer> FileReaderSync::readAsArrayBuffer(ExecutionContext* exec
utionContext, Blob* blob, ExceptionState& exceptionState) | 51 PassRefPtr<ArrayBuffer> FileReaderSync::readAsArrayBuffer(ExecutionContext* exec
utionContext, Blob* blob, ExceptionState& exceptionState) |
| 50 { | 52 { |
| 51 if (!blob) { | 53 if (!blob) { |
| 52 exceptionState.throwDOMException(NotFoundError, FileError::notFoundError
Message); | 54 exceptionState.throwDOMException(NotFoundError, FileError::notFoundError
Message); |
| 53 return nullptr; | 55 return nullptr; |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 } | 100 } |
| 99 | 101 |
| 100 void FileReaderSync::startLoading(ExecutionContext* executionContext, FileReader
Loader& loader, const Blob& blob, ExceptionState& exceptionState) | 102 void FileReaderSync::startLoading(ExecutionContext* executionContext, FileReader
Loader& loader, const Blob& blob, ExceptionState& exceptionState) |
| 101 { | 103 { |
| 102 loader.start(executionContext, blob.blobDataHandle()); | 104 loader.start(executionContext, blob.blobDataHandle()); |
| 103 if (loader.errorCode()) | 105 if (loader.errorCode()) |
| 104 FileError::throwDOMException(exceptionState, loader.errorCode()); | 106 FileError::throwDOMException(exceptionState, loader.errorCode()); |
| 105 } | 107 } |
| 106 | 108 |
| 107 } // namespace WebCore | 109 } // namespace WebCore |
| OLD | NEW |