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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 | 54 |
55 RefPtr<SecurityOrigin> securityOrigin; | 55 RefPtr<SecurityOrigin> securityOrigin; |
56 if (context->isDocument()) { | 56 if (context->isDocument()) { |
57 if (DOMWrapperWorld* world = isolatedWorldForEnteredContext()) | 57 if (DOMWrapperWorld* world = isolatedWorldForEnteredContext()) |
58 securityOrigin = world->isolatedWorldSecurityOrigin(); | 58 securityOrigin = world->isolatedWorldSecurityOrigin(); |
59 } | 59 } |
60 | 60 |
61 RefPtr<XMLHttpRequest> xmlHttpRequest = XMLHttpRequest::create(context, secu
rityOrigin); | 61 RefPtr<XMLHttpRequest> xmlHttpRequest = XMLHttpRequest::create(context, secu
rityOrigin); |
62 | 62 |
63 v8::Handle<v8::Object> wrapper = args.Holder(); | 63 v8::Handle<v8::Object> wrapper = args.Holder(); |
64 V8DOMWrapper::associateObjectWithWrapper(xmlHttpRequest.release(), &info, wr
apper, args.GetIsolate(), WrapperConfiguration::Dependent); | 64 V8DOMWrapper::associateObjectWithWrapper<V8XMLHttpRequest>(xmlHttpRequest.re
lease(), &info, wrapper, args.GetIsolate(), WrapperConfiguration::Dependent); |
65 args.GetReturnValue().Set(wrapper); | 65 args.GetReturnValue().Set(wrapper); |
66 } | 66 } |
67 | 67 |
68 void V8XMLHttpRequest::responseTextAttrGetterCustom(v8::Local<v8::String> name,
const v8::PropertyCallbackInfo<v8::Value>& info) | 68 void V8XMLHttpRequest::responseTextAttrGetterCustom(v8::Local<v8::String> name,
const v8::PropertyCallbackInfo<v8::Value>& info) |
69 { | 69 { |
70 XMLHttpRequest* xmlHttpRequest = V8XMLHttpRequest::toNative(info.Holder()); | 70 XMLHttpRequest* xmlHttpRequest = V8XMLHttpRequest::toNative(info.Holder()); |
71 ExceptionCode ec = 0; | 71 ExceptionCode ec = 0; |
72 ScriptValue text = xmlHttpRequest->responseText(ec); | 72 ScriptValue text = xmlHttpRequest->responseText(ec); |
73 if (ec) { | 73 if (ec) { |
74 setDOMException(ec, info.GetIsolate()); | 74 setDOMException(ec, info.GetIsolate()); |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 xmlHttpRequest->send(toWebCoreStringWithNullCheck(arg), ec); | 226 xmlHttpRequest->send(toWebCoreStringWithNullCheck(arg), ec); |
227 } | 227 } |
228 | 228 |
229 if (!ec) | 229 if (!ec) |
230 return; | 230 return; |
231 | 231 |
232 setDOMException(ec, args.GetIsolate()); | 232 setDOMException(ec, args.GetIsolate()); |
233 } | 233 } |
234 | 234 |
235 } // namespace WebCore | 235 } // namespace WebCore |
OLD | NEW |