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

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

Issue 54283002: Rename |args| to |info| in V8 bindings (Closed) Base URL: svn://svn.chromium.org/blink/trunk
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 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 18 matching lines...) Expand all
29 */ 29 */
30 30
31 #include "config.h" 31 #include "config.h"
32 #include "V8SQLResultSetRowList.h" 32 #include "V8SQLResultSetRowList.h"
33 33
34 #include "bindings/v8/V8Binding.h" 34 #include "bindings/v8/V8Binding.h"
35 #include "modules/webdatabase/SQLResultSetRowList.h" 35 #include "modules/webdatabase/SQLResultSetRowList.h"
36 36
37 namespace WebCore { 37 namespace WebCore {
38 38
39 void V8SQLResultSetRowList::itemMethodCustom(const v8::FunctionCallbackInfo<v8:: Value>& args) 39 void V8SQLResultSetRowList::itemMethodCustom(const v8::FunctionCallbackInfo<v8:: Value>& info)
40 { 40 {
41 if (!args.Length()) { 41 if (!info.Length()) {
42 throwError(v8SyntaxError, "Item index is required.", args.GetIsolate()); 42 throwError(v8SyntaxError, "Item index is required.", info.GetIsolate());
43 return; 43 return;
44 } 44 }
45 45
46 if (!args[0]->IsNumber()) { 46 if (!info[0]->IsNumber()) {
47 throwTypeError("Item index must be a number.", args.GetIsolate()); 47 throwTypeError("Item index must be a number.", info.GetIsolate());
48 return; 48 return;
49 } 49 }
50 50
51 SQLResultSetRowList* rowList = V8SQLResultSetRowList::toNative(args.Holder() ); 51 SQLResultSetRowList* rowList = V8SQLResultSetRowList::toNative(info.Holder() );
52 52
53 unsigned long index = args[0]->IntegerValue(); 53 unsigned long index = info[0]->IntegerValue();
54 if (index >= rowList->length()) { 54 if (index >= rowList->length()) {
55 throwError(v8RangeError, "Item index is out of range.", args.GetIsolate( )); 55 throwError(v8RangeError, "Item index is out of range.", info.GetIsolate( ));
56 return; 56 return;
57 } 57 }
58 58
59 v8::Local<v8::Object> item = v8::Object::New(); 59 v8::Local<v8::Object> item = v8::Object::New();
60 unsigned numColumns = rowList->columnNames().size(); 60 unsigned numColumns = rowList->columnNames().size();
61 unsigned valuesIndex = index * numColumns; 61 unsigned valuesIndex = index * numColumns;
62 62
63 for (unsigned i = 0; i < numColumns; ++i) { 63 for (unsigned i = 0; i < numColumns; ++i) {
64 const SQLValue& sqlValue = rowList->values()[valuesIndex + i]; 64 const SQLValue& sqlValue = rowList->values()[valuesIndex + i];
65 v8::Handle<v8::Value> value; 65 v8::Handle<v8::Value> value;
66 switch(sqlValue.type()) { 66 switch(sqlValue.type()) {
67 case SQLValue::StringValue: 67 case SQLValue::StringValue:
68 value = v8String(sqlValue.string(), args.GetIsolate()); 68 value = v8String(sqlValue.string(), info.GetIsolate());
69 break; 69 break;
70 case SQLValue::NullValue: 70 case SQLValue::NullValue:
71 value = v8::Null(args.GetIsolate()); 71 value = v8::Null(info.GetIsolate());
72 break; 72 break;
73 case SQLValue::NumberValue: 73 case SQLValue::NumberValue:
74 value = v8::Number::New(args.GetIsolate(), sqlValue.number()); 74 value = v8::Number::New(info.GetIsolate(), sqlValue.number());
75 break; 75 break;
76 default: 76 default:
77 ASSERT_NOT_REACHED(); 77 ASSERT_NOT_REACHED();
78 } 78 }
79 79
80 item->Set(v8String(rowList->columnNames()[i], args.GetIsolate()), value, static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly)); 80 item->Set(v8String(rowList->columnNames()[i], info.GetIsolate()), value, static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly));
81 } 81 }
82 82
83 v8SetReturnValue(args, item); 83 v8SetReturnValue(info, item);
84 } 84 }
85 85
86 } // namespace WebCore 86 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/v8/custom/V8PromiseCustom.cpp ('k') | Source/bindings/v8/custom/V8SQLTransactionCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698