OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |