| OLD | NEW |
| 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 19 matching lines...) Expand all Loading... |
| 30 | 30 |
| 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/ContentSecurityPolicyParsers.h" |
| 40 #include "platform/network/ResourceLoadPriority.h" | 41 #include "platform/network/ResourceLoadPriority.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 ResourceRequest; |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 virtual bool shouldLoadNewResource(Resource::Type) const { return false; } | 117 virtual bool shouldLoadNewResource(Resource::Type) const { return false; } |
| 117 // Called when a resource load is first requested, which may not be when the | 118 // Called when a resource load is first requested, which may not be when the |
| 118 // load actually begins. | 119 // load actually begins. |
| 119 virtual void willStartLoadingResource(unsigned long identifier, | 120 virtual void willStartLoadingResource(unsigned long identifier, |
| 120 ResourceRequest&, | 121 ResourceRequest&, |
| 121 Resource::Type); | 122 Resource::Type); |
| 122 virtual void didLoadResource(Resource*); | 123 virtual void didLoadResource(Resource*); |
| 123 | 124 |
| 124 virtual void addResourceTiming(const ResourceTimingInfo&); | 125 virtual void addResourceTiming(const ResourceTimingInfo&); |
| 125 virtual bool allowImage(bool, const KURL&) const { return false; } | 126 virtual bool allowImage(bool, const KURL&) const { return false; } |
| 127 virtual ResourceRequestBlockedReason checkCSPForRequest( |
| 128 const ResourceRequest&, |
| 129 const KURL&, |
| 130 const ResourceLoaderOptions&, |
| 131 bool forPreload, |
| 132 ResourceRequest::RedirectStatus, |
| 133 ContentSecurityPolicyHeaderType) const { |
| 134 return ResourceRequestBlockedReasonCSP; |
| 135 } |
| 126 virtual bool canRequest(Resource::Type, | 136 virtual bool canRequest(Resource::Type, |
| 127 const ResourceRequest&, | 137 const ResourceRequest&, |
| 128 const KURL&, | 138 const KURL&, |
| 129 const ResourceLoaderOptions&, | 139 const ResourceLoaderOptions&, |
| 130 bool forPreload, | 140 bool forPreload, |
| 131 FetchRequest::OriginRestriction) const { | 141 FetchRequest::OriginRestriction) const { |
| 132 return false; | 142 return false; |
| 133 } | 143 } |
| 134 virtual bool allowResponse(Resource::Type, | 144 virtual bool allowResponse(Resource::Type, |
| 135 const ResourceRequest&, | 145 const ResourceRequest&, |
| (...skipping 30 matching lines...) Expand all Loading... |
| 166 | 176 |
| 167 virtual WebTaskRunner* loadingTaskRunner() const { return nullptr; } | 177 virtual WebTaskRunner* loadingTaskRunner() const { return nullptr; } |
| 168 | 178 |
| 169 protected: | 179 protected: |
| 170 FetchContext() {} | 180 FetchContext() {} |
| 171 }; | 181 }; |
| 172 | 182 |
| 173 } // namespace blink | 183 } // namespace blink |
| 174 | 184 |
| 175 #endif | 185 #endif |
| OLD | NEW |