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

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

Issue 15877002: move constructors to new style callbacks (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebased Created 7 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/bindings/v8/custom/V8MutationObserverCustom.cpp ('k') | no next file » | 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 #include "bindings/v8/custom/V8ArrayBufferCustom.h" 42 #include "bindings/v8/custom/V8ArrayBufferCustom.h"
43 #include "core/dom/Document.h" 43 #include "core/dom/Document.h"
44 #include "core/inspector/InspectorInstrumentation.h" 44 #include "core/inspector/InspectorInstrumentation.h"
45 #include "core/page/Frame.h" 45 #include "core/page/Frame.h"
46 #include "core/workers/WorkerContext.h" 46 #include "core/workers/WorkerContext.h"
47 #include "core/xml/XMLHttpRequest.h" 47 #include "core/xml/XMLHttpRequest.h"
48 #include "wtf/ArrayBuffer.h" 48 #include "wtf/ArrayBuffer.h"
49 49
50 namespace WebCore { 50 namespace WebCore {
51 51
52 v8::Handle<v8::Value> V8XMLHttpRequest::constructorCustom(const v8::Arguments& a rgs) 52 void V8XMLHttpRequest::constructorCustom(const v8::FunctionCallbackInfo<v8::Valu e>& args)
53 { 53 {
54 ScriptExecutionContext* context = getScriptExecutionContext(); 54 ScriptExecutionContext* context = getScriptExecutionContext();
55 55
56 RefPtr<SecurityOrigin> securityOrigin; 56 RefPtr<SecurityOrigin> securityOrigin;
57 if (context->isDocument()) { 57 if (context->isDocument()) {
58 if (DOMWrapperWorld* world = isolatedWorldForEnteredContext()) 58 if (DOMWrapperWorld* world = isolatedWorldForEnteredContext())
59 securityOrigin = world->isolatedWorldSecurityOrigin(); 59 securityOrigin = world->isolatedWorldSecurityOrigin();
60 } 60 }
61 61
62 RefPtr<XMLHttpRequest> xmlHttpRequest = XMLHttpRequest::create(context, secu rityOrigin); 62 RefPtr<XMLHttpRequest> xmlHttpRequest = XMLHttpRequest::create(context, secu rityOrigin);
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 return wrapper; 66 args.GetReturnValue().Set(wrapper);
67 } 67 }
68 68
69 v8::Handle<v8::Value> V8XMLHttpRequest::responseTextAttrGetterCustom(v8::Local<v 8::String> name, const v8::AccessorInfo& info) 69 v8::Handle<v8::Value> V8XMLHttpRequest::responseTextAttrGetterCustom(v8::Local<v 8::String> name, const v8::AccessorInfo& 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 const String& text = xmlHttpRequest->responseText(ec);
74 if (ec) 74 if (ec)
75 return setDOMException(ec, info.GetIsolate()); 75 return setDOMException(ec, info.GetIsolate());
76 return v8String(text, info.GetIsolate()); 76 return v8String(text, info.GetIsolate());
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 xmlHttpRequest->send(toWebCoreStringWithNullCheck(arg), ec); 212 xmlHttpRequest->send(toWebCoreStringWithNullCheck(arg), ec);
213 } 213 }
214 214
215 if (ec) 215 if (ec)
216 return setDOMException(ec, args.GetIsolate()); 216 return setDOMException(ec, args.GetIsolate());
217 217
218 return v8::Undefined(); 218 return v8::Undefined();
219 } 219 }
220 220
221 } // namespace WebCore 221 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/v8/custom/V8MutationObserverCustom.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698