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

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

Issue 23533007: Replace responseType mismatch handling code in XMLHttpRequest::responseJSONSource() with ASSERT (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
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
« no previous file with comments | « no previous file | Source/core/xml/XMLHttpRequest.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 case XMLHttpRequest::ResponseTypeDefault: 90 case XMLHttpRequest::ResponseTypeDefault:
91 case XMLHttpRequest::ResponseTypeText: 91 case XMLHttpRequest::ResponseTypeText:
92 responseTextAttributeGetterCustom(name, info); 92 responseTextAttributeGetterCustom(name, info);
93 return; 93 return;
94 94
95 case XMLHttpRequest::ResponseTypeJSON: 95 case XMLHttpRequest::ResponseTypeJSON:
96 { 96 {
97 v8::Isolate* isolate = info.GetIsolate(); 97 v8::Isolate* isolate = info.GetIsolate();
98 98
99 ExceptionState es(isolate); 99 ExceptionState es(isolate);
100 ScriptString jsonSource = xmlHttpRequest->responseJSONSource(es); 100 ScriptString jsonSource = xmlHttpRequest->responseJSONSource();
101 if (es.throwIfNeeded()) 101 if (es.throwIfNeeded())
102 return; 102 return;
103 103
104 if (jsonSource.hasNoValue() || !jsonSource.v8Value()->IsString()) { 104 if (jsonSource.hasNoValue() || !jsonSource.v8Value()->IsString()) {
105 v8SetReturnValue(info, v8NullWithCheck(isolate)); 105 v8SetReturnValue(info, v8NullWithCheck(isolate));
106 return; 106 return;
107 } 107 }
108 108
109 // Catch syntax error. 109 // Catch syntax error.
110 v8::TryCatch exceptionCatcher; 110 v8::TryCatch exceptionCatcher;
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 ASSERT(arrayBufferView); 240 ASSERT(arrayBufferView);
241 xmlHttpRequest->send(arrayBufferView, es); 241 xmlHttpRequest->send(arrayBufferView, es);
242 } else 242 } else
243 xmlHttpRequest->send(toWebCoreStringWithNullCheck(arg), es); 243 xmlHttpRequest->send(toWebCoreStringWithNullCheck(arg), es);
244 } 244 }
245 245
246 es.throwIfNeeded(); 246 es.throwIfNeeded();
247 } 247 }
248 248
249 } // namespace WebCore 249 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | Source/core/xml/XMLHttpRequest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698