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

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

Issue 234403004: Rename V8TRYCATCH_* macros in v8/V8BindingMacros.h (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: BOOL*_BOOL -> BOOL* Created 6 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, 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2008, 2009, 2010 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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 ExceptionState exceptionState(ExceptionState::ExecutionContext, "open", "XML HttpRequest", info.Holder(), info.GetIsolate()); 163 ExceptionState exceptionState(ExceptionState::ExecutionContext, "open", "XML HttpRequest", info.Holder(), info.GetIsolate());
164 164
165 if (info.Length() < 2) { 165 if (info.Length() < 2) {
166 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, i nfo.Length())); 166 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, i nfo.Length()));
167 exceptionState.throwIfNeeded(); 167 exceptionState.throwIfNeeded();
168 return; 168 return;
169 } 169 }
170 170
171 XMLHttpRequest* xmlHttpRequest = V8XMLHttpRequest::toNative(info.Holder()); 171 XMLHttpRequest* xmlHttpRequest = V8XMLHttpRequest::toNative(info.Holder());
172 172
173 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, method, info[0]); 173 TOSTRING_VOID(V8StringResource<>, method, info[0]);
174 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, urlstring, info[1]) ; 174 TOSTRING_VOID(V8StringResource<>, urlstring, info[1]);
175 175
176 ExecutionContext* context = currentExecutionContext(info.GetIsolate()); 176 ExecutionContext* context = currentExecutionContext(info.GetIsolate());
177 KURL url = context->completeURL(urlstring); 177 KURL url = context->completeURL(urlstring);
178 178
179 if (info.Length() >= 3) { 179 if (info.Length() >= 3) {
180 bool async = info[2]->BooleanValue(); 180 bool async = info[2]->BooleanValue();
181 181
182 if (info.Length() >= 4 && !info[3]->IsUndefined()) { 182 if (info.Length() >= 4 && !info[3]->IsUndefined()) {
183 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck> , user, info[3]); 183 TOSTRING_VOID(V8StringResource<WithNullCheck>, user, info[3]);
184 184
185 if (info.Length() >= 5 && !info[4]->IsUndefined()) { 185 if (info.Length() >= 5 && !info[4]->IsUndefined()) {
186 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCh eck>, password, info[4]); 186 TOSTRING_VOID(V8StringResource<WithNullCheck>, password, info[4] );
187 xmlHttpRequest->open(method, url, async, user, password, excepti onState); 187 xmlHttpRequest->open(method, url, async, user, password, excepti onState);
188 } else { 188 } else {
189 xmlHttpRequest->open(method, url, async, user, exceptionState); 189 xmlHttpRequest->open(method, url, async, user, exceptionState);
190 } 190 }
191 } else { 191 } else {
192 xmlHttpRequest->open(method, url, async, exceptionState); 192 xmlHttpRequest->open(method, url, async, exceptionState);
193 } 193 }
194 } else { 194 } else {
195 xmlHttpRequest->open(method, url, exceptionState); 195 xmlHttpRequest->open(method, url, exceptionState);
196 } 196 }
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(arg); 236 v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(arg);
237 ArrayBuffer* arrayBuffer = V8ArrayBuffer::toNative(object); 237 ArrayBuffer* arrayBuffer = V8ArrayBuffer::toNative(object);
238 ASSERT(arrayBuffer); 238 ASSERT(arrayBuffer);
239 xmlHttpRequest->send(arrayBuffer, exceptionState); 239 xmlHttpRequest->send(arrayBuffer, exceptionState);
240 } else if (V8ArrayBufferView::hasInstance(arg, info.GetIsolate())) { 240 } else if (V8ArrayBufferView::hasInstance(arg, info.GetIsolate())) {
241 v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(arg); 241 v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(arg);
242 ArrayBufferView* arrayBufferView = V8ArrayBufferView::toNative(objec t); 242 ArrayBufferView* arrayBufferView = V8ArrayBufferView::toNative(objec t);
243 ASSERT(arrayBufferView); 243 ASSERT(arrayBufferView);
244 xmlHttpRequest->send(arrayBufferView, exceptionState); 244 xmlHttpRequest->send(arrayBufferView, exceptionState);
245 } else { 245 } else {
246 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck> , argString, arg); 246 TOSTRING_VOID(V8StringResource<WithNullCheck>, argString, arg);
247 xmlHttpRequest->send(argString, exceptionState); 247 xmlHttpRequest->send(argString, exceptionState);
248 } 248 }
249 } 249 }
250 250
251 exceptionState.throwIfNeeded(); 251 exceptionState.throwIfNeeded();
252 } 252 }
253 253
254 } // namespace WebCore 254 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/v8/custom/V8WindowCustom.cpp ('k') | Source/bindings/v8/custom/V8XSLTProcessorCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698