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

Side by Side Diff: WebCore/xml/XMLHttpRequest.cpp

Issue 5569001: Merge 72866 - Add send(ArrayBuffer) to XMLHttpRequest per XMLHttpRequest Leve... (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/597/
Patch Set: Created 10 years 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
« no previous file with comments | « WebCore/xml/XMLHttpRequest.h ('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) 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 David Levin <levin@chromium.org> 5 * Copyright (C) 2008 David Levin <levin@chromium.org>
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public 8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after
579 if (contentType.isEmpty()) { 579 if (contentType.isEmpty()) {
580 contentType = "multipart/form-data; boundary="; 580 contentType = "multipart/form-data; boundary=";
581 contentType += m_requestEntityBody->boundary().data(); 581 contentType += m_requestEntityBody->boundary().data();
582 setRequestHeaderInternal("Content-Type", contentType); 582 setRequestHeaderInternal("Content-Type", contentType);
583 } 583 }
584 } 584 }
585 585
586 createRequest(ec); 586 createRequest(ec);
587 } 587 }
588 588
589 #if ENABLE(3D_CANVAS) || ENABLE(BLOB)
590 void XMLHttpRequest::send(ArrayBuffer* body, ExceptionCode& ec)
591 {
592 if (!initSend(ec))
593 return;
594
595 if (m_method != "GET" && m_method != "HEAD" && m_url.protocolInHTTPFamily()) {
596 m_requestEntityBody = FormData::create(body->data(), body->byteLength()) ;
597 if (m_upload)
598 m_requestEntityBody->setAlwaysStream(true);
599 }
600
601 createRequest(ec);
602 }
603 #endif
604
589 void XMLHttpRequest::createRequest(ExceptionCode& ec) 605 void XMLHttpRequest::createRequest(ExceptionCode& ec)
590 { 606 {
591 #if ENABLE(BLOB) 607 #if ENABLE(BLOB)
592 // Only GET request is supported for blob URL. 608 // Only GET request is supported for blob URL.
593 if (m_url.protocolIs("blob") && m_method != "GET") { 609 if (m_url.protocolIs("blob") && m_method != "GET") {
594 ec = XMLHttpRequestException::NETWORK_ERR; 610 ec = XMLHttpRequestException::NETWORK_ERR;
595 return; 611 return;
596 } 612 }
597 #endif 613 #endif
598 614
(...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after
1122 { 1138 {
1123 return &m_eventTargetData; 1139 return &m_eventTargetData;
1124 } 1140 }
1125 1141
1126 EventTargetData* XMLHttpRequest::ensureEventTargetData() 1142 EventTargetData* XMLHttpRequest::ensureEventTargetData()
1127 { 1143 {
1128 return &m_eventTargetData; 1144 return &m_eventTargetData;
1129 } 1145 }
1130 1146
1131 } // namespace WebCore 1147 } // namespace WebCore
OLDNEW
« no previous file with comments | « WebCore/xml/XMLHttpRequest.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698