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

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

Issue 18808004: Refactoring: Extract DocumentInit for capture Document construction parameter. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed webkit_unit_tests build failure. 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/svg/SVGDocument.cpp ('k') | Source/core/xml/XSLTProcessor.cpp » ('j') | 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 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 bool isHTML = equalIgnoringCase(responseMIMEType(), "text/html"); 237 bool isHTML = equalIgnoringCase(responseMIMEType(), "text/html");
238 238
239 // The W3C spec requires the final MIME type to be some valid XML type, or text/html. 239 // The W3C spec requires the final MIME type to be some valid XML type, or text/html.
240 // If it is text/html, then the responseType of "document" must have bee n supplied explicitly. 240 // If it is text/html, then the responseType of "document" must have bee n supplied explicitly.
241 if ((m_response.isHTTP() && !responseIsXML() && !isHTML) 241 if ((m_response.isHTTP() && !responseIsXML() && !isHTML)
242 || (isHTML && m_responseTypeCode == ResponseTypeDefault) 242 || (isHTML && m_responseTypeCode == ResponseTypeDefault)
243 || scriptExecutionContext()->isWorkerGlobalScope()) { 243 || scriptExecutionContext()->isWorkerGlobalScope()) {
244 m_responseDocument = 0; 244 m_responseDocument = 0;
245 } else { 245 } else {
246 if (isHTML) 246 if (isHTML)
247 m_responseDocument = HTMLDocument::create(0, m_url); 247 m_responseDocument = HTMLDocument::create(DocumentInit(m_url));
248 else 248 else
249 m_responseDocument = Document::create(0, m_url); 249 m_responseDocument = Document::create(DocumentInit(m_url));
250 // FIXME: Set Last-Modified. 250 // FIXME: Set Last-Modified.
251 m_responseDocument->setContent(m_responseText.flattenToString()); 251 m_responseDocument->setContent(m_responseText.flattenToString());
252 m_responseDocument->setSecurityOrigin(securityOrigin()); 252 m_responseDocument->setSecurityOrigin(securityOrigin());
253 m_responseDocument->setContextFeatures(document()->contextFeatures() ); 253 m_responseDocument->setContextFeatures(document()->contextFeatures() );
254 if (!m_responseDocument->wellFormed()) 254 if (!m_responseDocument->wellFormed())
255 m_responseDocument = 0; 255 m_responseDocument = 0;
256 } 256 }
257 m_createdDocument = true; 257 m_createdDocument = true;
258 } 258 }
259 259
(...skipping 1009 matching lines...) Expand 10 before | Expand all | Expand 10 after
1269 info.addMember(m_responseDocument, "responseDocument"); 1269 info.addMember(m_responseDocument, "responseDocument");
1270 info.addMember(m_binaryResponseBuilder, "binaryResponseBuilder"); 1270 info.addMember(m_binaryResponseBuilder, "binaryResponseBuilder");
1271 info.addMember(m_responseArrayBuffer, "responseArrayBuffer"); 1271 info.addMember(m_responseArrayBuffer, "responseArrayBuffer");
1272 info.addMember(m_lastSendURL, "lastSendURL"); 1272 info.addMember(m_lastSendURL, "lastSendURL");
1273 info.addMember(m_eventTargetData, "eventTargetData"); 1273 info.addMember(m_eventTargetData, "eventTargetData");
1274 info.addMember(m_progressEventThrottle, "progressEventThrottle"); 1274 info.addMember(m_progressEventThrottle, "progressEventThrottle");
1275 info.addMember(m_securityOrigin, "securityOrigin"); 1275 info.addMember(m_securityOrigin, "securityOrigin");
1276 } 1276 }
1277 1277
1278 } // namespace WebCore 1278 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/svg/SVGDocument.cpp ('k') | Source/core/xml/XSLTProcessor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698