OLD | NEW |
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 |
(...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
680 } | 680 } |
681 | 681 |
682 // FIXME: According to XMLHttpRequest Level 2 we should throw InvalidAccessE
rror exception here. | 682 // FIXME: According to XMLHttpRequest Level 2 we should throw InvalidAccessE
rror exception here. |
683 // However for time being only print warning message to warn web developers. | 683 // However for time being only print warning message to warn web developers. |
684 if (!m_async) | 684 if (!m_async) |
685 UseCounter::countDeprecation(executionContext(), UseCounter::SyncXHRWith
Credentials); | 685 UseCounter::countDeprecation(executionContext(), UseCounter::SyncXHRWith
Credentials); |
686 | 686 |
687 m_includeCredentials = value; | 687 m_includeCredentials = value; |
688 } | 688 } |
689 | 689 |
690 void XMLHttpRequest::open(const AtomicString& method, const KURL& url, Exception
State& exceptionState) | 690 void XMLHttpRequest::open(const AtomicString& method, const AtomicString& url, E
xceptionState& exceptionState) |
691 { | 691 { |
692 open(method, url, true, exceptionState); | 692 open(method, url, true, exceptionState); |
693 } | 693 } |
694 | 694 |
| 695 void XMLHttpRequest::open(const AtomicString& method, const AtomicString& urlStr
ing, bool async, ExceptionState& exceptionState) |
| 696 { |
| 697 open(method, executionContext()->completeURL(urlString), async, exceptionSta
te); |
| 698 } |
| 699 |
695 void XMLHttpRequest::open(const AtomicString& method, const KURL& url, bool asyn
c, ExceptionState& exceptionState) | 700 void XMLHttpRequest::open(const AtomicString& method, const KURL& url, bool asyn
c, ExceptionState& exceptionState) |
696 { | 701 { |
697 WTF_LOG(Network, "XMLHttpRequest %p open('%s', '%s', %d)", this, method.utf8
().data(), url.elidedString().utf8().data(), async); | 702 WTF_LOG(Network, "XMLHttpRequest %p open('%s', '%s', %d)", this, method.utf8
().data(), url.elidedString().utf8().data(), async); |
698 | 703 |
699 if (!internalAbort()) | 704 if (!internalAbort()) |
700 return; | 705 return; |
701 | 706 |
702 State previousState = m_state; | 707 State previousState = m_state; |
703 m_state = UNSENT; | 708 m_state = UNSENT; |
704 m_error = false; | 709 m_error = false; |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
756 ASSERT(!m_loader); | 761 ASSERT(!m_loader); |
757 | 762 |
758 // Check previous state to avoid dispatching readyState event | 763 // Check previous state to avoid dispatching readyState event |
759 // when calling open several times in a row. | 764 // when calling open several times in a row. |
760 if (previousState != OPENED) | 765 if (previousState != OPENED) |
761 changeState(OPENED); | 766 changeState(OPENED); |
762 else | 767 else |
763 m_state = OPENED; | 768 m_state = OPENED; |
764 } | 769 } |
765 | 770 |
766 void XMLHttpRequest::open(const AtomicString& method, const KURL& url, bool asyn
c, const String& user, ExceptionState& exceptionState) | 771 void XMLHttpRequest::open(const AtomicString& method, const AtomicString& urlStr
ing, bool async, const String& user, ExceptionState& exceptionState) |
767 { | 772 { |
768 KURL urlWithCredentials(url); | 773 KURL urlWithCredentials(executionContext()->completeURL(urlString)); |
769 urlWithCredentials.setUser(user); | 774 urlWithCredentials.setUser(user); |
770 | 775 |
771 open(method, urlWithCredentials, async, exceptionState); | 776 open(method, urlWithCredentials, async, exceptionState); |
772 } | 777 } |
773 | 778 |
774 void XMLHttpRequest::open(const AtomicString& method, const KURL& url, bool asyn
c, const String& user, const String& password, ExceptionState& exceptionState) | 779 void XMLHttpRequest::open(const AtomicString& method, const AtomicString& urlStr
ing, bool async, const String& user, const String& password, ExceptionState& exc
eptionState) |
775 { | 780 { |
776 KURL urlWithCredentials(url); | 781 KURL urlWithCredentials(executionContext()->completeURL(urlString)); |
777 urlWithCredentials.setUser(user); | 782 urlWithCredentials.setUser(user); |
778 urlWithCredentials.setPass(password); | 783 urlWithCredentials.setPass(password); |
779 | 784 |
780 open(method, urlWithCredentials, async, exceptionState); | 785 open(method, urlWithCredentials, async, exceptionState); |
781 } | 786 } |
782 | 787 |
783 bool XMLHttpRequest::initSend(ExceptionState& exceptionState) | 788 bool XMLHttpRequest::initSend(ExceptionState& exceptionState) |
784 { | 789 { |
785 if (!executionContext()) | 790 if (!executionContext()) |
786 return false; | 791 return false; |
(...skipping 1079 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1866 visitor->trace(m_responseDocumentParser); | 1871 visitor->trace(m_responseDocumentParser); |
1867 visitor->trace(m_progressEventThrottle); | 1872 visitor->trace(m_progressEventThrottle); |
1868 visitor->trace(m_upload); | 1873 visitor->trace(m_upload); |
1869 visitor->trace(m_blobLoader); | 1874 visitor->trace(m_blobLoader); |
1870 XMLHttpRequestEventTarget::trace(visitor); | 1875 XMLHttpRequestEventTarget::trace(visitor); |
1871 DocumentParserClient::trace(visitor); | 1876 DocumentParserClient::trace(visitor); |
1872 ActiveDOMObject::trace(visitor); | 1877 ActiveDOMObject::trace(visitor); |
1873 } | 1878 } |
1874 | 1879 |
1875 } // namespace blink | 1880 } // namespace blink |
OLD | NEW |