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

Side by Side Diff: Source/core/xmlhttprequest/XMLHttpRequest.cpp

Issue 1040073002: [bindings] Remove XMLHttpRequest CustomConstructor (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added spec link Created 5 years, 8 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2006, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2006, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2005-2007 Alexey Proskuryakov <ap@webkit.org> 3 * Copyright (C) 2005-2007 Alexey Proskuryakov <ap@webkit.org>
4 * Copyright (C) 2007, 2008 Julien Chaffraix <jchaffraix@webkit.org> 4 * Copyright (C) 2007, 2008 Julien Chaffraix <jchaffraix@webkit.org>
5 * Copyright (C) 2008, 2011 Google Inc. All rights reserved. 5 * Copyright (C) 2008, 2011 Google Inc. All rights reserved.
6 * Copyright (C) 2012 Intel Corporation 6 * Copyright (C) 2012 Intel Corporation
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public 9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version. 11 * version 2 of the License, or (at your option) any later version.
12 * 12 *
13 * This library is distributed in the hope that it will be useful, 13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details. 16 * Lesser General Public License for more details.
17 * 17 *
18 * You should have received a copy of the GNU Lesser General Public 18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software 19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 U SA 20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 U SA
21 */ 21 */
22 22
23 #include "config.h" 23 #include "config.h"
24 #include "core/xmlhttprequest/XMLHttpRequest.h" 24 #include "core/xmlhttprequest/XMLHttpRequest.h"
25 25
yhirano 2015/03/31 06:41:56 +bindings/core/v8/DOMWrapperWorld.h
26 #include "bindings/core/v8/ExceptionState.h" 26 #include "bindings/core/v8/ExceptionState.h"
yhirano 2015/03/31 06:41:56 +bindings/core/v8/ScriptState.h
27 #include "bindings/core/v8/UnionTypesCore.h" 27 #include "bindings/core/v8/UnionTypesCore.h"
28 #include "core/dom/ContextFeatures.h" 28 #include "core/dom/ContextFeatures.h"
29 #include "core/dom/DOMArrayBuffer.h" 29 #include "core/dom/DOMArrayBuffer.h"
30 #include "core/dom/DOMArrayBufferView.h" 30 #include "core/dom/DOMArrayBufferView.h"
31 #include "core/dom/DOMException.h" 31 #include "core/dom/DOMException.h"
32 #include "core/dom/DOMImplementation.h" 32 #include "core/dom/DOMImplementation.h"
33 #include "core/dom/DOMTypedArray.h" 33 #include "core/dom/DOMTypedArray.h"
34 #include "core/dom/DocumentParser.h" 34 #include "core/dom/DocumentParser.h"
35 #include "core/dom/ExceptionCode.h" 35 #include "core/dom/ExceptionCode.h"
36 #include "core/dom/XMLDocument.h" 36 #include "core/dom/XMLDocument.h"
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 : m_xhr(xhr) 310 : m_xhr(xhr)
311 , m_loader(FileReaderLoader::ReadByClient, this) 311 , m_loader(FileReaderLoader::ReadByClient, this)
312 { 312 {
313 m_loader.start(m_xhr->executionContext(), handle); 313 m_loader.start(m_xhr->executionContext(), handle);
314 } 314 }
315 315
316 RawPtrWillBeMember<XMLHttpRequest> m_xhr; 316 RawPtrWillBeMember<XMLHttpRequest> m_xhr;
317 FileReaderLoader m_loader; 317 FileReaderLoader m_loader;
318 }; 318 };
319 319
320 PassRefPtrWillBeRawPtr<XMLHttpRequest> XMLHttpRequest::create(ExecutionContext* context, PassRefPtr<SecurityOrigin> securityOrigin) 320 PassRefPtrWillBeRawPtr<XMLHttpRequest> XMLHttpRequest::create(ScriptState* scrip tState)
321 { 321 {
322 RefPtr<SecurityOrigin> securityOrigin;
323 ExecutionContext* context = scriptState->executionContext();
324 if (context->isDocument()) {
325 DOMWrapperWorld& world = scriptState->world();
326 securityOrigin = world.isIsolatedWorld() ? world.isolatedWorldSecurityOr igin() : nullptr;
327 }
322 RefPtrWillBeRawPtr<XMLHttpRequest> xmlHttpRequest = adoptRefWillBeNoop(new X MLHttpRequest(context, securityOrigin)); 328 RefPtrWillBeRawPtr<XMLHttpRequest> xmlHttpRequest = adoptRefWillBeNoop(new X MLHttpRequest(context, securityOrigin));
323 xmlHttpRequest->suspendIfNeeded(); 329 xmlHttpRequest->suspendIfNeeded();
324 330
325 return xmlHttpRequest.release(); 331 return xmlHttpRequest.release();
326 } 332 }
327 333
334 PassRefPtrWillBeRawPtr<XMLHttpRequest> XMLHttpRequest::create(ExecutionContext* context)
335 {
336 RefPtrWillBeRawPtr<XMLHttpRequest> xmlHttpRequest = adoptRefWillBeNoop(new X MLHttpRequest(context, nullptr));
337 xmlHttpRequest->suspendIfNeeded();
338
339 return xmlHttpRequest.release();
340 }
341
328 XMLHttpRequest::XMLHttpRequest(ExecutionContext* context, PassRefPtr<SecurityOri gin> securityOrigin) 342 XMLHttpRequest::XMLHttpRequest(ExecutionContext* context, PassRefPtr<SecurityOri gin> securityOrigin)
329 : ActiveDOMObject(context) 343 : ActiveDOMObject(context)
330 , m_timeoutMilliseconds(0) 344 , m_timeoutMilliseconds(0)
331 , m_loaderIdentifier(0) 345 , m_loaderIdentifier(0)
332 , m_state(UNSENT) 346 , m_state(UNSENT)
333 , m_lengthDownloadedToFile(0) 347 , m_lengthDownloadedToFile(0)
334 , m_receivedLength(0) 348 , m_receivedLength(0)
335 , m_exceptionCode(0) 349 , m_exceptionCode(0)
336 , m_progressEventThrottle(this) 350 , m_progressEventThrottle(this)
337 , m_responseTypeCode(ResponseTypeDefault) 351 , m_responseTypeCode(ResponseTypeDefault)
(...skipping 1536 matching lines...) Expand 10 before | Expand all | Expand 10 after
1874 visitor->trace(m_responseDocumentParser); 1888 visitor->trace(m_responseDocumentParser);
1875 visitor->trace(m_progressEventThrottle); 1889 visitor->trace(m_progressEventThrottle);
1876 visitor->trace(m_upload); 1890 visitor->trace(m_upload);
1877 visitor->trace(m_blobLoader); 1891 visitor->trace(m_blobLoader);
1878 XMLHttpRequestEventTarget::trace(visitor); 1892 XMLHttpRequestEventTarget::trace(visitor);
1879 DocumentParserClient::trace(visitor); 1893 DocumentParserClient::trace(visitor);
1880 ActiveDOMObject::trace(visitor); 1894 ActiveDOMObject::trace(visitor);
1881 } 1895 }
1882 1896
1883 } // namespace blink 1897 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/xmlhttprequest/XMLHttpRequest.h ('k') | Source/core/xmlhttprequest/XMLHttpRequest.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698