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

Unified Diff: Source/bindings/v8/custom/V8FormDataCustom.cpp

Issue 74133005: Remove several uses of toWebCoreStringWithNullCheck(v8::Handle<v8::Value>) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 1 month 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 side-by-side diff with in-line comments
Download patch
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
« no previous file with comments | « Source/bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp ('k') | Source/bindings/v8/custom/V8HTMLFrameElementCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698