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

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

Issue 1903953002: [DevTools] Move from InstrumentingAgents to InstrumentingSessions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove-discard-agent
Patch Set: rebased 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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 29 matching lines...) Expand all
40 #include "core/frame/FrameView.h" 40 #include "core/frame/FrameView.h"
41 #include "core/frame/LocalFrame.h" 41 #include "core/frame/LocalFrame.h"
42 #include "core/frame/Settings.h" 42 #include "core/frame/Settings.h"
43 #include "core/html/HTMLFrameOwnerElement.h" 43 #include "core/html/HTMLFrameOwnerElement.h"
44 #include "core/html/imports/HTMLImportsController.h" 44 #include "core/html/imports/HTMLImportsController.h"
45 #include "core/inspector/ConsoleMessage.h" 45 #include "core/inspector/ConsoleMessage.h"
46 #include "core/inspector/IdentifiersFactory.h" 46 #include "core/inspector/IdentifiersFactory.h"
47 #include "core/inspector/InspectorInstrumentation.h" 47 #include "core/inspector/InspectorInstrumentation.h"
48 #include "core/inspector/InspectorResourceAgent.h" 48 #include "core/inspector/InspectorResourceAgent.h"
49 #include "core/inspector/InspectorTraceEvents.h" 49 #include "core/inspector/InspectorTraceEvents.h"
50 #include "core/inspector/InstrumentingAgents.h"
51 #include "core/loader/DocumentLoader.h" 50 #include "core/loader/DocumentLoader.h"
52 #include "core/loader/FrameLoader.h" 51 #include "core/loader/FrameLoader.h"
53 #include "core/loader/FrameLoaderClient.h" 52 #include "core/loader/FrameLoaderClient.h"
54 #include "core/loader/LinkLoader.h" 53 #include "core/loader/LinkLoader.h"
55 #include "core/loader/MixedContentChecker.h" 54 #include "core/loader/MixedContentChecker.h"
56 #include "core/loader/NetworkHintsInterface.h" 55 #include "core/loader/NetworkHintsInterface.h"
57 #include "core/loader/PingLoader.h" 56 #include "core/loader/PingLoader.h"
58 #include "core/loader/ProgressTracker.h" 57 #include "core/loader/ProgressTracker.h"
59 #include "core/loader/appcache/ApplicationCacheHost.h" 58 #include "core/loader/appcache/ApplicationCacheHost.h"
60 #include "core/page/NetworkStateNotifier.h" 59 #include "core/page/NetworkStateNotifier.h"
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 ResourceRequestBlockedReason reason = canRequestInternal(type, resourceReque st, url, options, false, FetchRequest::UseDefaultOriginRestrictionForType, Conte ntSecurityPolicy::DidRedirect); 438 ResourceRequestBlockedReason reason = canRequestInternal(type, resourceReque st, url, options, false, FetchRequest::UseDefaultOriginRestrictionForType, Conte ntSecurityPolicy::DidRedirect);
440 if (reason != ResourceRequestBlockedReasonNone) { 439 if (reason != ResourceRequestBlockedReasonNone) {
441 InspectorInstrumentation::didBlockRequest(frame(), resourceRequest, ensu reLoaderForNotifications(), options.initiatorInfo, reason); 440 InspectorInstrumentation::didBlockRequest(frame(), resourceRequest, ensu reLoaderForNotifications(), options.initiatorInfo, reason);
442 return false; 441 return false;
443 } 442 }
444 return true; 443 return true;
445 } 444 }
446 445
447 ResourceRequestBlockedReason FrameFetchContext::canRequestInternal(Resource::Typ e type, const ResourceRequest& resourceRequest, const KURL& url, const ResourceL oaderOptions& options, bool forPreload, FetchRequest::OriginRestriction originRe striction, ContentSecurityPolicy::RedirectStatus redirectStatus) const 446 ResourceRequestBlockedReason FrameFetchContext::canRequestInternal(Resource::Typ e type, const ResourceRequest& resourceRequest, const KURL& url, const ResourceL oaderOptions& options, bool forPreload, FetchRequest::OriginRestriction originRe striction, ContentSecurityPolicy::RedirectStatus redirectStatus) const
448 { 447 {
449 InstrumentingAgents* agents = InspectorInstrumentation::instrumentingAgentsF or(frame()); 448 if (InspectorInstrumentation::shouldBlockRequest(frame(), resourceRequest))
450 if (agents && agents->inspectorResourceAgent()) { 449 return ResourceRequestBlockedReasonInspector;
451 if (agents->inspectorResourceAgent()->shouldBlockRequest(resourceRequest ))
452 return ResourceRequestBlockedReasonInspector;
453 }
454 450
455 SecurityOrigin* securityOrigin = options.securityOrigin.get(); 451 SecurityOrigin* securityOrigin = options.securityOrigin.get();
456 if (!securityOrigin && m_document) 452 if (!securityOrigin && m_document)
457 securityOrigin = m_document->getSecurityOrigin(); 453 securityOrigin = m_document->getSecurityOrigin();
458 454
459 if (originRestriction != FetchRequest::NoOriginRestriction && securityOrigin && !securityOrigin->canDisplay(url)) { 455 if (originRestriction != FetchRequest::NoOriginRestriction && securityOrigin && !securityOrigin->canDisplay(url)) {
460 if (!forPreload) 456 if (!forPreload)
461 FrameLoader::reportLocalLoadFailed(frame(), url.elidedString()); 457 FrameLoader::reportLocalLoadFailed(frame(), url.elidedString());
462 WTF_LOG(ResourceLoading, "ResourceFetcher::requestResource URL was not a llowed by SecurityOrigin::canDisplay"); 458 WTF_LOG(ResourceLoading, "ResourceFetcher::requestResource URL was not a llowed by SecurityOrigin::canDisplay");
463 return ResourceRequestBlockedReasonOther; 459 return ResourceRequestBlockedReasonOther;
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
793 } 789 }
794 790
795 DEFINE_TRACE(FrameFetchContext) 791 DEFINE_TRACE(FrameFetchContext)
796 { 792 {
797 visitor->trace(m_document); 793 visitor->trace(m_document);
798 visitor->trace(m_documentLoader); 794 visitor->trace(m_documentLoader);
799 FetchContext::trace(visitor); 795 FetchContext::trace(visitor);
800 } 796 }
801 797
802 } // namespace blink 798 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698