*/
#include "config.h"
-#include "V8XMLHttpRequest.h"
+#include "bindings/core/v8/V8XMLHttpRequest.h"
-#include "V8Blob.h"
-#include "V8Document.h"
-#include "V8FormData.h"
-#include "V8HTMLDocument.h"
-#include "V8Stream.h"
+#include "bindings/core/v8/V8Blob.h"
+#include "bindings/core/v8/V8Document.h"
+#include "bindings/core/v8/V8FormData.h"
+#include "bindings/core/v8/V8HTMLDocument.h"
+#include "bindings/core/v8/V8Stream.h"
#include "bindings/v8/ExceptionMessages.h"
#include "bindings/v8/ExceptionState.h"
#include "bindings/v8/V8Binding.h"
-#include "bindings/v8/V8Utilities.h"
#include "bindings/v8/custom/V8ArrayBufferCustom.h"
#include "bindings/v8/custom/V8ArrayBufferViewCustom.h"
#include "core/dom/Document.h"
RefPtr<SecurityOrigin> securityOrigin;
if (context->isDocument()) {
- DOMWrapperWorld* world = DOMWrapperWorld::current(info.GetIsolate());
- if (world->isIsolatedWorld())
- securityOrigin = world->isolatedWorldSecurityOrigin();
+ DOMWrapperWorld& world = DOMWrapperWorld::current(info.GetIsolate());
+ if (world.isIsolatedWorld())
+ securityOrigin = world.isolatedWorldSecurityOrigin();
}
- RefPtr<XMLHttpRequest> xmlHttpRequest = XMLHttpRequest::create(context, securityOrigin);
+ RefPtrWillBeRawPtr<XMLHttpRequest> xmlHttpRequest = XMLHttpRequest::create(context, securityOrigin);
v8::Handle<v8::Object> wrapper = info.Holder();
V8DOMWrapper::associateObjectWithWrapper<V8XMLHttpRequest>(xmlHttpRequest.release(), &wrapperTypeInfo, wrapper, info.GetIsolate(), WrapperConfiguration::Dependent);
{
XMLHttpRequest* xmlHttpRequest = V8XMLHttpRequest::toNative(info.Holder());
ExceptionState exceptionState(ExceptionState::GetterContext, "responseText", "XMLHttpRequest", info.Holder(), info.GetIsolate());
- ScriptValue text = xmlHttpRequest->responseText(exceptionState);
+ ScriptString text = xmlHttpRequest->responseText(exceptionState);
if (exceptionState.throwIfNeeded())
return;
- if (text.hasNoValue()) {
+ if (text.isEmpty()) {
v8SetReturnValueString(info, emptyString(), info.GetIsolate());
return;
}
v8::Isolate* isolate = info.GetIsolate();
ScriptString jsonSource = xmlHttpRequest->responseJSONSource();
- if (jsonSource.hasNoValue() || !jsonSource.v8Value()->IsString()) {
+ if (jsonSource.isEmpty()) {
v8SetReturnValue(info, v8::Null(isolate));
return;
}
// Catch syntax error.
v8::TryCatch exceptionCatcher;
-
- v8::Handle<v8::Value> json = v8::JSON::Parse(jsonSource.v8Value().As<v8::String>());
-
+ v8::Handle<v8::Value> json = v8::JSON::Parse(jsonSource.v8Value());
if (exceptionCatcher.HasCaught() || json.IsEmpty())
v8SetReturnValue(info, v8::Null(isolate));
else
v8SetReturnValue(info, json);
-
return;
}
XMLHttpRequest* xmlHttpRequest = V8XMLHttpRequest::toNative(info.Holder());
- V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, method, info[0]);
- V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, urlstring, info[1]);
+ TOSTRING_VOID(V8StringResource<>, method, info[0]);
+ TOSTRING_VOID(V8StringResource<>, urlstring, info[1]);
ExecutionContext* context = currentExecutionContext(info.GetIsolate());
KURL url = context->completeURL(urlstring);
bool async = info[2]->BooleanValue();
if (info.Length() >= 4 && !info[3]->IsUndefined()) {
- V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, user, info[3]);
+ TOSTRING_VOID(V8StringResource<WithNullCheck>, user, info[3]);
if (info.Length() >= 5 && !info[4]->IsUndefined()) {
- V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, password, info[4]);
+ TOSTRING_VOID(V8StringResource<WithNullCheck>, password, info[4]);
xmlHttpRequest->open(method, url, async, user, password, exceptionState);
} else {
xmlHttpRequest->open(method, url, async, user, exceptionState);
ASSERT(arrayBufferView);
xmlHttpRequest->send(arrayBufferView, exceptionState);
} else {
- V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, argString, arg);
+ TOSTRING_VOID(V8StringResource<WithNullCheck>, argString, arg);
xmlHttpRequest->send(argString, exceptionState);
}
}