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

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

Issue 1886663003: Measure how many pages are using cross-origin XHR with withCredentials set to true (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: FIxed Created 4 years, 8 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 856 matching lines...) Expand 10 before | Expand all | Expand 10 after
867 InspectorInstrumentation::asyncTaskScheduled(&executionContext, "XMLHttp Request.send", this, true); 867 InspectorInstrumentation::asyncTaskScheduled(&executionContext, "XMLHttp Request.send", this, true);
868 dispatchProgressEvent(EventTypeNames::loadstart, 0, 0); 868 dispatchProgressEvent(EventTypeNames::loadstart, 0, 0);
869 if (httpBody && m_upload) { 869 if (httpBody && m_upload) {
870 uploadEvents = m_upload->hasEventListeners(); 870 uploadEvents = m_upload->hasEventListeners();
871 m_upload->dispatchEvent(ProgressEvent::create(EventTypeNames::loadst art, false, 0, 0)); 871 m_upload->dispatchEvent(ProgressEvent::create(EventTypeNames::loadst art, false, 0, 0));
872 } 872 }
873 } 873 }
874 874
875 m_sameOriginRequest = getSecurityOrigin()->canRequestNoSuborigin(m_url); 875 m_sameOriginRequest = getSecurityOrigin()->canRequestNoSuborigin(m_url);
876 876
877 if (m_sameOriginRequest && m_includeCredentials)
yhirano 2016/04/14 04:26:02 !m_sameOriginRequest?
tyoshino (SeeGerritForStatus) 2016/04/14 04:42:45 My bad... Fixed
878 UseCounter::count(&executionContext, UseCounter::XMLHttpRequestCrossOrig inWithCredentials);
879
877 // We also remember whether upload events should be allowed for this request in case the upload listeners are 880 // We also remember whether upload events should be allowed for this request in case the upload listeners are
878 // added after the request is started. 881 // added after the request is started.
879 m_uploadEventsAllowed = m_sameOriginRequest || uploadEvents || !FetchUtils:: isSimpleRequest(m_method, m_requestHeaders); 882 m_uploadEventsAllowed = m_sameOriginRequest || uploadEvents || !FetchUtils:: isSimpleRequest(m_method, m_requestHeaders);
880 883
881 ResourceRequest request(m_url); 884 ResourceRequest request(m_url);
882 request.setHTTPMethod(m_method); 885 request.setHTTPMethod(m_method);
883 request.setRequestContext(WebURLRequest::RequestContextXMLHttpRequest); 886 request.setRequestContext(WebURLRequest::RequestContextXMLHttpRequest);
884 request.setFetchCredentialsMode(m_includeCredentials ? WebURLRequest::FetchC redentialsModeInclude : WebURLRequest::FetchCredentialsModeSameOrigin); 887 request.setFetchCredentialsMode(m_includeCredentials ? WebURLRequest::FetchC redentialsModeInclude : WebURLRequest::FetchCredentialsModeSameOrigin);
885 request.setSkipServiceWorker(m_isolatedWorldSecurityOrigin); 888 request.setSkipServiceWorker(m_isolatedWorldSecurityOrigin);
886 request.setExternalRequestStateFromRequestorAddressSpace(executionContext.se curityContext().addressSpace()); 889 request.setExternalRequestStateFromRequestorAddressSpace(executionContext.se curityContext().addressSpace());
(...skipping 817 matching lines...) Expand 10 before | Expand all | Expand 10 after
1704 visitor->trace(m_responseArrayBuffer); 1707 visitor->trace(m_responseArrayBuffer);
1705 visitor->trace(m_progressEventThrottle); 1708 visitor->trace(m_progressEventThrottle);
1706 visitor->trace(m_upload); 1709 visitor->trace(m_upload);
1707 visitor->trace(m_blobLoader); 1710 visitor->trace(m_blobLoader);
1708 XMLHttpRequestEventTarget::trace(visitor); 1711 XMLHttpRequestEventTarget::trace(visitor);
1709 DocumentParserClient::trace(visitor); 1712 DocumentParserClient::trace(visitor);
1710 ActiveDOMObject::trace(visitor); 1713 ActiveDOMObject::trace(visitor);
1711 } 1714 }
1712 1715
1713 } // namespace blink 1716 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/UseCounter.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698