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

Side by Side Diff: Source/bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp

Issue 23526039: Replace several uses of toWebCoreString() by V8TRYCATCH_FOR_V8STRINGRESOURCE() macro (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 months 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 if (namedItems.size() == 1) { 58 if (namedItems.size() == 1) {
59 v8SetReturnValueFast(callbackInfo, namedItems.at(0).release(), collectio n); 59 v8SetReturnValueFast(callbackInfo, namedItems.at(0).release(), collectio n);
60 return; 60 return;
61 } 61 }
62 62
63 v8SetReturnValueFast(callbackInfo, NamedNodesCollection::create(namedItems), collection); 63 v8SetReturnValueFast(callbackInfo, NamedNodesCollection::create(namedItems), collection);
64 } 64 }
65 65
66 void V8HTMLOptionsCollection::namedItemMethodCustom(const v8::FunctionCallbackIn fo<v8::Value>& args) 66 void V8HTMLOptionsCollection::namedItemMethodCustom(const v8::FunctionCallbackIn fo<v8::Value>& args)
67 { 67 {
68 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, name, args[0]);
68 HTMLOptionsCollection* imp = V8HTMLOptionsCollection::toNative(args.Holder() ); 69 HTMLOptionsCollection* imp = V8HTMLOptionsCollection::toNative(args.Holder() );
69 getNamedItems(imp, toWebCoreString(args[0]), args); 70 getNamedItems(imp, name, args);
70 } 71 }
71 72
72 void V8HTMLOptionsCollection::addMethodCustom(const v8::FunctionCallbackInfo<v8: :Value>& args) 73 void V8HTMLOptionsCollection::addMethodCustom(const v8::FunctionCallbackInfo<v8: :Value>& args)
73 { 74 {
74 if (!V8HTMLOptionElement::HasInstance(args[0], args.GetIsolate(), worldType( args.GetIsolate()))) { 75 if (!V8HTMLOptionElement::HasInstance(args[0], args.GetIsolate(), worldType( args.GetIsolate()))) {
75 setDOMException(TypeMismatchError, args.GetIsolate()); 76 setDOMException(TypeMismatchError, args.GetIsolate());
76 return; 77 return;
77 } 78 }
78 HTMLOptionsCollection* imp = V8HTMLOptionsCollection::toNative(args.Holder() ); 79 HTMLOptionsCollection* imp = V8HTMLOptionsCollection::toNative(args.Holder() );
79 HTMLOptionElement* option = V8HTMLOptionElement::toNative(v8::Handle<v8::Obj ect>(v8::Handle<v8::Object>::Cast(args[0]))); 80 HTMLOptionElement* option = V8HTMLOptionElement::toNative(v8::Handle<v8::Obj ect>(v8::Handle<v8::Object>::Cast(args[0])));
(...skipping 28 matching lines...) Expand all
108 newLength = static_cast<unsigned>(v); 109 newLength = static_cast<unsigned>(v);
109 } 110 }
110 111
111 if (es.throwIfNeeded()) 112 if (es.throwIfNeeded())
112 return; 113 return;
113 114
114 imp->setLength(newLength, es); 115 imp->setLength(newLength, es);
115 } 116 }
116 117
117 } // namespace WebCore 118 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698