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

Side by Side Diff: third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp

Issue 1749153002: CORS-RFC1918: Teach ResourceRequest about "external" requests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Jochen's feedback. Created 4 years, 9 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
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 863 matching lines...) Expand 10 before | Expand all | Expand 10 after
874 m_uploadEventsAllowed = m_sameOriginRequest || uploadEvents || !FetchUtils:: isSimpleRequest(m_method, m_requestHeaders); 874 m_uploadEventsAllowed = m_sameOriginRequest || uploadEvents || !FetchUtils:: isSimpleRequest(m_method, m_requestHeaders);
875 875
876 ASSERT(executionContext()); 876 ASSERT(executionContext());
877 ExecutionContext& executionContext = *this->executionContext(); 877 ExecutionContext& executionContext = *this->executionContext();
878 878
879 ResourceRequest request(m_url); 879 ResourceRequest request(m_url);
880 request.setHTTPMethod(m_method); 880 request.setHTTPMethod(m_method);
881 request.setRequestContext(WebURLRequest::RequestContextXMLHttpRequest); 881 request.setRequestContext(WebURLRequest::RequestContextXMLHttpRequest);
882 request.setFetchCredentialsMode(m_includeCredentials ? WebURLRequest::FetchC redentialsModeInclude : WebURLRequest::FetchCredentialsModeSameOrigin); 882 request.setFetchCredentialsMode(m_includeCredentials ? WebURLRequest::FetchC redentialsModeInclude : WebURLRequest::FetchCredentialsModeSameOrigin);
883 request.setSkipServiceWorker(m_isolatedWorldSecurityOrigin); 883 request.setSkipServiceWorker(m_isolatedWorldSecurityOrigin);
884 request.setExternalRequestStateFromRequestorAddressSpace(executionContext.se curityContext().addressSpace());
884 885
885 InspectorInstrumentation::willLoadXHR(&executionContext, this, this, m_metho d, m_url, m_async, httpBody ? httpBody->deepCopy() : nullptr, m_requestHeaders, m_includeCredentials); 886 InspectorInstrumentation::willLoadXHR(&executionContext, this, this, m_metho d, m_url, m_async, httpBody ? httpBody->deepCopy() : nullptr, m_requestHeaders, m_includeCredentials);
886 887
887 if (httpBody) { 888 if (httpBody) {
888 ASSERT(m_method != HTTPNames::GET); 889 ASSERT(m_method != HTTPNames::GET);
889 ASSERT(m_method != HTTPNames::HEAD); 890 ASSERT(m_method != HTTPNames::HEAD);
890 request.setHTTPBody(httpBody); 891 request.setHTTPBody(httpBody);
891 } 892 }
892 893
893 if (m_requestHeaders.size() > 0) 894 if (m_requestHeaders.size() > 0)
(...skipping 807 matching lines...) Expand 10 before | Expand all | Expand 10 after
1701 visitor->trace(m_responseDocumentParser); 1702 visitor->trace(m_responseDocumentParser);
1702 visitor->trace(m_progressEventThrottle); 1703 visitor->trace(m_progressEventThrottle);
1703 visitor->trace(m_upload); 1704 visitor->trace(m_upload);
1704 visitor->trace(m_blobLoader); 1705 visitor->trace(m_blobLoader);
1705 XMLHttpRequestEventTarget::trace(visitor); 1706 XMLHttpRequestEventTarget::trace(visitor);
1706 DocumentParserClient::trace(visitor); 1707 DocumentParserClient::trace(visitor);
1707 ActiveDOMObject::trace(visitor); 1708 ActiveDOMObject::trace(visitor);
1708 } 1709 }
1709 1710
1710 } // namespace blink 1711 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698