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

Side by Side Diff: Source/bindings/v8/custom/V8XSLTProcessorCustom.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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 44
45 #include "wtf/RefPtr.h" 45 #include "wtf/RefPtr.h"
46 46
47 namespace WebCore { 47 namespace WebCore {
48 48
49 void V8XSLTProcessor::setParameterMethodCustom(const v8::FunctionCallbackInfo<v8 ::Value>& args) 49 void V8XSLTProcessor::setParameterMethodCustom(const v8::FunctionCallbackInfo<v8 ::Value>& args)
50 { 50 {
51 if (isUndefinedOrNull(args[1]) || isUndefinedOrNull(args[2])) 51 if (isUndefinedOrNull(args[1]) || isUndefinedOrNull(args[2]))
52 return; 52 return;
53 53
54 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, namespaceURI, args[ 0]);
55 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, localName, args[1]) ;
56 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, value, args[2]);
57
54 XSLTProcessor* imp = V8XSLTProcessor::toNative(args.Holder()); 58 XSLTProcessor* imp = V8XSLTProcessor::toNative(args.Holder());
55
56 String namespaceURI = toWebCoreString(args[0]);
57 String localName = toWebCoreString(args[1]);
58 String value = toWebCoreString(args[2]);
59 imp->setParameter(namespaceURI, localName, value); 59 imp->setParameter(namespaceURI, localName, value);
60 } 60 }
61 61
62 void V8XSLTProcessor::getParameterMethodCustom(const v8::FunctionCallbackInfo<v8 ::Value>& args) 62 void V8XSLTProcessor::getParameterMethodCustom(const v8::FunctionCallbackInfo<v8 ::Value>& args)
63 { 63 {
64 if (isUndefinedOrNull(args[1])) 64 if (isUndefinedOrNull(args[1]))
65 return; 65 return;
66 66
67 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, namespaceURI, args[ 0]);
68 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, localName, args[1]) ;
69
67 XSLTProcessor* imp = V8XSLTProcessor::toNative(args.Holder()); 70 XSLTProcessor* imp = V8XSLTProcessor::toNative(args.Holder());
68
69 String namespaceURI = toWebCoreString(args[0]);
70 String localName = toWebCoreString(args[1]);
71 String result = imp->getParameter(namespaceURI, localName); 71 String result = imp->getParameter(namespaceURI, localName);
72 if (result.isNull()) 72 if (result.isNull())
73 return; 73 return;
74 74
75 v8SetReturnValueString(args, result, args.GetIsolate()); 75 v8SetReturnValueString(args, result, args.GetIsolate());
76 } 76 }
77 77
78 void V8XSLTProcessor::removeParameterMethodCustom(const v8::FunctionCallbackInfo <v8::Value>& args) 78 void V8XSLTProcessor::removeParameterMethodCustom(const v8::FunctionCallbackInfo <v8::Value>& args)
79 { 79 {
80 if (isUndefinedOrNull(args[1])) 80 if (isUndefinedOrNull(args[1]))
81 return; 81 return;
82 82
83 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, namespaceURI, args[ 0]);
84 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, localName, args[1]) ;
85
83 XSLTProcessor* imp = V8XSLTProcessor::toNative(args.Holder()); 86 XSLTProcessor* imp = V8XSLTProcessor::toNative(args.Holder());
84
85 String namespaceURI = toWebCoreString(args[0]);
86 String localName = toWebCoreString(args[1]);
87 imp->removeParameter(namespaceURI, localName); 87 imp->removeParameter(namespaceURI, localName);
88 } 88 }
89 89
90 } // namespace WebCore 90 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698