| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 | 63 |
| 64 v8::Handle<v8::Object> wrapper = args.Holder(); | 64 v8::Handle<v8::Object> wrapper = args.Holder(); |
| 65 V8DOMWrapper::associateObjectWithWrapper(xmlHttpRequest.release(), &info, wr
apper, args.GetIsolate(), WrapperConfiguration::Dependent); | 65 V8DOMWrapper::associateObjectWithWrapper(xmlHttpRequest.release(), &info, wr
apper, args.GetIsolate(), WrapperConfiguration::Dependent); |
| 66 args.GetReturnValue().Set(wrapper); | 66 args.GetReturnValue().Set(wrapper); |
| 67 } | 67 } |
| 68 | 68 |
| 69 void V8XMLHttpRequest::responseTextAttrGetterCustom(v8::Local<v8::String> name,
const v8::PropertyCallbackInfo<v8::Value>& info) | 69 void V8XMLHttpRequest::responseTextAttrGetterCustom(v8::Local<v8::String> name,
const v8::PropertyCallbackInfo<v8::Value>& info) |
| 70 { | 70 { |
| 71 XMLHttpRequest* xmlHttpRequest = V8XMLHttpRequest::toNative(info.Holder()); | 71 XMLHttpRequest* xmlHttpRequest = V8XMLHttpRequest::toNative(info.Holder()); |
| 72 ExceptionCode ec = 0; | 72 ExceptionCode ec = 0; |
| 73 const String& text = xmlHttpRequest->responseText(ec); | 73 ScriptValue text = xmlHttpRequest->responseText(ec); |
| 74 if (ec) { | 74 if (ec) { |
| 75 setDOMException(ec, info.GetIsolate()); | 75 setDOMException(ec, info.GetIsolate()); |
| 76 return; | 76 return; |
| 77 } | 77 } |
| 78 v8SetReturnValue(info, v8String(text, info.GetIsolate())); | 78 if (text.hasNoValue()) { |
| 79 v8SetReturnValue(info, v8String(emptyString(), info.GetIsolate())); |
| 80 return; |
| 81 } |
| 82 v8SetReturnValue(info, text.v8Value()); |
| 79 } | 83 } |
| 80 | 84 |
| 81 void V8XMLHttpRequest::responseAttrGetterCustom(v8::Local<v8::String> name, cons
t v8::PropertyCallbackInfo<v8::Value>& info) | 85 void V8XMLHttpRequest::responseAttrGetterCustom(v8::Local<v8::String> name, cons
t v8::PropertyCallbackInfo<v8::Value>& info) |
| 82 { | 86 { |
| 83 XMLHttpRequest* xmlHttpRequest = V8XMLHttpRequest::toNative(info.Holder()); | 87 XMLHttpRequest* xmlHttpRequest = V8XMLHttpRequest::toNative(info.Holder()); |
| 84 | 88 |
| 85 switch (xmlHttpRequest->responseTypeCode()) { | 89 switch (xmlHttpRequest->responseTypeCode()) { |
| 86 case XMLHttpRequest::ResponseTypeDefault: | 90 case XMLHttpRequest::ResponseTypeDefault: |
| 87 case XMLHttpRequest::ResponseTypeText: | 91 case XMLHttpRequest::ResponseTypeText: |
| 88 responseTextAttrGetterCustom(name, info); | 92 responseTextAttrGetterCustom(name, info); |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 xmlHttpRequest->send(toWebCoreStringWithNullCheck(arg), ec); | 227 xmlHttpRequest->send(toWebCoreStringWithNullCheck(arg), ec); |
| 224 } | 228 } |
| 225 | 229 |
| 226 if (!ec) | 230 if (!ec) |
| 227 return; | 231 return; |
| 228 | 232 |
| 229 setDOMException(ec, args.GetIsolate()); | 233 setDOMException(ec, args.GetIsolate()); |
| 230 } | 234 } |
| 231 | 235 |
| 232 } // namespace WebCore | 236 } // namespace WebCore |
| OLD | NEW |