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

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

Issue 360233005: Replace 'ResourceRequest::TargetType' with 'ResourceRequest::RequestContext'. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Uninitialized === crash. :( Created 6 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/workers/WorkerScriptLoader.cpp ('k') | Source/platform/exported/WebURLRequest.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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 #include "core/xml/XMLHttpRequestUpload.h" 48 #include "core/xml/XMLHttpRequestUpload.h"
49 #include "platform/Logging.h" 49 #include "platform/Logging.h"
50 #include "platform/RuntimeEnabledFeatures.h" 50 #include "platform/RuntimeEnabledFeatures.h"
51 #include "platform/SharedBuffer.h" 51 #include "platform/SharedBuffer.h"
52 #include "platform/blob/BlobData.h" 52 #include "platform/blob/BlobData.h"
53 #include "platform/network/HTTPParsers.h" 53 #include "platform/network/HTTPParsers.h"
54 #include "platform/network/ParsedContentType.h" 54 #include "platform/network/ParsedContentType.h"
55 #include "platform/network/ResourceError.h" 55 #include "platform/network/ResourceError.h"
56 #include "platform/network/ResourceRequest.h" 56 #include "platform/network/ResourceRequest.h"
57 #include "public/platform/Platform.h" 57 #include "public/platform/Platform.h"
58 #include "public/platform/WebURLRequest.h"
58 #include "wtf/ArrayBuffer.h" 59 #include "wtf/ArrayBuffer.h"
59 #include "wtf/ArrayBufferView.h" 60 #include "wtf/ArrayBufferView.h"
60 #include "wtf/Assertions.h" 61 #include "wtf/Assertions.h"
61 #include "wtf/RefCountedLeakCounter.h" 62 #include "wtf/RefCountedLeakCounter.h"
62 #include "wtf/StdLibExtras.h" 63 #include "wtf/StdLibExtras.h"
63 #include "wtf/text/CString.h" 64 #include "wtf/text/CString.h"
64 65
65 namespace WebCore { 66 namespace WebCore {
66 67
67 DEFINE_DEBUG_ONLY_GLOBAL(WTF::RefCountedLeakCounter, xmlHttpRequestCounter, ("XM LHttpRequest")); 68 DEFINE_DEBUG_ONLY_GLOBAL(WTF::RefCountedLeakCounter, xmlHttpRequestCounter, ("XM LHttpRequest"));
(...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after
830 831
831 // We also remember whether upload events should be allowed for this request in case the upload listeners are 832 // We also remember whether upload events should be allowed for this request in case the upload listeners are
832 // added after the request is started. 833 // added after the request is started.
833 m_uploadEventsAllowed = m_sameOriginRequest || uploadEvents || !isSimpleCros sOriginAccessRequest(m_method, m_requestHeaders); 834 m_uploadEventsAllowed = m_sameOriginRequest || uploadEvents || !isSimpleCros sOriginAccessRequest(m_method, m_requestHeaders);
834 835
835 ASSERT(executionContext()); 836 ASSERT(executionContext());
836 ExecutionContext& executionContext = *this->executionContext(); 837 ExecutionContext& executionContext = *this->executionContext();
837 838
838 ResourceRequest request(m_url); 839 ResourceRequest request(m_url);
839 request.setHTTPMethod(m_method); 840 request.setHTTPMethod(m_method);
840 request.setTargetType(ResourceRequest::TargetIsXHR); 841 request.setRequestContext(blink::WebURLRequest::RequestContextConnect);
841 842
842 InspectorInstrumentation::willLoadXHR(&executionContext, this, this, m_metho d, m_url, m_async, httpBody ? httpBody->deepCopy() : nullptr, m_requestHeaders, m_includeCredentials); 843 InspectorInstrumentation::willLoadXHR(&executionContext, this, this, m_metho d, m_url, m_async, httpBody ? httpBody->deepCopy() : nullptr, m_requestHeaders, m_includeCredentials);
843 844
844 if (httpBody) { 845 if (httpBody) {
845 ASSERT(m_method != "GET"); 846 ASSERT(m_method != "GET");
846 ASSERT(m_method != "HEAD"); 847 ASSERT(m_method != "HEAD");
847 request.setHTTPBody(httpBody); 848 request.setHTTPBody(httpBody);
848 } 849 }
849 850
850 if (m_requestHeaders.size() > 0) 851 if (m_requestHeaders.size() > 0)
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after
1462 { 1463 {
1463 visitor->trace(m_responseBlob); 1464 visitor->trace(m_responseBlob);
1464 visitor->trace(m_responseStream); 1465 visitor->trace(m_responseStream);
1465 visitor->trace(m_responseDocument); 1466 visitor->trace(m_responseDocument);
1466 visitor->trace(m_progressEventThrottle); 1467 visitor->trace(m_progressEventThrottle);
1467 visitor->trace(m_upload); 1468 visitor->trace(m_upload);
1468 XMLHttpRequestEventTarget::trace(visitor); 1469 XMLHttpRequestEventTarget::trace(visitor);
1469 } 1470 }
1470 1471
1471 } // namespace WebCore 1472 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/workers/WorkerScriptLoader.cpp ('k') | Source/platform/exported/WebURLRequest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698