| 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 16 matching lines...) Expand all Loading... |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef FrameFetchContext_h | 31 #ifndef FrameFetchContext_h |
| 32 #define FrameFetchContext_h | 32 #define FrameFetchContext_h |
| 33 | 33 |
| 34 #include "core/CoreExport.h" | 34 #include "core/CoreExport.h" |
| 35 #include "core/fetch/FetchContext.h" | 35 #include "core/fetch/FetchContext.h" |
| 36 #include "core/fetch/ResourceFetcher.h" | 36 #include "core/fetch/ResourceFetcher.h" |
| 37 #include "core/frame/csp/ContentSecurityPolicy.h" |
| 37 #include "platform/heap/Handle.h" | 38 #include "platform/heap/Handle.h" |
| 38 #include "platform/network/ResourceRequest.h" | 39 #include "platform/network/ResourceRequest.h" |
| 39 #include "wtf/PassOwnPtr.h" | 40 #include "wtf/PassOwnPtr.h" |
| 40 | 41 |
| 41 namespace blink { | 42 namespace blink { |
| 42 | 43 |
| 43 class Document; | 44 class Document; |
| 44 class DocumentLoader; | 45 class DocumentLoader; |
| 45 class LocalFrame; | 46 class LocalFrame; |
| 46 class ResourceError; | 47 class ResourceError; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 void dispatchDidFinishLoading(unsigned long identifier, double finishTime, i
nt64_t encodedDataLength) override; | 80 void dispatchDidFinishLoading(unsigned long identifier, double finishTime, i
nt64_t encodedDataLength) override; |
| 80 void dispatchDidFail(unsigned long identifier, const ResourceError&, bool is
InternalRequest) override; | 81 void dispatchDidFail(unsigned long identifier, const ResourceError&, bool is
InternalRequest) override; |
| 81 | 82 |
| 82 bool shouldLoadNewResource(Resource::Type) const override; | 83 bool shouldLoadNewResource(Resource::Type) const override; |
| 83 void willStartLoadingResource(ResourceRequest&) override; | 84 void willStartLoadingResource(ResourceRequest&) override; |
| 84 void didLoadResource() override; | 85 void didLoadResource() override; |
| 85 | 86 |
| 86 void addResourceTiming(const ResourceTimingInfo&) override; | 87 void addResourceTiming(const ResourceTimingInfo&) override; |
| 87 bool allowImage(bool imagesEnabled, const KURL&) const override; | 88 bool allowImage(bool imagesEnabled, const KURL&) const override; |
| 88 bool canRequest(Resource::Type, const ResourceRequest&, const KURL&, const R
esourceLoaderOptions&, bool forPreload, FetchRequest::OriginRestriction) const o
verride; | 89 bool canRequest(Resource::Type, const ResourceRequest&, const KURL&, const R
esourceLoaderOptions&, bool forPreload, FetchRequest::OriginRestriction) const o
verride; |
| 90 bool allowResponse(Resource::Type, const ResourceRequest&, const KURL&, cons
t ResourceLoaderOptions&) const override; |
| 89 | 91 |
| 90 bool isControlledByServiceWorker() const override; | 92 bool isControlledByServiceWorker() const override; |
| 91 int64_t serviceWorkerID() const override; | 93 int64_t serviceWorkerID() const override; |
| 92 | 94 |
| 93 bool isMainFrame() const override; | 95 bool isMainFrame() const override; |
| 94 bool defersLoading() const override; | 96 bool defersLoading() const override; |
| 95 bool isLoadComplete() const override; | 97 bool isLoadComplete() const override; |
| 96 bool pageDismissalEventBeingDispatched() const override; | 98 bool pageDismissalEventBeingDispatched() const override; |
| 97 bool updateTimingInfoForIFrameNavigation(ResourceTimingInfo*) override; | 99 bool updateTimingInfoForIFrameNavigation(ResourceTimingInfo*) override; |
| 98 void sendImagePing(const KURL&) override; | 100 void sendImagePing(const KURL&) override; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 111 WebTaskRunner* loadingTaskRunner() const override; | 113 WebTaskRunner* loadingTaskRunner() const override; |
| 112 | 114 |
| 113 DECLARE_VIRTUAL_TRACE(); | 115 DECLARE_VIRTUAL_TRACE(); |
| 114 | 116 |
| 115 private: | 117 private: |
| 116 explicit FrameFetchContext(DocumentLoader*); | 118 explicit FrameFetchContext(DocumentLoader*); |
| 117 inline DocumentLoader* ensureLoaderForNotifications() const; | 119 inline DocumentLoader* ensureLoaderForNotifications() const; |
| 118 | 120 |
| 119 LocalFrame* frame() const; // Can be null | 121 LocalFrame* frame() const; // Can be null |
| 120 void printAccessDeniedMessage(const KURL&) const; | 122 void printAccessDeniedMessage(const KURL&) const; |
| 121 ResourceRequestBlockedReason canRequestInternal(Resource::Type, const Resour
ceRequest&, const KURL&, const ResourceLoaderOptions&, bool forPreload, FetchReq
uest::OriginRestriction) const; | 123 ResourceRequestBlockedReason canRequestInternal(Resource::Type, const Resour
ceRequest&, const KURL&, const ResourceLoaderOptions&, bool forPreload, FetchReq
uest::OriginRestriction, ContentSecurityPolicy::RedirectStatus) const; |
| 122 | 124 |
| 123 // FIXME: Oilpan: Ideally this should just be a traced Member but that will | 125 // FIXME: Oilpan: Ideally this should just be a traced Member but that will |
| 124 // currently leak because ComputedStyle and its data are not on the heap. | 126 // currently leak because ComputedStyle and its data are not on the heap. |
| 125 // See crbug.com/383860 for details. | 127 // See crbug.com/383860 for details. |
| 126 RawPtrWillBeWeakMember<Document> m_document; | 128 RawPtrWillBeWeakMember<Document> m_document; |
| 127 RawPtrWillBeMember<DocumentLoader> m_documentLoader; | 129 RawPtrWillBeMember<DocumentLoader> m_documentLoader; |
| 128 | 130 |
| 129 bool m_imageFetched : 1; | 131 bool m_imageFetched : 1; |
| 130 }; | 132 }; |
| 131 | 133 |
| 132 } | 134 } |
| 133 | 135 |
| 134 #endif | 136 #endif |
| OLD | NEW |