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

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

Issue 2105503002: Skip foreign fetch when the skipServiceWorker flag is set on a request. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rephrase SkipServiceWorker comments. Created 4 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
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 869 matching lines...) Expand 10 before | Expand all | Expand 10 after
880 UseCounter::count(&executionContext, UseCounter::XMLHttpRequestCrossOrig inWithCredentials); 880 UseCounter::count(&executionContext, UseCounter::XMLHttpRequestCrossOrig inWithCredentials);
881 881
882 // We also remember whether upload events should be allowed for this request in case the upload listeners are 882 // We also remember whether upload events should be allowed for this request in case the upload listeners are
883 // added after the request is started. 883 // added after the request is started.
884 m_uploadEventsAllowed = m_sameOriginRequest || uploadEvents || !FetchUtils:: isSimpleRequest(m_method, m_requestHeaders); 884 m_uploadEventsAllowed = m_sameOriginRequest || uploadEvents || !FetchUtils:: isSimpleRequest(m_method, m_requestHeaders);
885 885
886 ResourceRequest request(m_url); 886 ResourceRequest request(m_url);
887 request.setHTTPMethod(m_method); 887 request.setHTTPMethod(m_method);
888 request.setRequestContext(WebURLRequest::RequestContextXMLHttpRequest); 888 request.setRequestContext(WebURLRequest::RequestContextXMLHttpRequest);
889 request.setFetchCredentialsMode(m_includeCredentials ? WebURLRequest::FetchC redentialsModeInclude : WebURLRequest::FetchCredentialsModeSameOrigin); 889 request.setFetchCredentialsMode(m_includeCredentials ? WebURLRequest::FetchC redentialsModeInclude : WebURLRequest::FetchCredentialsModeSameOrigin);
890 request.setSkipServiceWorker(m_isolatedWorldSecurityOrigin.get()); 890 request.setSkipServiceWorker(m_isolatedWorldSecurityOrigin.get() ? WebURLReq uest::SkipServiceWorker::All : WebURLRequest::SkipServiceWorker::None);
891 request.setExternalRequestStateFromRequestorAddressSpace(executionContext.se curityContext().addressSpace()); 891 request.setExternalRequestStateFromRequestorAddressSpace(executionContext.se curityContext().addressSpace());
892 892
893 InspectorInstrumentation::willLoadXHR(&executionContext, this, this, m_metho d, m_url, m_async, httpBody ? httpBody->deepCopy() : nullptr, m_requestHeaders, m_includeCredentials); 893 InspectorInstrumentation::willLoadXHR(&executionContext, this, this, m_metho d, m_url, m_async, httpBody ? httpBody->deepCopy() : nullptr, m_requestHeaders, m_includeCredentials);
894 894
895 if (httpBody) { 895 if (httpBody) {
896 ASSERT(m_method != HTTPNames::GET); 896 ASSERT(m_method != HTTPNames::GET);
897 ASSERT(m_method != HTTPNames::HEAD); 897 ASSERT(m_method != HTTPNames::HEAD);
898 request.setHTTPBody(httpBody); 898 request.setHTTPBody(httpBody);
899 } 899 }
900 900
(...skipping 809 matching lines...) Expand 10 before | Expand all | Expand 10 after
1710 visitor->trace(m_responseArrayBuffer); 1710 visitor->trace(m_responseArrayBuffer);
1711 visitor->trace(m_progressEventThrottle); 1711 visitor->trace(m_progressEventThrottle);
1712 visitor->trace(m_upload); 1712 visitor->trace(m_upload);
1713 visitor->trace(m_blobLoader); 1713 visitor->trace(m_blobLoader);
1714 XMLHttpRequestEventTarget::trace(visitor); 1714 XMLHttpRequestEventTarget::trace(visitor);
1715 DocumentParserClient::trace(visitor); 1715 DocumentParserClient::trace(visitor);
1716 ActiveDOMObject::trace(visitor); 1716 ActiveDOMObject::trace(visitor);
1717 } 1717 }
1718 1718
1719 } // namespace blink 1719 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/loader/FrameLoader.cpp ('k') | third_party/WebKit/Source/modules/fetch/FetchManager.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698