Chromium Code Reviews| Index: Source/bindings/v8/custom/V8FormDataCustom.cpp |
| diff --git a/Source/bindings/v8/custom/V8FormDataCustom.cpp b/Source/bindings/v8/custom/V8FormDataCustom.cpp |
| index 99608c6f2ee5e2958465279ab27a8b76017dc022..890bf0347892d33b635639b07184d8cc3e9981a0 100644 |
| --- a/Source/bindings/v8/custom/V8FormDataCustom.cpp |
| +++ b/Source/bindings/v8/custom/V8FormDataCustom.cpp |
| @@ -47,8 +47,7 @@ void V8FormData::appendMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& i |
| } |
| DOMFormData* domFormData = V8FormData::toNative(info.Holder()); |
| - |
| - String name = toWebCoreStringWithNullCheck(info[0]); |
| + V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, name, info[0]); |
| v8::Handle<v8::Value> arg = info[1]; |
| if (V8Blob::hasInstance(arg, info.GetIsolate(), worldType(info.GetIsolate()))) { |
| @@ -57,12 +56,16 @@ void V8FormData::appendMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& i |
| ASSERT(blob); |
| String filename; |
| - if (info.Length() >= 3 && !info[2]->IsUndefined()) |
| - filename = toWebCoreStringWithNullCheck(info[2]); |
| + if (info.Length() >= 3) { |
| + V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithUndefinedOrNullCheck>, filenameResource, info[2]); |
|
haraken
2013/11/15 22:20:15
Not related to your CL, it looks inconsistent that
Inactive
2013/11/15 22:30:25
Only the last argument is optional, doesn't it mak
haraken
2013/11/15 22:33:39
Makes sense. Thanks for the clarification!
|
| + filename = filenameResource; |
| + } |
| domFormData->append(name, blob, filename); |
| - } else |
| - domFormData->append(name, toWebCoreStringWithNullCheck(arg)); |
| + } else { |
| + V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, argString, arg); |
| + domFormData->append(name, argString); |
| + } |
| } |
| } // namespace WebCore |