| 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 21 matching lines...) Expand all Loading... |
| 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 "platform/network/ResourceRequest.h" |
| 42 #include "wtf/Forward.h" |
| 42 #include "wtf/Noncopyable.h" | 43 #include "wtf/Noncopyable.h" |
| 43 | 44 |
| 44 namespace blink { | 45 namespace blink { |
| 45 | 46 |
| 46 class KURL; | 47 class KURL; |
| 47 class MHTMLArchive; | 48 class MHTMLArchive; |
| 48 class ResourceError; | 49 class ResourceError; |
| 49 class ResourceResponse; | 50 class ResourceResponse; |
| 50 class ResourceTimingInfo; | 51 class ResourceTimingInfo; |
| 51 class WebTaskRunner; | 52 class WebTaskRunner; |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 double finishTime, | 116 double finishTime, |
| 116 int64_t encodedDataLength); | 117 int64_t encodedDataLength); |
| 117 virtual void dispatchDidFail(unsigned long identifier, | 118 virtual void dispatchDidFail(unsigned long identifier, |
| 118 const ResourceError&, | 119 const ResourceError&, |
| 119 int64_t encodedDataLength, | 120 int64_t encodedDataLength, |
| 120 bool isInternalRequest); | 121 bool isInternalRequest); |
| 121 | 122 |
| 122 virtual bool shouldLoadNewResource(Resource::Type) const { return false; } | 123 virtual bool shouldLoadNewResource(Resource::Type) const { return false; } |
| 123 // Called when a resource load is first requested, which may not be when the | 124 // Called when a resource load is first requested, which may not be when the |
| 124 // load actually begins. | 125 // load actually begins. |
| 126 // TODO(toyoshim): Consider to use enum. See https://crbug.com/675883. |
| 125 virtual void willStartLoadingResource(unsigned long identifier, | 127 virtual void willStartLoadingResource(unsigned long identifier, |
| 126 ResourceRequest&, | 128 ResourceRequest&, |
| 127 Resource::Type); | 129 Resource::Type, |
| 130 const AtomicString& fetchInitiatorName, |
| 131 bool forPreload); |
| 128 virtual void didLoadResource(Resource*); | 132 virtual void didLoadResource(Resource*); |
| 129 | 133 |
| 130 virtual void addResourceTiming(const ResourceTimingInfo&); | 134 virtual void addResourceTiming(const ResourceTimingInfo&); |
| 131 virtual bool allowImage(bool, const KURL&) const { return false; } | 135 virtual bool allowImage(bool, const KURL&) const { return false; } |
| 136 // TODO(toyoshim): Consider to use enum. See https://crbug.com/675883. |
| 132 virtual ResourceRequestBlockedReason canRequest( | 137 virtual ResourceRequestBlockedReason canRequest( |
| 133 Resource::Type, | 138 Resource::Type, |
| 134 const ResourceRequest&, | 139 const ResourceRequest&, |
| 135 const KURL&, | 140 const KURL&, |
| 136 const ResourceLoaderOptions&, | 141 const ResourceLoaderOptions&, |
| 137 bool forPreload, | 142 bool forPreload, |
| 138 FetchRequest::OriginRestriction) const { | 143 FetchRequest::OriginRestriction) const { |
| 139 return ResourceRequestBlockedReason::Other; | 144 return ResourceRequestBlockedReason::Other; |
| 140 } | 145 } |
| 141 virtual ResourceRequestBlockedReason allowResponse( | 146 virtual ResourceRequestBlockedReason allowResponse( |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 | 179 |
| 175 virtual WebTaskRunner* loadingTaskRunner() const { return nullptr; } | 180 virtual WebTaskRunner* loadingTaskRunner() const { return nullptr; } |
| 176 | 181 |
| 177 protected: | 182 protected: |
| 178 FetchContext() {} | 183 FetchContext() {} |
| 179 }; | 184 }; |
| 180 | 185 |
| 181 } // namespace blink | 186 } // namespace blink |
| 182 | 187 |
| 183 #endif | 188 #endif |
| OLD | NEW |