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

Side by Side Diff: third_party/WebKit/WebCore/bindings/v8/custom/V8XMLHttpRequestCustom.cpp

Issue 67225: Use null for default value of event handler attributes in XMLHttpRequest.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 8 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) 2008, 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2008, 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 61
62 ACCESSOR_GETTER(XMLHttpRequestOnabort) 62 ACCESSOR_GETTER(XMLHttpRequestOnabort)
63 { 63 {
64 INC_STATS("DOM.XMLHttpRequest.onabort._get"); 64 INC_STATS("DOM.XMLHttpRequest.onabort._get");
65 XMLHttpRequest* xmlHttpRequest = V8Proxy::ToNativeObject<XMLHttpRequest>(V8C lassIndex::XMLHTTPREQUEST, info.Holder()); 65 XMLHttpRequest* xmlHttpRequest = V8Proxy::ToNativeObject<XMLHttpRequest>(V8C lassIndex::XMLHTTPREQUEST, info.Holder());
66 if (xmlHttpRequest->onabort()) { 66 if (xmlHttpRequest->onabort()) {
67 V8ObjectEventListener* listener = static_cast<V8ObjectEventListener*>(xm lHttpRequest->onabort()); 67 V8ObjectEventListener* listener = static_cast<V8ObjectEventListener*>(xm lHttpRequest->onabort());
68 v8::Local<v8::Object> v8Listener = listener->getListenerObject(); 68 v8::Local<v8::Object> v8Listener = listener->getListenerObject();
69 return v8Listener; 69 return v8Listener;
70 } 70 }
71 return v8::Undefined(); 71 return v8::Null();
72 } 72 }
73 73
74 ACCESSOR_SETTER(XMLHttpRequestOnabort) 74 ACCESSOR_SETTER(XMLHttpRequestOnabort)
75 { 75 {
76 INC_STATS("DOM.XMLHttpRequest.onabort._set"); 76 INC_STATS("DOM.XMLHttpRequest.onabort._set");
77 XMLHttpRequest* xmlHttpRequest = V8Proxy::ToNativeObject<XMLHttpRequest>(V8C lassIndex::XMLHTTPREQUEST, info.Holder()); 77 XMLHttpRequest* xmlHttpRequest = V8Proxy::ToNativeObject<XMLHttpRequest>(V8C lassIndex::XMLHTTPREQUEST, info.Holder());
78 if (value->IsNull()) { 78 if (value->IsNull()) {
79 if (xmlHttpRequest->onabort()) { 79 if (xmlHttpRequest->onabort()) {
80 V8ObjectEventListener* listener = static_cast<V8ObjectEventListener* >(xmlHttpRequest->onabort()); 80 V8ObjectEventListener* listener = static_cast<V8ObjectEventListener* >(xmlHttpRequest->onabort());
81 v8::Local<v8::Object> v8Listener = listener->getListenerObject(); 81 v8::Local<v8::Object> v8Listener = listener->getListenerObject();
(...skipping 13 matching lines...) Expand all
95 95
96 ACCESSOR_GETTER(XMLHttpRequestOnerror) 96 ACCESSOR_GETTER(XMLHttpRequestOnerror)
97 { 97 {
98 INC_STATS("DOM.XMLHttpRequest.onerror._get"); 98 INC_STATS("DOM.XMLHttpRequest.onerror._get");
99 XMLHttpRequest* xmlHttpRequest = V8Proxy::ToNativeObject<XMLHttpRequest>(V8C lassIndex::XMLHTTPREQUEST, info.Holder()); 99 XMLHttpRequest* xmlHttpRequest = V8Proxy::ToNativeObject<XMLHttpRequest>(V8C lassIndex::XMLHTTPREQUEST, info.Holder());
100 if (xmlHttpRequest->onerror()) { 100 if (xmlHttpRequest->onerror()) {
101 RefPtr<V8ObjectEventListener> listener = static_cast<V8ObjectEventListen er*>(xmlHttpRequest->onerror()); 101 RefPtr<V8ObjectEventListener> listener = static_cast<V8ObjectEventListen er*>(xmlHttpRequest->onerror());
102 v8::Local<v8::Object> v8Listener = listener->getListenerObject(); 102 v8::Local<v8::Object> v8Listener = listener->getListenerObject();
103 return v8Listener; 103 return v8Listener;
104 } 104 }
105 return v8::Undefined(); 105 return v8::Null();
106 } 106 }
107 107
108 ACCESSOR_SETTER(XMLHttpRequestOnerror) 108 ACCESSOR_SETTER(XMLHttpRequestOnerror)
109 { 109 {
110 INC_STATS("DOM.XMLHttpRequest.onerror._set"); 110 INC_STATS("DOM.XMLHttpRequest.onerror._set");
111 XMLHttpRequest* xmlHttpRequest = V8Proxy::ToNativeObject<XMLHttpRequest>(V8C lassIndex::XMLHTTPREQUEST, info.Holder()); 111 XMLHttpRequest* xmlHttpRequest = V8Proxy::ToNativeObject<XMLHttpRequest>(V8C lassIndex::XMLHTTPREQUEST, info.Holder());
112 if (value->IsNull()) { 112 if (value->IsNull()) {
113 if (xmlHttpRequest->onerror()) { 113 if (xmlHttpRequest->onerror()) {
114 V8ObjectEventListener* listener = static_cast<V8ObjectEventListener* >(xmlHttpRequest->onerror()); 114 V8ObjectEventListener* listener = static_cast<V8ObjectEventListener* >(xmlHttpRequest->onerror());
115 v8::Local<v8::Object> v8Listener = listener->getListenerObject(); 115 v8::Local<v8::Object> v8Listener = listener->getListenerObject();
(...skipping 13 matching lines...) Expand all
129 129
130 ACCESSOR_GETTER(XMLHttpRequestOnload) 130 ACCESSOR_GETTER(XMLHttpRequestOnload)
131 { 131 {
132 INC_STATS("DOM.XMLHttpRequest.onload._get"); 132 INC_STATS("DOM.XMLHttpRequest.onload._get");
133 XMLHttpRequest* xmlHttpRequest = V8Proxy::ToNativeObject<XMLHttpRequest>(V8C lassIndex::XMLHTTPREQUEST, info.Holder()); 133 XMLHttpRequest* xmlHttpRequest = V8Proxy::ToNativeObject<XMLHttpRequest>(V8C lassIndex::XMLHTTPREQUEST, info.Holder());
134 if (xmlHttpRequest->onload()) { 134 if (xmlHttpRequest->onload()) {
135 V8ObjectEventListener* listener = static_cast<V8ObjectEventListener*>(xm lHttpRequest->onload()); 135 V8ObjectEventListener* listener = static_cast<V8ObjectEventListener*>(xm lHttpRequest->onload());
136 v8::Local<v8::Object> v8Listener = listener->getListenerObject(); 136 v8::Local<v8::Object> v8Listener = listener->getListenerObject();
137 return v8Listener; 137 return v8Listener;
138 } 138 }
139 return v8::Undefined(); 139 return v8::Null();
140 } 140 }
141 141
142 ACCESSOR_SETTER(XMLHttpRequestOnload) 142 ACCESSOR_SETTER(XMLHttpRequestOnload)
143 { 143 {
144 INC_STATS("DOM.XMLHttpRequest.onload._set"); 144 INC_STATS("DOM.XMLHttpRequest.onload._set");
145 XMLHttpRequest* xmlHttpRequest = V8Proxy::ToNativeObject<XMLHttpRequest>(V8C lassIndex::XMLHTTPREQUEST, info.Holder()); 145 XMLHttpRequest* xmlHttpRequest = V8Proxy::ToNativeObject<XMLHttpRequest>(V8C lassIndex::XMLHTTPREQUEST, info.Holder());
146 if (value->IsNull()) { 146 if (value->IsNull()) {
147 if (xmlHttpRequest->onload()) { 147 if (xmlHttpRequest->onload()) {
148 V8ObjectEventListener* listener = static_cast<V8ObjectEventListener* >(xmlHttpRequest->onload()); 148 V8ObjectEventListener* listener = static_cast<V8ObjectEventListener* >(xmlHttpRequest->onload());
149 v8::Local<v8::Object> v8Listener = listener->getListenerObject(); 149 v8::Local<v8::Object> v8Listener = listener->getListenerObject();
(...skipping 13 matching lines...) Expand all
163 163
164 ACCESSOR_GETTER(XMLHttpRequestOnloadstart) 164 ACCESSOR_GETTER(XMLHttpRequestOnloadstart)
165 { 165 {
166 INC_STATS("DOM.XMLHttpRequest.onloadstart._get"); 166 INC_STATS("DOM.XMLHttpRequest.onloadstart._get");
167 XMLHttpRequest* xmlHttpRequest = V8Proxy::ToNativeObject<XMLHttpRequest>(V8C lassIndex::XMLHTTPREQUEST, info.Holder()); 167 XMLHttpRequest* xmlHttpRequest = V8Proxy::ToNativeObject<XMLHttpRequest>(V8C lassIndex::XMLHTTPREQUEST, info.Holder());
168 if (xmlHttpRequest->onloadstart()) { 168 if (xmlHttpRequest->onloadstart()) {
169 V8ObjectEventListener* listener = static_cast<V8ObjectEventListener*>(xm lHttpRequest->onloadstart()); 169 V8ObjectEventListener* listener = static_cast<V8ObjectEventListener*>(xm lHttpRequest->onloadstart());
170 v8::Local<v8::Object> v8Listener = listener->getListenerObject(); 170 v8::Local<v8::Object> v8Listener = listener->getListenerObject();
171 return v8Listener; 171 return v8Listener;
172 } 172 }
173 return v8::Undefined(); 173 return v8::Null();
174 } 174 }
175 175
176 ACCESSOR_SETTER(XMLHttpRequestOnloadstart) 176 ACCESSOR_SETTER(XMLHttpRequestOnloadstart)
177 { 177 {
178 INC_STATS("DOM.XMLHttpRequest.onloadstart._set"); 178 INC_STATS("DOM.XMLHttpRequest.onloadstart._set");
179 XMLHttpRequest* xmlHttpRequest = V8Proxy::ToNativeObject<XMLHttpRequest>(V8C lassIndex::XMLHTTPREQUEST, info.Holder()); 179 XMLHttpRequest* xmlHttpRequest = V8Proxy::ToNativeObject<XMLHttpRequest>(V8C lassIndex::XMLHTTPREQUEST, info.Holder());
180 if (value->IsNull()) { 180 if (value->IsNull()) {
181 if (xmlHttpRequest->onloadstart()) { 181 if (xmlHttpRequest->onloadstart()) {
182 V8ObjectEventListener* listener = static_cast<V8ObjectEventListener* >(xmlHttpRequest->onloadstart()); 182 V8ObjectEventListener* listener = static_cast<V8ObjectEventListener* >(xmlHttpRequest->onloadstart());
183 v8::Local<v8::Object> v8Listener = listener->getListenerObject(); 183 v8::Local<v8::Object> v8Listener = listener->getListenerObject();
(...skipping 13 matching lines...) Expand all
197 197
198 ACCESSOR_GETTER(XMLHttpRequestOnprogress) 198 ACCESSOR_GETTER(XMLHttpRequestOnprogress)
199 { 199 {
200 INC_STATS("DOM.XMLHttpRequest.onprogress._get"); 200 INC_STATS("DOM.XMLHttpRequest.onprogress._get");
201 XMLHttpRequest* xmlHttpRequest = V8Proxy::ToNativeObject<XMLHttpRequest>(V8C lassIndex::XMLHTTPREQUEST, info.Holder()); 201 XMLHttpRequest* xmlHttpRequest = V8Proxy::ToNativeObject<XMLHttpRequest>(V8C lassIndex::XMLHTTPREQUEST, info.Holder());
202 if (xmlHttpRequest->onprogress()) { 202 if (xmlHttpRequest->onprogress()) {
203 V8ObjectEventListener* listener = static_cast<V8ObjectEventListener*>(xm lHttpRequest->onprogress()); 203 V8ObjectEventListener* listener = static_cast<V8ObjectEventListener*>(xm lHttpRequest->onprogress());
204 v8::Local<v8::Object> v8Listener = listener->getListenerObject(); 204 v8::Local<v8::Object> v8Listener = listener->getListenerObject();
205 return v8Listener; 205 return v8Listener;
206 } 206 }
207 return v8::Undefined(); 207 return v8::Null();
208 } 208 }
209 209
210 ACCESSOR_SETTER(XMLHttpRequestOnprogress) 210 ACCESSOR_SETTER(XMLHttpRequestOnprogress)
211 { 211 {
212 INC_STATS("DOM.XMLHttpRequest.onprogress._set"); 212 INC_STATS("DOM.XMLHttpRequest.onprogress._set");
213 XMLHttpRequest* xmlHttpRequest = V8Proxy::ToNativeObject<XMLHttpRequest>(V8C lassIndex::XMLHTTPREQUEST, info.Holder()); 213 XMLHttpRequest* xmlHttpRequest = V8Proxy::ToNativeObject<XMLHttpRequest>(V8C lassIndex::XMLHTTPREQUEST, info.Holder());
214 if (value->IsNull()) { 214 if (value->IsNull()) {
215 if (xmlHttpRequest->onprogress()) { 215 if (xmlHttpRequest->onprogress()) {
216 V8ObjectEventListener* listener = static_cast<V8ObjectEventListener* >(xmlHttpRequest->onprogress()); 216 V8ObjectEventListener* listener = static_cast<V8ObjectEventListener* >(xmlHttpRequest->onprogress());
217 v8::Local<v8::Object> v8Listener = listener->getListenerObject(); 217 v8::Local<v8::Object> v8Listener = listener->getListenerObject();
(...skipping 13 matching lines...) Expand all
231 231
232 ACCESSOR_GETTER(XMLHttpRequestOnreadystatechange) 232 ACCESSOR_GETTER(XMLHttpRequestOnreadystatechange)
233 { 233 {
234 INC_STATS("DOM.XMLHttpRequest.onreadystatechange._get"); 234 INC_STATS("DOM.XMLHttpRequest.onreadystatechange._get");
235 XMLHttpRequest* xmlHttpRequest = V8Proxy::ToNativeObject<XMLHttpRequest>(V8C lassIndex::XMLHTTPREQUEST, info.Holder()); 235 XMLHttpRequest* xmlHttpRequest = V8Proxy::ToNativeObject<XMLHttpRequest>(V8C lassIndex::XMLHTTPREQUEST, info.Holder());
236 if (xmlHttpRequest->onreadystatechange()) { 236 if (xmlHttpRequest->onreadystatechange()) {
237 V8ObjectEventListener* listener = static_cast<V8ObjectEventListener*>(xm lHttpRequest->onreadystatechange()); 237 V8ObjectEventListener* listener = static_cast<V8ObjectEventListener*>(xm lHttpRequest->onreadystatechange());
238 v8::Local<v8::Object> v8Listener = listener->getListenerObject(); 238 v8::Local<v8::Object> v8Listener = listener->getListenerObject();
239 return v8Listener; 239 return v8Listener;
240 } 240 }
241 return v8::Undefined(); 241 return v8::Null();
242 } 242 }
243 243
244 ACCESSOR_SETTER(XMLHttpRequestOnreadystatechange) 244 ACCESSOR_SETTER(XMLHttpRequestOnreadystatechange)
245 { 245 {
246 INC_STATS("DOM.XMLHttpRequest.onreadystatechange._set"); 246 INC_STATS("DOM.XMLHttpRequest.onreadystatechange._set");
247 XMLHttpRequest* xmlHttpRequest = V8Proxy::ToNativeObject<XMLHttpRequest>(V8C lassIndex::XMLHTTPREQUEST, info.Holder()); 247 XMLHttpRequest* xmlHttpRequest = V8Proxy::ToNativeObject<XMLHttpRequest>(V8C lassIndex::XMLHTTPREQUEST, info.Holder());
248 if (value->IsNull()) { 248 if (value->IsNull()) {
249 if (xmlHttpRequest->onreadystatechange()) { 249 if (xmlHttpRequest->onreadystatechange()) {
250 V8ObjectEventListener* listener = static_cast<V8ObjectEventListener* >(xmlHttpRequest->onreadystatechange()); 250 V8ObjectEventListener* listener = static_cast<V8ObjectEventListener* >(xmlHttpRequest->onreadystatechange());
251 v8::Local<v8::Object> v8Listener = listener->getListenerObject(); 251 v8::Local<v8::Object> v8Listener = listener->getListenerObject();
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 xmlHttpRequest->overrideMimeType(value); 425 xmlHttpRequest->overrideMimeType(value);
426 return v8::Undefined(); 426 return v8::Undefined();
427 } 427 }
428 428
429 CALLBACK_FUNC_DECL(XMLHttpRequestDispatchEvent) 429 CALLBACK_FUNC_DECL(XMLHttpRequestDispatchEvent)
430 { 430 {
431 INC_STATS("DOM.XMLHttpRequest.dispatchEvent()"); 431 INC_STATS("DOM.XMLHttpRequest.dispatchEvent()");
432 return v8::Undefined(); 432 return v8::Undefined();
433 } 433 }
434 434
435 } // namespace WebCore 435 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698