| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 { | 43 { |
| 44 if (info.Length() < 2) { | 44 if (info.Length() < 2) { |
| 45 throwError(v8SyntaxError, "Not enough arguments", info.GetIsolate()); | 45 throwError(v8SyntaxError, "Not enough arguments", info.GetIsolate()); |
| 46 return; | 46 return; |
| 47 } | 47 } |
| 48 | 48 |
| 49 DOMFormData* domFormData = V8FormData::toNative(info.Holder()); | 49 DOMFormData* domFormData = V8FormData::toNative(info.Holder()); |
| 50 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, name,
info[0]); | 50 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, name,
info[0]); |
| 51 | 51 |
| 52 v8::Handle<v8::Value> arg = info[1]; | 52 v8::Handle<v8::Value> arg = info[1]; |
| 53 if (V8Blob::hasInstance(arg, info.GetIsolate(), worldType(info.GetIsolate())
)) { | 53 if (V8Blob::hasInstance(arg, info.GetIsolate())) { |
| 54 v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(arg); | 54 v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(arg); |
| 55 Blob* blob = V8Blob::toNative(object); | 55 Blob* blob = V8Blob::toNative(object); |
| 56 ASSERT(blob); | 56 ASSERT(blob); |
| 57 | 57 |
| 58 String filename; | 58 String filename; |
| 59 if (info.Length() >= 3) { | 59 if (info.Length() >= 3) { |
| 60 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithUndefinedO
rNullCheck>, filenameResource, info[2]); | 60 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithUndefinedO
rNullCheck>, filenameResource, info[2]); |
| 61 filename = filenameResource; | 61 filename = filenameResource; |
| 62 } | 62 } |
| 63 | 63 |
| 64 domFormData->append(name, blob, filename); | 64 domFormData->append(name, blob, filename); |
| 65 } else { | 65 } else { |
| 66 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, argString, arg)
; | 66 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, argString, arg)
; |
| 67 domFormData->append(name, argString); | 67 domFormData->append(name, argString); |
| 68 } | 68 } |
| 69 } | 69 } |
| 70 | 70 |
| 71 } // namespace WebCore | 71 } // namespace WebCore |
| OLD | NEW |