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

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

Issue 20625004: XMLHttpRequest should clear the response encoding when it clears responseText. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 5 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
« no previous file with comments | « LayoutTests/http/tests/xmlhttprequest/resources/get-windows-1251.cgi ('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, 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 813 matching lines...) Expand 10 before | Expand all | Expand 10 after
824 824
825 void XMLHttpRequest::clearResponse() 825 void XMLHttpRequest::clearResponse()
826 { 826 {
827 m_response = ResourceResponse(); 827 m_response = ResourceResponse();
828 clearResponseBuffers(); 828 clearResponseBuffers();
829 } 829 }
830 830
831 void XMLHttpRequest::clearResponseBuffers() 831 void XMLHttpRequest::clearResponseBuffers()
832 { 832 {
833 m_responseText.clear(); 833 m_responseText.clear();
834 m_responseEncoding = String();
834 m_createdDocument = false; 835 m_createdDocument = false;
835 m_responseDocument = 0; 836 m_responseDocument = 0;
836 m_responseBlob = 0; 837 m_responseBlob = 0;
837 m_binaryResponseBuilder.clear(); 838 m_binaryResponseBuilder.clear();
838 m_responseArrayBuffer.clear(); 839 m_responseArrayBuffer.clear();
839 } 840 }
840 841
841 void XMLHttpRequest::clearRequest() 842 void XMLHttpRequest::clearRequest()
842 { 843 {
843 m_requestHeaders.clear(); 844 m_requestHeaders.clear();
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
1075 1076
1076 if (m_decoder) 1077 if (m_decoder)
1077 m_responseText = m_responseText.concatenateWith(m_decoder->flush()); 1078 m_responseText = m_responseText.concatenateWith(m_decoder->flush());
1078 1079
1079 InspectorInstrumentation::didFinishXHRLoading(scriptExecutionContext(), this , identifier, m_responseText, m_url, m_lastSendURL, m_lastSendLineNumber); 1080 InspectorInstrumentation::didFinishXHRLoading(scriptExecutionContext(), this , identifier, m_responseText, m_url, m_lastSendURL, m_lastSendLineNumber);
1080 1081
1081 bool hadLoader = m_loader; 1082 bool hadLoader = m_loader;
1082 m_loader = 0; 1083 m_loader = 0;
1083 1084
1084 changeState(DONE); 1085 changeState(DONE);
1086 m_responseEncoding = String();
1085 m_decoder = 0; 1087 m_decoder = 0;
1086 1088
1087 if (hadLoader) 1089 if (hadLoader)
1088 dropProtection(); 1090 dropProtection();
1089 } 1091 }
1090 1092
1091 void XMLHttpRequest::didSendData(unsigned long long bytesSent, unsigned long lon g totalBytesToBeSent) 1093 void XMLHttpRequest::didSendData(unsigned long long bytesSent, unsigned long lon g totalBytesToBeSent)
1092 { 1094 {
1093 if (!m_upload) 1095 if (!m_upload)
1094 return; 1096 return;
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
1242 { 1244 {
1243 return &m_eventTargetData; 1245 return &m_eventTargetData;
1244 } 1246 }
1245 1247
1246 EventTargetData* XMLHttpRequest::ensureEventTargetData() 1248 EventTargetData* XMLHttpRequest::ensureEventTargetData()
1247 { 1249 {
1248 return &m_eventTargetData; 1250 return &m_eventTargetData;
1249 } 1251 }
1250 1252
1251 } // namespace WebCore 1253 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/http/tests/xmlhttprequest/resources/get-windows-1251.cgi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698