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

Unified Diff: third_party/WebKit/Source/core/loader/FrameFetchContext.cpp

Issue 2786673002: Separate ContentSettingsClient out from LocalFrameClient (Closed)
Patch Set: added class-level comment 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
diff --git a/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp b/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
index b2f46c545946764982f7b444fdbc1a2e1055e001..c1289356bf8018e79a48e839c5387a14de0a2e52 100644
--- a/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
+++ b/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
@@ -35,6 +35,7 @@
#include "bindings/core/v8/ScriptController.h"
#include "bindings/core/v8/V8DOMActivityLogger.h"
#include "core/dom/Document.h"
+#include "core/frame/ContentSettingsClient.h"
#include "core/frame/Deprecation.h"
#include "core/frame/FrameConsole.h"
#include "core/frame/FrameView.h"
@@ -342,6 +343,10 @@ LocalFrameClient* FrameFetchContext::localFrameClient() const {
return frame()->client();
}
+ContentSettingsClient* FrameFetchContext::contentSettingsClient() const {
+ return frame()->contentSettingsClient();
+}
+
void FrameFetchContext::addAdditionalRequestHeaders(ResourceRequest& request,
FetchResourceType type) {
bool isMainResource = type == FetchMainResource;
@@ -652,7 +657,7 @@ void FrameFetchContext::addResourceTiming(const ResourceTimingInfo& info) {
}
bool FrameFetchContext::allowImage(bool imagesEnabled, const KURL& url) const {
- return localFrameClient()->allowImage(imagesEnabled, url);
+ return contentSettingsClient()->allowImage(imagesEnabled, url);
}
void FrameFetchContext::printAccessDeniedMessage(const KURL& url) const {
@@ -787,10 +792,10 @@ ResourceRequestBlockedReason FrameFetchContext::canRequestInternal(
if (type == Resource::Script || type == Resource::ImportResource) {
DCHECK(frame());
- if (!localFrameClient()->allowScriptFromSource(
+ if (!contentSettingsClient()->allowScriptFromSource(
!frame()->settings() || frame()->settings()->getScriptEnabled(),
url)) {
- localFrameClient()->didNotAllowScript();
+ contentSettingsClient()->didNotAllowScript();
// TODO(estark): Use a different ResourceRequestBlockedReason here, since
// this check has nothing to do with CSP. https://crbug.com/600795
return ResourceRequestBlockedReason::CSP;
« no previous file with comments | « third_party/WebKit/Source/core/loader/FrameFetchContext.h ('k') | third_party/WebKit/Source/core/loader/FrameLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698