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

Side by Side Diff: third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp

Issue 2800853002: [instrumentation] Turn inspector override "probes" return values into output parameters. (Closed)
Patch Set: update BUILD.gn Created 3 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) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved.
3 * Copyright (C) 2013, Intel Corporation 3 * Copyright (C) 2013, Intel Corporation
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 19 matching lines...) Expand all
30 */ 30 */
31 31
32 #include "core/loader/DocumentThreadableLoader.h" 32 #include "core/loader/DocumentThreadableLoader.h"
33 33
34 #include <memory> 34 #include <memory>
35 #include "core/dom/Document.h" 35 #include "core/dom/Document.h"
36 #include "core/dom/TaskRunnerHelper.h" 36 #include "core/dom/TaskRunnerHelper.h"
37 #include "core/frame/FrameConsole.h" 37 #include "core/frame/FrameConsole.h"
38 #include "core/frame/LocalFrame.h" 38 #include "core/frame/LocalFrame.h"
39 #include "core/frame/LocalFrameClient.h" 39 #include "core/frame/LocalFrameClient.h"
40 #include "core/inspector/InspectorNetworkAgent.h"
40 #include "core/inspector/InspectorTraceEvents.h" 41 #include "core/inspector/InspectorTraceEvents.h"
41 #include "core/loader/DocumentThreadableLoaderClient.h" 42 #include "core/loader/DocumentThreadableLoaderClient.h"
42 #include "core/loader/FrameLoader.h" 43 #include "core/loader/FrameLoader.h"
43 #include "core/loader/ThreadableLoaderClient.h" 44 #include "core/loader/ThreadableLoaderClient.h"
44 #include "core/loader/ThreadableLoadingContext.h" 45 #include "core/loader/ThreadableLoadingContext.h"
45 #include "core/loader/private/CrossOriginPreflightResultCache.h" 46 #include "core/loader/private/CrossOriginPreflightResultCache.h"
46 #include "core/page/ChromeClient.h" 47 #include "core/page/ChromeClient.h"
47 #include "core/page/Page.h" 48 #include "core/page/Page.h"
48 #include "core/probe/CoreProbes.h" 49 #include "core/probe/CoreProbes.h"
49 #include "platform/SharedBuffer.h" 50 #include "platform/SharedBuffer.h"
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 // Explicitly set the ServiceWorkerMode to None here. Although the page is 380 // Explicitly set the ServiceWorkerMode to None here. Although the page is
380 // not controlled by a SW at this point, a new SW may be controlling the 381 // not controlled by a SW at this point, a new SW may be controlling the
381 // page when this request gets sent later. We should not send the actual 382 // page when this request gets sent later. We should not send the actual
382 // request to the SW. https://crbug.com/604583 383 // request to the SW. https://crbug.com/604583
383 // Similarly we don't want any requests that could involve a CORS preflight 384 // Similarly we don't want any requests that could involve a CORS preflight
384 // to get intercepted by a foreign fetch service worker, even if we have the 385 // to get intercepted by a foreign fetch service worker, even if we have the
385 // result of the preflight cached already. https://crbug.com/674370 386 // result of the preflight cached already. https://crbug.com/674370
386 crossOriginRequest.setServiceWorkerMode( 387 crossOriginRequest.setServiceWorkerMode(
387 WebURLRequest::ServiceWorkerMode::None); 388 WebURLRequest::ServiceWorkerMode::None);
388 389
389 bool shouldForcePreflight = request.isExternalRequest() || 390 bool shouldForcePreflight = request.isExternalRequest();
390 probe::shouldForceCORSPreflight(document()); 391 if (!shouldForcePreflight)
392 probe::shouldForceCORSPreflight(document(), &shouldForcePreflight);
391 bool canSkipPreflight = 393 bool canSkipPreflight =
392 CrossOriginPreflightResultCache::shared().canSkipPreflight( 394 CrossOriginPreflightResultCache::shared().canSkipPreflight(
393 getSecurityOrigin()->toString(), crossOriginRequest.url(), 395 getSecurityOrigin()->toString(), crossOriginRequest.url(),
394 effectiveAllowCredentials(), crossOriginRequest.httpMethod(), 396 effectiveAllowCredentials(), crossOriginRequest.httpMethod(),
395 crossOriginRequest.httpHeaderFields()); 397 crossOriginRequest.httpHeaderFields());
396 if (canSkipPreflight && !shouldForcePreflight) { 398 if (canSkipPreflight && !shouldForcePreflight) {
397 prepareCrossOriginRequest(crossOriginRequest); 399 prepareCrossOriginRequest(crossOriginRequest);
398 loadRequest(crossOriginRequest, crossOriginOptions); 400 loadRequest(crossOriginRequest, crossOriginOptions);
399 } else { 401 } else {
400 ResourceRequest preflightRequest = 402 ResourceRequest preflightRequest =
(...skipping 743 matching lines...) Expand 10 before | Expand all | Expand 10 after
1144 } 1146 }
1145 1147
1146 DEFINE_TRACE(DocumentThreadableLoader) { 1148 DEFINE_TRACE(DocumentThreadableLoader) {
1147 visitor->trace(m_resource); 1149 visitor->trace(m_resource);
1148 visitor->trace(m_loadingContext); 1150 visitor->trace(m_loadingContext);
1149 ThreadableLoader::trace(visitor); 1151 ThreadableLoader::trace(visitor);
1150 RawResourceClient::trace(visitor); 1152 RawResourceClient::trace(visitor);
1151 } 1153 }
1152 1154
1153 } // namespace blink 1155 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698