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

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

Issue 74133005: Remove several uses of toWebCoreStringWithNullCheck(v8::Handle<v8::Value>) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
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
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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 176
177 ExecutionContext* context = getExecutionContext(); 177 ExecutionContext* context = getExecutionContext();
178 KURL url = context->completeURL(urlstring); 178 KURL url = context->completeURL(urlstring);
179 179
180 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); 180 ExceptionState exceptionState(info.Holder(), info.GetIsolate());
181 181
182 if (info.Length() >= 3) { 182 if (info.Length() >= 3) {
183 bool async = info[2]->BooleanValue(); 183 bool async = info[2]->BooleanValue();
184 184
185 if (info.Length() >= 4 && !info[3]->IsUndefined()) { 185 if (info.Length() >= 4 && !info[3]->IsUndefined()) {
186 String user = toWebCoreStringWithNullCheck(info[3]); 186 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck> , user, info[3]);
187 187
188 if (info.Length() >= 5 && !info[4]->IsUndefined()) { 188 if (info.Length() >= 5 && !info[4]->IsUndefined()) {
189 String passwd = toWebCoreStringWithNullCheck(info[4]); 189 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCh eck>, password, info[4]);
190 xmlHttpRequest->open(method, url, async, user, passwd, exception State); 190 xmlHttpRequest->open(method, url, async, user, password, excepti onState);
191 } else { 191 } else {
192 xmlHttpRequest->open(method, url, async, user, exceptionState); 192 xmlHttpRequest->open(method, url, async, user, exceptionState);
193 } 193 }
194 } else { 194 } else {
195 xmlHttpRequest->open(method, url, async, exceptionState); 195 xmlHttpRequest->open(method, url, async, exceptionState);
196 } 196 }
197 } else { 197 } else {
198 xmlHttpRequest->open(method, url, exceptionState); 198 xmlHttpRequest->open(method, url, exceptionState);
199 } 199 }
200 200
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(arg); 240 v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(arg);
241 ArrayBuffer* arrayBuffer = V8ArrayBuffer::toNative(object); 241 ArrayBuffer* arrayBuffer = V8ArrayBuffer::toNative(object);
242 ASSERT(arrayBuffer); 242 ASSERT(arrayBuffer);
243 xmlHttpRequest->send(arrayBuffer, exceptionState); 243 xmlHttpRequest->send(arrayBuffer, exceptionState);
244 } else if (V8ArrayBufferView::hasInstance(arg, info.GetIsolate(), curren tWorldType)) { 244 } else if (V8ArrayBufferView::hasInstance(arg, info.GetIsolate(), curren tWorldType)) {
245 v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(arg); 245 v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(arg);
246 ArrayBufferView* arrayBufferView = V8ArrayBufferView::toNative(objec t); 246 ArrayBufferView* arrayBufferView = V8ArrayBufferView::toNative(objec t);
247 ASSERT(arrayBufferView); 247 ASSERT(arrayBufferView);
248 xmlHttpRequest->send(arrayBufferView, exceptionState); 248 xmlHttpRequest->send(arrayBufferView, exceptionState);
249 } else { 249 } else {
250 xmlHttpRequest->send(toWebCoreStringWithNullCheck(arg), exceptionSta te); 250 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck> , argString, arg);
251 xmlHttpRequest->send(argString, exceptionState);
251 } 252 }
252 } 253 }
253 254
254 exceptionState.throwIfNeeded(); 255 exceptionState.throwIfNeeded();
255 } 256 }
256 257
257 } // namespace WebCore 258 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698