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

Side by Side Diff: third_party/WebKit/Source/core/fetch/FetchContext.h

Issue 2535383003: Collapse images disallowed by the Safe Browsing Subresource Filter. (Closed)
Patch Set: Rebase. Created 4 years 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 20 matching lines...) Expand all
31 #ifndef FetchContext_h 31 #ifndef FetchContext_h
32 #define FetchContext_h 32 #define FetchContext_h
33 33
34 #include "core/CoreExport.h" 34 #include "core/CoreExport.h"
35 #include "core/fetch/CachePolicy.h" 35 #include "core/fetch/CachePolicy.h"
36 #include "core/fetch/FetchInitiatorInfo.h" 36 #include "core/fetch/FetchInitiatorInfo.h"
37 #include "core/fetch/FetchRequest.h" 37 #include "core/fetch/FetchRequest.h"
38 #include "core/fetch/Resource.h" 38 #include "core/fetch/Resource.h"
39 #include "platform/heap/Handle.h" 39 #include "platform/heap/Handle.h"
40 #include "platform/network/ResourceLoadPriority.h" 40 #include "platform/network/ResourceLoadPriority.h"
41 #include "platform/network/ResourceRequest.h"
41 #include "wtf/Noncopyable.h" 42 #include "wtf/Noncopyable.h"
42 43
43 namespace blink { 44 namespace blink {
44 45
45 class KURL; 46 class KURL;
46 class MHTMLArchive; 47 class MHTMLArchive;
47 class ResourceError; 48 class ResourceError;
48 class ResourceResponse; 49 class ResourceResponse;
49 class ResourceRequest;
50 class ResourceTimingInfo; 50 class ResourceTimingInfo;
51 class WebTaskRunner; 51 class WebTaskRunner;
52 enum class WebCachePolicy; 52 enum class WebCachePolicy;
53 53
54 enum FetchResourceType { FetchMainResource, FetchSubresource }; 54 enum FetchResourceType { FetchMainResource, FetchSubresource };
55 55
56 class CORE_EXPORT FetchContext 56 class CORE_EXPORT FetchContext
57 : public GarbageCollectedFinalized<FetchContext> { 57 : public GarbageCollectedFinalized<FetchContext> {
58 WTF_MAKE_NONCOPYABLE(FetchContext); 58 WTF_MAKE_NONCOPYABLE(FetchContext);
59 59
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 virtual bool shouldLoadNewResource(Resource::Type) const { return false; } 116 virtual bool shouldLoadNewResource(Resource::Type) const { return false; }
117 // Called when a resource load is first requested, which may not be when the 117 // Called when a resource load is first requested, which may not be when the
118 // load actually begins. 118 // load actually begins.
119 virtual void willStartLoadingResource(unsigned long identifier, 119 virtual void willStartLoadingResource(unsigned long identifier,
120 ResourceRequest&, 120 ResourceRequest&,
121 Resource::Type); 121 Resource::Type);
122 virtual void didLoadResource(Resource*); 122 virtual void didLoadResource(Resource*);
123 123
124 virtual void addResourceTiming(const ResourceTimingInfo&); 124 virtual void addResourceTiming(const ResourceTimingInfo&);
125 virtual bool allowImage(bool, const KURL&) const { return false; } 125 virtual bool allowImage(bool, const KURL&) const { return false; }
126 virtual bool canRequest(Resource::Type, 126 virtual ResourceRequestBlockedReason canRequest(
127 const ResourceRequest&, 127 Resource::Type,
128 const KURL&, 128 const ResourceRequest&,
129 const ResourceLoaderOptions&, 129 const KURL&,
130 bool forPreload, 130 const ResourceLoaderOptions&,
131 FetchRequest::OriginRestriction) const { 131 bool forPreload,
132 return false; 132 FetchRequest::OriginRestriction) const {
133 return ResourceRequestBlockedReason::Other;
133 } 134 }
134 virtual bool allowResponse(Resource::Type, 135 virtual ResourceRequestBlockedReason allowResponse(
135 const ResourceRequest&, 136 Resource::Type,
136 const KURL&, 137 const ResourceRequest&,
137 const ResourceLoaderOptions&) const { 138 const KURL&,
138 return false; 139 const ResourceLoaderOptions&) const {
140 return ResourceRequestBlockedReason::Other;
139 } 141 }
140 142
141 virtual bool isControlledByServiceWorker() const { return false; } 143 virtual bool isControlledByServiceWorker() const { return false; }
142 virtual int64_t serviceWorkerID() const { return -1; } 144 virtual int64_t serviceWorkerID() const { return -1; }
143 145
144 virtual bool isMainFrame() const { return true; } 146 virtual bool isMainFrame() const { return true; }
145 virtual bool defersLoading() const { return false; } 147 virtual bool defersLoading() const { return false; }
146 virtual bool isLoadComplete() const { return false; } 148 virtual bool isLoadComplete() const { return false; }
147 virtual bool pageDismissalEventBeingDispatched() const { return false; } 149 virtual bool pageDismissalEventBeingDispatched() const { return false; }
148 virtual bool updateTimingInfoForIFrameNavigation(ResourceTimingInfo*) { 150 virtual bool updateTimingInfoForIFrameNavigation(ResourceTimingInfo*) {
(...skipping 17 matching lines...) Expand all
166 168
167 virtual WebTaskRunner* loadingTaskRunner() const { return nullptr; } 169 virtual WebTaskRunner* loadingTaskRunner() const { return nullptr; }
168 170
169 protected: 171 protected:
170 FetchContext() {} 172 FetchContext() {}
171 }; 173 };
172 174
173 } // namespace blink 175 } // namespace blink
174 176
175 #endif 177 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698