| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 } | 53 } |
| 54 | 54 |
| 55 V8BlobCustomHelpers::ParsedProperties properties(false); | 55 V8BlobCustomHelpers::ParsedProperties properties(false); |
| 56 if (info.Length() > 1) { | 56 if (info.Length() > 1) { |
| 57 if (!info[1]->IsObject()) { | 57 if (!info[1]->IsObject()) { |
| 58 exceptionState.throwTypeError("The 2nd argument is not of type Objec
t."); | 58 exceptionState.throwTypeError("The 2nd argument is not of type Objec
t."); |
| 59 exceptionState.throwIfNeeded(); | 59 exceptionState.throwIfNeeded(); |
| 60 return; | 60 return; |
| 61 } | 61 } |
| 62 | 62 |
| 63 if (!properties.parseBlobPropertyBag(info[1], "Blob", exceptionState, in
fo.GetIsolate())) { | 63 if (!properties.parseBlobPropertyBag(info.GetIsolate(), info[1], "Blob",
exceptionState)) { |
| 64 exceptionState.throwIfNeeded(); | 64 exceptionState.throwIfNeeded(); |
| 65 return; | 65 return; |
| 66 } | 66 } |
| 67 } | 67 } |
| 68 | 68 |
| 69 OwnPtr<BlobData> blobData = BlobData::create(); | 69 OwnPtr<BlobData> blobData = BlobData::create(); |
| 70 blobData->setContentType(properties.contentType()); | 70 blobData->setContentType(properties.contentType()); |
| 71 if (!V8BlobCustomHelpers::processBlobParts(v8::Local<v8::Object>::Cast(info[
0]), properties.normalizeLineEndingsToNative(), *blobData, info.GetIsolate())) | 71 if (!V8BlobCustomHelpers::processBlobParts(info.GetIsolate(), v8::Local<v8::
Object>::Cast(info[0]), properties.normalizeLineEndingsToNative(), *blobData)) |
| 72 return; | 72 return; |
| 73 | 73 |
| 74 long long blobSize = blobData->length(); | 74 long long blobSize = blobData->length(); |
| 75 Blob* blob = Blob::create(BlobDataHandle::create(blobData.release(), blobSiz
e)); | 75 Blob* blob = Blob::create(BlobDataHandle::create(blobData.release(), blobSiz
e)); |
| 76 v8SetReturnValue(info, blob); | 76 v8SetReturnValue(info, blob); |
| 77 } | 77 } |
| 78 | 78 |
| 79 } // namespace blink | 79 } // namespace blink |
| OLD | NEW |